{"_id":"@atomist/automation-client","_rev":"1813-f63dcd7bbd2f19cbc8da453f5fd446e5","name":"@atomist/automation-client","description":"Atomist API for software low-level client","dist-tags":{"latest":"1.8.3-1.8-fixes.20230418232200","branch-master":"2.0.0-master.20200713182021","branch-issue-526":"1.4.1-issue-526.20190430113041","next":"2.2.2-main.2","branch-perf":"1.7.1-perf.20190923064131","branch-async-await":"2.0.0-async-await.20200201095427","branch-1.8-fixes":"1.8.4-1.8-fixes.20200713181845","branch-1.9-fixes":"1.9.3-1.9-fixes.20210401113225","1.8-fixes":"1.8.3","branch-main":"2.2.2-main.2","1.9-fixes":"1.9.2","branch-atomist-npm-update-main":"2.2.2-branch-atomist-npm-update-main.29","branch-atomist-npm-audit-main":"2.2.2-branch-atomist-npm-audit-main.0"},"versions":{"0.1.0":{"name":"@atomist/automation-client","version":"0.1.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.11.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.2.x","npm":"5.3.x"},"gitHead":"2a0c9a35e04982b040f7fb03ad6198a223ff9947","_id":"@atomist/automation-client@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CPXpxdbMqXMZKk+yYwNsqs+6P2WiY5GwlIgAEPDqKGaMLodZKr1PpZoQnhB35Y9v3BcehLvtA9+0JXe2rnNtXQ==","shasum":"4afd048f91155419f3d7cf2dd97bfe6cba01ea13","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYwUePFgrMcrADAGL+odh9zLmP6C/k0AYclR17n1AqTQIgGzkptNi//nQLP3YNoRSnkotUaDeGNd2J9PQi3QIJgOI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.0.tgz_1505828955518_0.5924565140157938"}},"0.1.1":{"name":"@atomist/automation-client","version":"0.1.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.11.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.2.x","npm":"5.3.x"},"gitHead":"901176d17e015c7ac9fa0d4d9ee5d55d97b3af6f","_id":"@atomist/automation-client@0.1.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-muQyOYhtjEH3FvXOrplACsIrMyod9djediynqOZOldwO62cUaZ5sWxqTcmzVDkMH7XWokeaa9yVXezXyIIz8lA==","shasum":"b9965c643862a507dd871ab4606bda9cb843a3f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFV4Zv7eSl7eyE0Ir+VRF0hp1eJ9WCfaLXYCd6+YXjDXAiEAjY0nJHdff0DYe5lZjPlxoHRoRiajdLfRGqQ6wCgFKLI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.1.tgz_1505896448090_0.0823679524473846"}},"0.1.2":{"name":"@atomist/automation-client","version":"0.1.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.11.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"d80559fa25c7c9a7543af9ba0b54dc013d7111d5","_id":"@atomist/automation-client@0.1.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/ZzxyUG1Rw7hwH5p8MWvYC1pXymV5hlnWts67afKDXbxgNTZmpkieMB0S8S9WymXKR0kZBuGsPVpArphTHStMg==","shasum":"cec319fc356fa2a37ed792fd43a7b51c770b24eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxrUp3826SzEH2Ei3fqxVeKqohQTOXNN7kZmO8KK679AiAXnnSFD8eVzbr85UgH1QzPKTSSg+eComhrlOAMU+B+PQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.2.tgz_1505902959941_0.1662053195759654"}},"0.1.3":{"name":"@atomist/automation-client","version":"0.1.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"48556dfd64084d1aaa2a859ea8e0bd14cecaf531","_id":"@atomist/automation-client@0.1.3","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-q/5LRU3nD/CyY4PGu5MaplDfoPgUFGakvSg5eK93+hi6vd7SFe6cguxXHbs5F5Wb6y3oWFXVNQgWrTT6hQ/gbg==","shasum":"cf08cf5ecd0103c4981ce8ae24f50b1ddb570173","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7QEScu0BXNcAed+O3DdLRKTcnYLzeABu+PBYT6zG8eAiBfyWIFHj78sSj7EsM9mBJeGrCYnIwUpVPHlalGf97UoA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.3.tgz_1505935250597_0.01608283631503582"}},"0.1.4":{"name":"@atomist/automation-client","version":"0.1.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"396f8a22cbb077496e9bdf71cf37c2d0e8e22e8d","_id":"@atomist/automation-client@0.1.4","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JHSoAZnbY6ORlA8AsN2O2YJmcD7fsygcYc5ue8yut21CFf1A0KIIwD0LkjF04pKB8BFa2DwQ7yFYdXpzXda7mw==","shasum":"6439d1436ce9deb52a90533a28493e2a342f56ed","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmwNmgXlPoLtz9tdmTBBGc+uDxU/nOoVC9aSLza6+/dAiBasbf7hEuoN7WlmgrRVKlGL+snAf/9fgIlaj+Yu9Dh4g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.4.tgz_1506063606832_0.2181281978264451"}},"0.1.5":{"name":"@atomist/automation-client","version":"0.1.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"1e5a9a2b1767b45a2ea4c430affe065489d42247","_id":"@atomist/automation-client@0.1.5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mbxKuOVwfQ6S0CRkxKoqUVSNUz+8SViLqevXmG/oF2vfKknFqn02ONnk2/kqsNO5XwIVRxSV6VSOOhurQUAfjA==","shasum":"82ee3171efcda05b4e4ce73cc8f050f784932265","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWFAwTEQy9STyWgVMVNh7l1x2cLrAXks0CxKfQdgOBHQIgPUiOIF6Ks5DZ01e0lIFc8xPbhJoBJ/MmA0nI2iPZJdk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.5.tgz_1506064323081_0.8349467620719224"}},"0.1.6":{"name":"@atomist/automation-client","version":"0.1.6","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.1","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"e053216a92454e555ef9e30a821c8b76dd90e22a","_id":"@atomist/automation-client@0.1.6","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7izvYCkE9ltfGTL0C6I5khzdEMFWBRxx2J6iylI0wfO/9vnbHW4TpEyVeADoKo4DX67NJYDZ/+f8/c5x1zLbkw==","shasum":"9a8ba2850281a6fab43d611c732a24f3c702242f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH2JbHvQa6qv7Bxi6QMLdatkGZgaqWfOSg7laHjJgvxJAiA5H7gQTqlOcj1351/4+NGF/Kg/cJX56tSXhFMd1eRoug=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.6.tgz_1506240041208_0.0583339452277869"}},"0.1.7":{"name":"@atomist/automation-client","version":"0.1.7","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"bcc83122f34a2bba9cb1850cb822e44e122ecf38","_id":"@atomist/automation-client@0.1.7","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ctP3zZyHuSmtRixbgJkVkoz98wvCehx4MVwgHF2SGtru0uEoHkWbpPdhk3VSagdE6nJ3/2033Jp8qNvVOSDQWg==","shasum":"91670d8b4d308c23ebf8abf7150b163471bfb565","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCd7cjDQx0J6BQi6cEsbaL2RLBYOMEKH8j3JxN+VRJSHQIgTqA52VHQacSiWmVQTJPUDuRNrUrSSdahz+lLI7LQmsM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.7.tgz_1506330932366_0.3393897844944149"}},"0.1.8":{"name":"@atomist/automation-client","version":"0.1.8","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"d7f623baeeb7cfb09f30d8b367dbaa8dbf54e5f1","_id":"@atomist/automation-client@0.1.8","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vgdOeZRi1GGoVl/DAl3+BVtDQ5tm4CVQIrsaVBSaVHdNY0lO4TTSG8X0qRuaIgQXf2JlfU1861ZSc1+q0sBTGA==","shasum":"4d2af059839ebcc2852e468079e566c520009072","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQxsTfWH/UX9lkG+bbZxRwNhL3kABfhzwp2Hq4JDiEhAIgdMOff5ERIvlm9P66c43li3kiHiF6iRVes++pan3sg/M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.8.tgz_1506333878626_0.7796113567892462"}},"0.1.9":{"name":"@atomist/automation-client","version":"0.1.9","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"5618c9f6a05ab271b4b29071be9b87bd340c4742","_id":"@atomist/automation-client@0.1.9","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AGg2aTrAWwbp04FHCPZKjdqc/Opdyk9WJoeXDVihS9VwyjRgvEj1CR+dH2vZ0UgNb/00ozb4O7PB2VbMw25CVw==","shasum":"0f4746efe2629911d3946b08d014854233595462","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4IUFu+mK1X+KFQ2C08NwqTaWxO089wPNze/ItR5vbFAiAKdKCfRK0YOJwBWFcrLmxRWAYcIELB9gHtfF/sloft0g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.9.tgz_1506338353498_0.7888487649615854"}},"0.1.10":{"name":"@atomist/automation-client","version":"0.1.10","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"21a5d9c85aaea5dd9707ac9a089a88c5e18159b9","_id":"@atomist/automation-client@0.1.10","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ulRMyNGjrNyKhCxrGUnpqloonrk1dhMk7HzIZ+juFTC3ZIFDZol/DTpAZMxWaiaNq3zrMwYaKGin05mzxaRukg==","shasum":"4c3b0b884ade6fdf8612a9a57caa20ffdbe21c00","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL5GeEw4Ti2XkD0QIrdWKQuvNIhKGn4PCKiljxX+UcywIhAJ8LEC75kbJtA2edZScV+Fo514xTLBsp/D+1CdQsRtfc"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.10.tgz_1506341614283_0.05937668168917298"}},"0.1.11":{"name":"@atomist/automation-client","version":"0.1.11","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","shutdown-hook":"^1.1.1","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"92bcc860b64db7caad11fe7ba4708b8f31a71da2","_id":"@atomist/automation-client@0.1.11","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-aW4kSiJDff1EEdf2zM0kItib0if1qWQvq3S+brct16V0o1QOdLMQEBbTS3RqzEAd8pvSVM+w0QWMj4zRkSv5hA==","shasum":"60e36cc7fedf80d95a57c3d424bcf262f29453d3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.11.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFaup8kjKDgklYS4mTvQwJxraEGdnNqd/3Ep9XgEbsp2AiEAoa5pGA89cXQmNHALqGo8DCT5vsWI6Ih8qx8iAaJVcs4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.11.tgz_1506349422516_0.34774422692134976"}},"0.1.12":{"name":"@atomist/automation-client","version":"0.1.12","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"815a008dd2c0fc0395cbcd4662c0990ce6c540cb","_id":"@atomist/automation-client@0.1.12","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-M8fE5f46Yo9yIWQt+A76aK9JgXmfMdkQJpW7+Xry+FpYU1PuSkBn5kQOGbAP83fw6BmzwjzbHXX5KJ1+HdQ6AQ==","shasum":"768b9c71ef57a1f7b4941bf8e54452132f06c594","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.12.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9LKpjrRlfAi8dpGxeFbDWxWoH8CdLcZzKYO2PMa/vBAiALk+XfIA3JXWTS3fo2+SLVQ4TcGbOC+egsX6xSUa5wCg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.12.tgz_1506354194332_0.5353945223614573"}},"0.1.13":{"name":"@atomist/automation-client","version":"0.1.13","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"b3be1191e9baf018cb45dbbb175e05224f136144","_id":"@atomist/automation-client@0.1.13","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/CWMf/melK6yRwsJvpoxy+yVGeUX2gxAB/7ecXiZbZEvlQWzIqh8CN0tSl9aQnc1HHk6ChCdSqiUVRLKrtjKmA==","shasum":"46b6126554c1c08be05ef6ef76709e9d4907e185","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.13.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQColL8VdHm5HnTZCaJXWwR995LRuR2wN9hmzGvh/897vgIhANG2WvDK9mph4gqsJuKBRDPE4ZyF94J69mwEanoWEJOP"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.13.tgz_1506412545903_0.5113807518500835"}},"0.1.14":{"name":"@atomist/automation-client","version":"0.1.14","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"0f3a22646be8b74723f9a92aa0d3a3db5ad1bf98","_id":"@atomist/automation-client@0.1.14","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ryr4vctoYBLzKquOoRuPwZ7Qk5tXz5uf6eNhr2OmjouOIpnRmO9Gb+gFHh/Gv6T3fLKaI5sRInKZtniXUeyhUQ==","shasum":"285f580932c70eb767248f627dce7d00ffc7e96d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.14.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3nCQEit4p6qcRVe97oYERyYcPy0/6/BlYUAw5NyQFgAiEAnoipUd3YJ77hM7RLV2xDQMW+cl/DUbZ8E3gdkK+L7mE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.14.tgz_1506415098607_0.5665730545297265"}},"0.1.15":{"name":"@atomist/automation-client","version":"0.1.15","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"18b64b0eb3346aeb951d629b178ea89d14492d48","_id":"@atomist/automation-client@0.1.15","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CXh1i64I0runXwNARCPIYzhwMZXJJDKpkGKajUzCLRC9s25WWbMrd2l4fuL0+1BzKMXhW/WT0D50V8Qql5DZXw==","shasum":"987174dc168c49bff6a7a2eb90b1979dc5583ce2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.15.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1i/8jDUph+qc5DB1YeidoiRq9gCSj8MqnJURKP8JmigIgAVjAR8rn1DznrwVnwtFKdRpOSRsWnQGl9XYMusGl7gI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.15.tgz_1506415291324_0.06270998157560825"}},"0.1.16":{"name":"@atomist/automation-client","version":"0.1.16","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"e310492c04798f3fd06c7798a426c1565ac1e682","_id":"@atomist/automation-client@0.1.16","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6tIWJi1d9WRTXwc5gmW54u3N/9xZ3B9AORw4XyrPoLhI+s3t5KphutN6HInnT/bOejwnELco+BweGTn55liPyQ==","shasum":"112355e1fbd3690f25eb5a8d0ed49e750ba3fe85","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVB7PUL9rF8ZBpPI316loX+8ksFQpsBJalNISlkJ6OigIgK8yopo2jERoPxcXxqCxM1oPcD6709+vCWZUkr/eWyls="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.16.tgz_1506415565461_0.26572744851000607"}},"0.1.17":{"name":"@atomist/automation-client","version":"0.1.17","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"91c2aeab961d6f2fadde5c91a8de083bc79cf5e1","_id":"@atomist/automation-client@0.1.17","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Hph+H61dB4VyFiwimjo7vuWrUFi/bJuUb7dGl1XSjJbRhNSGKAZIlMgdpHX9j0ur89cCK1if4W+mHbzQ3wWZ1g==","shasum":"d4d4590a30880120fa13bf91993c90166979f4be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.17.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMVHzYh7AtGMrl/9T/NDTAMpwv4zqEbuqd96FHsfv1FAIhAL+ILEjXIILEKdfLRLUAJM29zL/nunZSj+gHm+Kaa381"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.17.tgz_1506495302180_0.07968896790407598"}},"0.1.18":{"name":"@atomist/automation-client","version":"0.1.18","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.26","@types/winston":"^2.3.5","apollo-client":"^1.9.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.1","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.4","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.5","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^8.0.2"},"devDependencies":{"@types/async":"2.0.31","@types/config":"0.0.32","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.2","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"1e5a218c38006b816f6e8e341848e28325065ac0","_id":"@atomist/automation-client@0.1.18","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ggdrtKODfHU3ZMdrpcUH3bseU34GAUH8fNAvsJ1cc89tSTLBm3+IuoM8q6KACnoi9XXG+U9pQSkFb9InOwMw/A==","shasum":"17229cd9af907da6b60a92e0d9d05ede5e7157a6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.18.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFgRDVBUAFXSdK+kbx3/2lMf/rD+ocMIPbe9V9n5OvAzAiAEtaNS9OwC+TSrCHTpV6MH7M6D3r9XHQOGD+uBQNvEYg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.18.tgz_1506499581098_0.9271380873396993"}},"0.1.19":{"name":"@atomist/automation-client","version":"0.1.19","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"65d9ebcada6b650a8325b416c96bf4eb384dbb1a","_id":"@atomist/automation-client@0.1.19","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ooYCSyGmUJaVmP1O9N+KWXxHTcgPCTNoMmGEg9thTFaSuZlQjctG4Sg7GH0cm39o92wjzt69BSdm/OZjvIKsSQ==","shasum":"740af829933fb82ab0aa8104e8a8e33c685de889","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.19.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGINQdHQTLE2tKXZlI/RNsGATZ6LZ2tXMMI9ZcseOXfUAiBf9FBwBlvz5skNOGub8MrI7AnJeaEhCRM0Lpqefb3Njw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.19.tgz_1506548579027_0.6281192479655147"}},"0.1.20":{"name":"@atomist/automation-client","version":"0.1.20","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"0cf9f82046f9caec03d6e39f2c762be03880bc90","_id":"@atomist/automation-client@0.1.20","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-h2nygyhhOCzxYhs8wL0a7DRac6jjSyNiyGMtVVeBC+6DdC4Gn001gCmNEyZujsmHQtxcu0/PocKJ0db0f03hUQ==","shasum":"87a6613ebe430514ea4c0c060de179489381ed68","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.20.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDR3cEFzK8D9y4Dmgovxs0Av0QCBhxbhhVY7rgSvOzVwAiBrn8r8xWEtZ6rBy/qvQKXbU+x50rtd2ZUatEPtaveg4A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.20.tgz_1506574341413_0.9481604991015047"}},"0.1.21":{"name":"@atomist/automation-client","version":"0.1.21","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"357a097b1a14dc9c5cf7e6b38055fab28cc30eb6","_id":"@atomist/automation-client@0.1.21","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Yn+ExxaBLeVCqt89hc5iEfpmei+jWpgQgdExrBliRSe/DA+vI3P5ioC9zvWFuUgCA/uT8VFnuxVEkmixBsuwDw==","shasum":"fc3ed8c8f47ecb2759169331f63ecbc292d4da83","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.21.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+ObzYzkuYl3mISGxK1uaITJA42GZtpcnV57q5u5lvfgIhAMmyj0N4A8+j7pLuuu2GBYISdZG9IpM03Mm2byxygxVQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.21.tgz_1506589840416_0.0835041634272784"}},"0.1.22":{"name":"@atomist/automation-client","version":"0.1.22","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"c8affdd2021c40c5d50fe8e159c170f649a8d77c","_id":"@atomist/automation-client@0.1.22","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cYnKgfZmn8PImALviZHcirRU13HzxFBnwfoigCq3XjtVe1vwXviE2N2O8CpC7eNJKmIYFm++EdZzj2P3NEZ2mg==","shasum":"4f8de95f421abafa5fcb06a97fcdbcb59c302596","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.22.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5Sq+7hC1VNbNwocCAePHQAz0w+QIHLHhKDRKCeGpDPAiAbClIDEtCGj0t57uBYVWZQQpjtIvgHWSTnNEq/1uw5Dg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.22.tgz_1506592743029_0.607202127808705"}},"0.1.23":{"name":"@atomist/automation-client","version":"0.1.23","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"008cb5e3ed6c6229f1a19940362f3ffab944018c","_id":"@atomist/automation-client@0.1.23","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gGYtyj0jzmkYhbosnLXwGr2/3nlyf7BjAwAD1RF/YfpIQ7GrrFo3LOB97HAbjkdvOBtqvaUhOrczPkq/b3bnxw==","shasum":"22d5ef54c36376c0d2400c261e57ef15f364d930","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.23.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICz0JMl7qqViJ5zuIx6GqxBSM8CWNfURQS+JPfvU9NEYAiAKjI71Y8Ly9MwKKHlN7THmeqwuW5mepsGqgnagjydqPA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.23.tgz_1506602926143_0.18714721035212278"}},"0.1.24":{"name":"@atomist/automation-client","version":"0.1.24","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"e74233a656acd8bd40170257baaefb21a7d4f5fb","_id":"@atomist/automation-client@0.1.24","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-A52sZJ1JfZTrHH+wuPLWKD7J+jIEAZOBdGTX9HdaN/0ZioDUdPqlEicjGzHJnowsS4j+Q5FiF57Zl6PqDPzucQ==","shasum":"07411f83404b29ce5452d5330a0c0555fe8cf317","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.24.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDgNosWXoG/Erq/FwmqJuzxBTbLxTJmEINppHHTXYGvJAiB5jHH1H6p+HugUaxZ8+NuvpgbsjuJdbvjoNbIN/8S4GA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.24.tgz_1506611802194_0.40867372904904187"}},"0.1.25":{"name":"@atomist/automation-client","version":"0.1.25","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"bcd74572b61baaa1f7ef06a0d9451be9913821bf","_id":"@atomist/automation-client@0.1.25","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EyeC8Iqw4/lvaicIcDa81l0f6yMQHu4h4H3SoqEILRIHPc2uUZ1J7XWmxBHwxkLR5OtDyZeLERfNGSaq3nMMEg==","shasum":"402be83d285f773421f20c4d30ee5686839c5d94","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.25.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyw7lbBDxSvI+N35PYc/utr7gZ7Wsl4aFCpBkmq3RsYAiEApAmVtF2iWBMdqIseXlSwRsb+dDM1G9zNuK0BhQYT2Vg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.25.tgz_1506623667211_0.9735211580991745"}},"0.1.26":{"name":"@atomist/automation-client","version":"0.1.26","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"760d5fb77241799a512cdcdf797324044099504d","_id":"@atomist/automation-client@0.1.26","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sdhlbhhrMe0043QL9to1XzxXTd699tZ7N46usmqlTJv1jVoiJG9It8fKFJnkyrkNpTsWGkC52y+FvuKBfEraIg==","shasum":"bca992a0c2d1169f7c5123379c8a6cdde1bcd398","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.26.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHG0FFaEva7bRa/oGvdr4YtSIO5Z3bUj7Pq9Ef1xHg55AiEA/O6JZJQVHhCnFgqsRTDFuW8VtzW9bcKiLiWFSdB9bIQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.26.tgz_1506625542007_0.6463314034044743"}},"0.1.27":{"name":"@atomist/automation-client","version":"0.1.27","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","chalk":"^2.1.0","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/chalk":"^0.4.31","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"993fc1e5f5a60f23db0538ec24162b8b55566224","_id":"@atomist/automation-client@0.1.27","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rWLU7ZRw4dIz3iTFpestqy/tDIZ1WLttcMST1qV4DShV+f5HSFJvc0N8nctydwh9xCugLTjHZPMXeHssz0ZqDA==","shasum":"18ac433abd9a84c281177fefe2b669b4d2cf3769","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.27.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6DjiwCNyEDZJ3jQRXqYdiCwH8vF/ehMpInd4hTyTorwIhAOt6SIAyS7PAVkbliKWNvIddd6psVwD7Bml6J7wvLkvX"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.27.tgz_1506627933970_0.39769321749918163"}},"0.1.28":{"name":"@atomist/automation-client","version":"0.1.28","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","chalk":"^2.1.0","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/chalk":"^0.4.31","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"168c05c9ee9f1aeff9d06921f82f10c997f2d9bb","_id":"@atomist/automation-client@0.1.28","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6c5TiX73rBpcRD8ppJLT0bNKJq/TURMCwpU91O9a7RMqwdZFyjBDF/Ijff1GTZ7N59HO02Ir6MIYoo0E/35lFQ==","shasum":"08abf13e1f3cf0170021f56190f1bfe8077cc74f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.28.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvX7f9CcM2U0XEnf65FqmptylJxcUxgoYDHF9Pqx7MjQIhANmfvoQZBvbCItOZHYMnnS9HzUfCJlT7vltkLOs5M/OM"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.28.tgz_1506629376700_0.9147076508961618"}},"0.1.29":{"name":"@atomist/automation-client","version":"0.1.29","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"ef65f821c96edd1f11fbb76205b883de06f93065","_id":"@atomist/automation-client@0.1.29","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LwT5CgEu9XWeaDD2OsZgHcnVm8J7kInWayJO7+TNb4vb+A2MvnavclSOKnQv+hFtqapsVKbXZZwXLnEE2xzrDA==","shasum":"66887b7aeeca5bde7c5c23a73d105ab6a28a95b6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.29.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkyWfPgxG995c+c5Bw48OAtB/DLua14qtvOHKi//AZkAiAJtyI/g8Vc1ewy5fVxgx+bt8IOp+Mkf95VhSxwkBgy1Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.29.tgz_1506631720779_0.20785800414159894"}},"0.1.30":{"name":"@atomist/automation-client","version":"0.1.30","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"b9097be486c9822da1e975a2752102de39ae4cd4","_id":"@atomist/automation-client@0.1.30","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jV/xkxotJTioNSW6cEkFdAmm3CJDZB04aMkN/wAO5uyK3uX8kjhewWXjrwtfSs+HKw5Zt0CS2F9pPMrHArX/sg==","shasum":"cd3b6390c124a741eaf928cf7c53c6ae447f4738","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.30.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVRHPQmejrk+xpWCnurti00JItcUlo5qzfkquSrGvMOAiBJOZaP4QKOiBlMKKDnL8QdQ1kaT1HL7V84uTrFGsFvYA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.30.tgz_1506676232589_0.32108459901064634"}},"0.1.31":{"name":"@atomist/automation-client","version":"0.1.31","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"f1c2e9c5a50f31b41c5dcb05d7244e94d78b68e5","_id":"@atomist/automation-client@0.1.31","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-h+VPsvpnaaDQ2/lxKvyKMoobcI+A/PWNvVoZN8RaZId1UiGa4h0kqoAiwDUnTe97c28PeOMYfb0Sc/52+eAEjQ==","shasum":"b93b3fdecffde129394e3e0847ca4872af9e1da3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.31.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDX5nsq90C79d/SaFusm1RT9u8C1+kX2sGx37L3bs9hpAiEA8U29+Cn55AOuWF6AAlxXv6O8KDIXqF/9YyU5oYehb9I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.31.tgz_1506723450889_0.9586258116178215"}},"0.1.32":{"name":"@atomist/automation-client","version":"0.1.32","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"be9048318bcebd11810c84b24807e3df82d2b982","_id":"@atomist/automation-client@0.1.32","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UcFgOSTntRHq8Nk70HgPOZ8jGNfI+8GBtLdoCNPV6j1ZMjXzys8IyidgQJi85ZpEIo0qPAnVpM1MXmOFolpyrg==","shasum":"e4d3c547023ed414276ae800a4221c8ed8968823","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.32.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+oq1CYJ++aFq0l6Z0SqLTAptaiyOukMaS/J1QjdUNZAiEA8dGhsoUHvXEPbycmZyBUgBxhECvAEa4Wmtnz+dERxFY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.32.tgz_1506760250512_0.007473456906154752"}},"0.1.33":{"name":"@atomist/automation-client","version":"0.1.33","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"d1407d7dda8d29262bbb1010223b2d9ab25148c9","_id":"@atomist/automation-client@0.1.33","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-acoUetClSc+2Gn3F/784BJgILg0ZZbuPzqcKvWFQXgOQv09LvowznhJivL4IWz4pdxpjMxG++YgPDsceS8gJLA==","shasum":"76133eea21cb779cb81103659e0fad735fcf214d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.33.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP4yiAWcS6ekEIGd4ZxeHGDJ6DfvgDzpH8E1jsG4ZsSAIhAJiWksHAfKAKH/aMNpmNahKxRsCjj/DeG1/UGdrSjJfl"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.33.tgz_1506773219026_0.677973315352574"}},"0.1.34":{"name":"@atomist/automation-client","version":"0.1.34","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"4e11fe21602811790d9ecac80f4e12c11c1adc82","_id":"@atomist/automation-client@0.1.34","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OrqG0rf82vCpk8P/yZmxv6weWbvcIBedZamktLuuY1Adr/+ArDoya4gTBqwOpaxXZHUd32puHRd2VHmRbwJJMQ==","shasum":"8868e80115ae4007b1db487255ed178d3434d560","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.34.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMknh2fZuqfccj6pcK8RhEW6EKV3jSjmoB+nLevk5seAiEAt9WczO+TxLOaimI8laqNsbW4p0g1cj6NmdXznsI3ZeM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.34.tgz_1506810764753_0.02272527990862727"}},"0.1.35":{"name":"@atomist/automation-client","version":"0.1.35","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.15.5","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"3113422239d8d018fca93b21c0df59abb5417231","_id":"@atomist/automation-client@0.1.35","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JpRbMfS8HVfq6HF3d1A7A0AAesFIsBlZk5mwWvLwaLRzahbPCQbq2xoyXYa7ECnNeNP5+FBgFOUqx3MzR6i8yA==","shasum":"958afdc8a7feb11945595a1c5e25bc096a6dc626","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.35.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD27Kv4IvjZO/UNY5saZu7xRMMou1CXMoLrZjckNNEU2wIgVxu7QgoWEMVg2Klrn/ZumsziD6INjvVpEZWfYwNqUSs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.35.tgz_1506812864893_0.7257767459377646"}},"0.1.36":{"name":"@atomist/automation-client","version":"0.1.36","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"b1a1b855f26a67f6a7f7d9d7ea90a3bfbf74e72d","_id":"@atomist/automation-client@0.1.36","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mD7nczrL47LNh4Y5qPpGvN082dvewI73GjYucZsj/papwlLaTtBhybYYPvIn103y3W5hS6GSywHZwt6pph5m3w==","shasum":"45d3cd38b1b1617c48e9659c5dc7fe911fb1c975","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.36.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIGX11NboyWpX9P0+5tK/zjeZoeuZ0laV7tNsBjJJa87gAh9TlG4jAtYnElMznuqeauJPqQNKR45xdHc3l/jdaY4r"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.36.tgz_1506817077242_0.8415649950038642"}},"0.1.37":{"name":"@atomist/automation-client","version":"0.1.37","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation","rug"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.6.2","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"6805e55849e28bd4ca8f40d9a01f8f70eb90540a","_id":"@atomist/automation-client@0.1.37","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xt67VPTSbcVqoXToEkAeGOoTsuB+vr9cK3NuUa/az27W9OxIczaFwkNw0VgDwjNP9fpIsdygUQwv2BjtFE3GIA==","shasum":"9dd1ccfe32aada897969cedf1f7cb11402e18dba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.37.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAack5uQIyYQBOziYjpGnwyo4OYEZz9JVq+CxSQLWA2fAiBGyVXGK1wXd0EmF4aVMa0NiV5kOshI3J09tKPaNEQWpw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.37.tgz_1506941595500_0.06295814900659025"}},"0.1.38":{"name":"@atomist/automation-client","version":"0.1.38","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"5962ab1f5162858a366f71ad4e192ab919afeb76","_id":"@atomist/automation-client@0.1.38","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nKh1kYNiX/uQwj0j1HYoZzC6hTYqvVuT2Ld9PRac8H/I23FyufsxCIdyvHVJEqdO3JSApsfh/Luqy6qnIO748Q==","shasum":"e442aa1eed910fa38fca3e5397ccaec639631890","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.38.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6N/zefTXaKDXWs8txUP1Ca6qdf+ELpRMz7mQYTtGrVAIgdj1yS7AQQQuYzXCGW7QOvtyzG92BlraYHc6uY+8aWHY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.38.tgz_1507188547825_0.6734192525036633"}},"0.1.39":{"name":"@atomist/automation-client","version":"0.1.39","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","@types/ws":"^3.0.2","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"8ef30dc0dceb332b2207bb058a936ea6ae9c044c","_id":"@atomist/automation-client@0.1.39","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lm8I2hqQXujDYPDJbe2hO6xF8UQz/bkNRsf2ZcgTuwb+Sq7mqHw8algHo8uVn3J3uJR4CxCtVmn8n4pead9OZA==","shasum":"cc1fd273d7cb993bd738a9da937558a986e91ffb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.39.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoVWXjmzPnYPj6gpfQ2uDFzNQpyD5xmKzHJ64gJ9BrgAiEAivkc/6guEj6dOoSboGnvbK4uk9afNWGHtMKRIaW1iIg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.39.tgz_1507370526855_0.6622950697783381"}},"0.1.40":{"name":"@atomist/automation-client","version":"0.1.40","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/ws":"^3.0.2","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"a2e659d0bf9f25faba8ad8c8e819e8c4ba77ca91","_id":"@atomist/automation-client@0.1.40","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tjFiUqhdN2Pb59hii9jSE8vElC6wmbFC4Z1gO5imZI9RngYQsAobcIzbYlR+S/ko+8XAkyqT1f9aAcMQoYzyuA==","shasum":"3f50b4a6c77e1eb79e762f3923a72d5c4054ada6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.40.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfVZn1vP9rVjP2ir/QhBnTc6J8kWdxPsfZUluzCHfwkAiArblBsZ94dKY2zKMEV/bcDZVm66lQvLyVQr2iglVaUug=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.40.tgz_1507459697015_0.2969896160066128"}},"0.1.41":{"name":"@atomist/automation-client","version":"0.1.41","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@types/node":"^8.0.31","@types/ws":"^3.0.2","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"ba1117bd242171ddd971a4307ed2e548b3d68727","_id":"@atomist/automation-client@0.1.41","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sINXpykGFWuVzYFnWjm6I+kdxTwYlVCxS9j7uRdoTjLfE52IWneCS0c745IA9XQlRBY6eSFUFivyPstEk6x5oQ==","shasum":"c7be5820090a10afbabea62650e3496bfab224c5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.41.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDHthSBSbzvuQWduzm5m0asmq2jWcum1qSH3H3QKfiPAiEA7tOA6TUZM7C1EOC+JABIdieJW7Q0Q2+2JuiDku9pelw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.41.tgz_1507681530370_0.45440590544603765"}},"0.1.43":{"name":"@atomist/automation-client","version":"0.1.43","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.1","@types/node":"^8.0.31","@types/ws":"^3.0.2","@types/winston":"^2.3.6","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","continuation-local-storage":"^3.2.0","express":"^4.16.1","file-system":"^2.2.2","fs-extra":"^4.0.2","glob":"^7.1.2","glob-stream":"^6.1.0","graphql":"^0.10.0","html5-websocket":"^2.0.1","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lru_map":"^0.3.3","metrics":"^0.1.14","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","promise-retry":"^1.1.1","properties":"^1.2.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","streaming":"^1.0.3","tmp":"0.0.33","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/async":"2.0.43","@types/config":"0.0.33","@types/fs-extra":"^4.0.2","@types/git":"0.0.18","@types/glob":"^5.0.32","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/mocha":"^2.2.41","@types/passport":"^0.3.4","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.2","mocha":"^3.5.3","power-assert":"^1.4.4","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.8.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -e ts -x npm -- run test","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/!(*atomist.config).ts'","testone":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","autoclient":"nodemon --inspect -e js build/src/start.client.js","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"96c72ed5096be1ed0f5f242109874420e1ad2afb","_id":"@atomist/automation-client@0.1.43","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Z5Htwogpgr5wr/kpL71MC/09vJ4x2lIeZuPEQ0De5Pvbfm2veKsoPixQGMAcdyQ1s0ko2paTaHC7MuPjNg0WTA==","shasum":"ec4e63ee8e21c11edc812773e7fb51880ef34295","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.43.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGN3thmcyNlKuCOPN6EThfIf+Uk0PpJgeEk4pp9cBp5GAiBeffjQCbYB4MAnXqCmKW7rL0Kjjb9euvqr09pPMZ8njQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.43.tgz_1507764202682_0.6735340238083154"}},"0.1.44":{"name":"@atomist/automation-client","version":"0.1.44","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.1","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/ws":"^3.0.2","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"eae158f314212841367bf4fe641467473a004dd8","_id":"@atomist/automation-client@0.1.44","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DkPVqG5VNSElMaTTax9g0+Ytpt1R9Jo0ZOBHFxDiZ8rszG/uPLTi5jSIvvwAyuHOB+Zgq84LdcjwVk0ovETKjw==","shasum":"9c079e9e22e028514c61fd285d4c162844752f1e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.44.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeTqytOUTJUIDRoMCgrTaKGzIb7zh9C6MQdypSx6MskAIgbRNAERyAcmJi9xFYarWK5xcGffOpdIbjlWsO+ylm+a8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.44.tgz_1508195509358_0.45610690559260547"}},"0.1.46":{"name":"@atomist/automation-client","version":"0.1.46","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"3239cd34799dde7e30997be222bbc83d212cb341","_id":"@atomist/automation-client@0.1.46","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZrYWm50VyMPhNHjm3b1HXkMISBd5ad8wMUFO24N62Wa2RLw2zc/3A1RlOeND527xkbsEYURVNIK0ichdegxGrg==","shasum":"335dddb1479a4f10d30d0e21dbec0effa7e83a71","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.46.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGtGDoL/b4zYuv3tuIuEbVVq5EqbTbT6EWhcMEGy8DNCAiBqGy4Y4J6DduKSt26vzzAc+DdopnKfautmQLpsBbo5JA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.46.tgz_1508352924009_0.6237853416241705"}},"0.1.47":{"name":"@atomist/automation-client","version":"0.1.47","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"2abe2acbbbd2b117af388aba8a156a5c27ab4b45","_id":"@atomist/automation-client@0.1.47","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-W2cV4YE0RZg3+aJzfoblI0uuYdpYaLfEMtVzJThJbviaheXt+HBqFmTR1ydDSYYgpB1BftAy0LLGipu6Ce/2kA==","shasum":"35b3b95d15a4f7c477d4ec5674b4da112a5025bb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.47.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcVjm6o+7CyaYvldP3+eS/5EjXXMws9JvCiTpVXFCNsAIhALRcSQrjTox/ujzDpKg7k/CfVh3tDSljtpPm4tzsD25I"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.47.tgz_1508357235400_0.4302485066000372"}},"0.1.48":{"name":"@atomist/automation-client","version":"0.1.48","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"82560b9488d6d1172606cd96fdcce4b235a01edc","_id":"@atomist/automation-client@0.1.48","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VofomOjrOLAZbgsExlEnLNGOZCpBquwmayxj+PLCQoDRGemCf4agSZA2qH7qDkEKN015tipcz5/LZfZ/4uEeLQ==","shasum":"9a6e94da97cbba7dfc10e64503ed5d428ba96f73","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.48.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEgU1eBAUQdUUj5pKU8y/q3yoWb+/jOwtDqEgTpuBIoQIgaEs9cl8qP5bk5gOUYb73vhjlKSfis3zJu1y1rXPmaps="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.48.tgz_1508361644304_0.6088349474593997"}},"0.1.49":{"name":"@atomist/automation-client","version":"0.1.49","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"ccdecec0a5528294e9006ee152eb6883b9c95ad8","_id":"@atomist/automation-client@0.1.49","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6h8hRShVrh6k+D3PEGTMcvOnMOdYIMNedFzlgBfB+vu4wFvoQhcLyBYY+C3CECf932ePbOL1BhY3eFdcQuhesw==","shasum":"1f0f0f8a0c440c0f452545f9c10325f3d8f404cc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.49.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFu8Naf3FgeufA68cHukGb/B1j5XAbPhek9IJkZCG2CyAiAqIlTWYYsXXIViIxazPXuaaEaFMvQaqRyGzBEATG0pTg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.49.tgz_1508365755536_0.7573933978565037"}},"0.1.50":{"name":"@atomist/automation-client","version":"0.1.50","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"8d8bb8fca964da09fcf93487e15c0dd2a3847f4d","_id":"@atomist/automation-client@0.1.50","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oZ10atxF4br6Q7DLXrCfrboSfR0PTWGQUjk6+84tNQrygAsbaS+clQw1MJ0gQR7d3e83f9DIEUIwRr9vBDkI3g==","shasum":"be122e9ee8e33e7c037e4e12a607eeb386e364f2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.1.50.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJRpYQZUzJBVnmmAh2f0KGnBAF4muToUR0873e34QloQIgMD0lb8NVO/G0Szm1+thCSBx07Oax2mHsAloI0bmToPA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.1.50.tgz_1508448301314_0.5779457327444106"}},"0.2.0":{"name":"@atomist/automation-client","version":"0.2.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"00d7dec0e85fece3df98dc880386e72022799518","_id":"@atomist/automation-client@0.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VldE3WWphJXnQoQNWrKc89QNWPFx8vVXO/RocKYs0kEYlXE7UqXCUXhsBIGG3n24tuxCb6xQtLq0fdJlp817UQ==","shasum":"139b781223414fdb4c6ce3e400ebed96548d3530","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6tDmh657TdRaIRUDkAOaj/FyBn2J7EPxR9jIIbf3hHQIhAOopjiaSF24cR/hLkK8YyQikNtffcG7Xr4tBohoNz0LU"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.0.tgz_1508463091474_0.35124935302883387"}},"0.2.1":{"name":"@atomist/automation-client","version":"0.2.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"79f4102b9f69b71fb40895d8f7fc73e89a537e61","_id":"@atomist/automation-client@0.2.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5j5I3j7JNp+wlSFrVDgD/zqwNjtdnXMYR0vcmySWAm/VrD4aXkMBxJdByFgkORHeo2+uHQrE/1E5fKYrSzSgzg==","shasum":"c7145a8e65a346dd0b29e8f410ed6aa23e856354","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwMLV5syj0hlYrApAt0OEcEpmSri0iRP2qU6CmjToF1AiAHSoRbVxi3qVg98LCgaju3IQMiUmKH6OA+ZxV4Z1wkeg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.1.tgz_1508793819788_0.6941417802590877"}},"0.2.2":{"name":"@atomist/automation-client","version":"0.2.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"065ca11d65a9e306cbaf0dea84d02fb41a20c218","_id":"@atomist/automation-client@0.2.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OeqEhFe/OXSl4L+XpNaGa9+8rMlJgy1onEIyrFYmPAhYZmpMsEGFKKo2ckql1yxpQRgsj2dnOrRqdJCE9cLrxg==","shasum":"fbce0906a242c6a0d340e4bf952efcfe18cc3f03","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOT1XG5fH8+FDEvP7N8RlNr1QISqLITsSnF5JkwOps3AiBRh6uOsoPaSQ/Js8Pk/FwycAqQKOxt5pgz+fNwB5CjCg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.2.tgz_1508881598903_0.6896924786269665"}},"0.2.3":{"name":"@atomist/automation-client","version":"0.2.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","apollo-client":"^1.9.3","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.16.2","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^11.0.0","glob-stream":"^6.1.0","graphql":"^0.10.0","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^9.0.1"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.34","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autoclient":"nodemon --inspect -e js build/src/start.client.js","autotest":"supervisor -q -n exit -e ts -x npm -- run test","benchmark":"mocha --prof --compilers ts:espower-typescript/guess \"test/**/*Benchmark.ts\"; node --prof-process isolate-* > profile.txt","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf *-v8.log profile.txt build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","cli":"npm run compile && node $NODE_DEBUG_OPTION build/src/start.cli.js","client":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/start.client.js --open=true","compile":"tsc -p . && cp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","distclean":"npm run clean ; rm -rf node_modules","fmt":"tsfmt --replace","git:info":"npm run compile && node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess 'test/**/!(*atomist.config).ts' --exit","testone":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\" --exit","typedoc":"typedoc --mode modules --excludeExternals"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.5.x","npm":"5.3.x"},"gitHead":"48acf06e274a0b72dc3b860dd29e74419f0acf50","_id":"@atomist/automation-client@0.2.3","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rGNIxQmyaKmg733ewnmoSP6QjylAMMcOHWKafB1LubZ7crmQFopfNr3r12+VZK7GzTOVK+AML+cY5+H+mcCzHA==","shasum":"2d375e64329d13969d2a3a9c75c44747aa2b77cf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPHISKyPNmjK8/a8B3ZPjBqq+uLiSOqBaw9tsamrkrZAiEAtvLZ4zalT4xYVPC+958GlE/fRiqbkA/gljVp6pvMRuM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.3.tgz_1508896195509_0.03791895625181496"}},"0.2.4":{"name":"@atomist/automation-client","version":"0.2.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.0.0","apollo-client":"^2.0.1","apollo-link-http":"^1.0.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.0","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.46","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node --trace-warnings --trace_gc --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --compilers ts:espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"78fd03f3ba9fc14d2690d8120d24303eb49cc2c7","_id":"@atomist/automation-client@0.2.4","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-aSmvqIsCkpP2bPsS8SV7EK7dklYSFSNygopslZVZ1fqjG3amDeCavGKuM7zeZYbAShwrwbSdV0nccOUCRIpscA==","shasum":"e9da7d42594d2e155402799e5fadcc31c3379812","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARybMFhivBXed+nbL9U5MYmGEhRlgwloQ77kmpRuZ+wAiAD92of03WqJhFcXCtN2gUaDsQ0BIsNomlXbQRQMUlDVw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.4.tgz_1509053118813_0.5829566535539925"}},"0.2.5":{"name":"@atomist/automation-client","version":"0.2.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.0.0","apollo-client":"^2.0.1","apollo-link-http":"^1.0.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.0","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.46","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node --trace-warnings --trace_gc --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --compilers ts:espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"9a39c934d25b9b22884db142f515145a6decb841","_id":"@atomist/automation-client@0.2.5","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0X1EJDuHctsOTWnIZc3xBZmltrb+vIBHN+6AO9HZbyYihtwuKvueBwgETflIEe2vVZnp7RJ/kCr4ELHw6HqCpQ==","shasum":"fea8754b13534eebe60b2b7ef8ee4629b44d0296","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDotYrE6+7eKOEljEJGMK5JOxHf+orrsr/lNh+FOGPlGAiAip8T5MJjHQz+GIh9jI9GRVMJ5bRDQSJRHIH/j5VwIEA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.5.tgz_1509055272037_0.2954705848824233"}},"0.2.6":{"name":"@atomist/automation-client","version":"0.2.6","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.0.0","apollo-client":"^2.0.1","apollo-link-http":"^1.0.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.0","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/glob":"^5.0.33","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.46","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node $NODE_DEBUG_OPTION --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node --trace-warnings --trace_gc --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --compilers ts:espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --compilers ts:espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"046b91e53922f9c27a48174a39cd6bb693c311f8","_id":"@atomist/automation-client@0.2.6","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PjSuXZlJZQSprAUfrlghdphwXWOhrg0DFpZ4KCmcIIqTYebj4NCVWrb8BjGy86JzrfXb6Tu11UUEUNCc5bR1kw==","shasum":"4190ae5a25fb3c10d291cd7288dc6193f0df87d6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeDa1x19YAjAg/uMprVOmaB89OTqQdoxBNILnl9cFTAAIhANc06DseQcGkH9ANs7TqV4nkxDIz+GHTtDyWL4sqUtg8"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.6.tgz_1509231247821_0.06970097497105598"}},"0.2.7":{"name":"@atomist/automation-client","version":"0.2.7","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.0.0","apollo-client":"^2.0.1","apollo-link-http":"^1.0.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.0","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/glob":"^5.0.33","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.46","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node  --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"62cde18e3e479b1ccaf795147e329168516c1b9d","_id":"@atomist/automation-client@0.2.7","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gZGJwK+p7p8Yek020H3uIt+uxDjeuLyYt0T3Eql/m6hloiY/WnRPKet46vGocIq1i9QyGVYMguxVg2dEsr7Omw==","shasum":"381dcef479c1a7fb75678aabdd0f01986f7b7bbd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAj3NMPYPSqtwEnwa17Y2krUdVvUcGg8wj/aZ4zuw1+SAiBLXcmy2Zb07ywVsKHYlLew96dULPkSvIDvVXUhklacUw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.7.tgz_1510243301707_0.663781120441854"}},"0.2.8":{"name":"@atomist/automation-client","version":"0.2.8","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.0","@atomist/tree-path":"^0.1.2","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.0.0","apollo-client":"^2.0.1","apollo-link-http":"^1.0.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.0","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.26.2","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^3.3.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.3.0","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.3","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.1.0","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.5","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.3","@types/connect-flash":"0.0.33","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.3","@types/fs-extra":"^4.0.2","@types/glob":"^5.0.33","@types/graphql":"^0.11.5","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.77","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.46","@types/passport":"^0.3.4","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.4","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.0.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node  --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"e449f668d1c50d75bba2c5595b2b59882c87f0c8","_id":"@atomist/automation-client@0.2.8","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1eeowWZQIgFex+dEwBPdbp9Q25cKUSV8e47sr/u7l/cUcTfL3mXVLk7erye8IiTpHw0qM2dVqnZtcpUNRgB3ZQ==","shasum":"1e4eb532f2080d9b0a91e9afdd19a14cf0a9e0d3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.2.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHibhP5gMSttGOv4J3OLowRzvrEEiM6/HlS2/FUhoHKAiBQDoRiLD+JdVEBgqVyIYrOJUu2Z/9HsuE0rsjw4EXCew=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.2.8.tgz_1510260377928_0.8019085726700723"}},"0.3.0":{"name":"@atomist/automation-client","version":"0.3.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.6","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.0","apollo-client":"^2.0.2","apollo-link-http":"^1.1.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^4.0.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.3.1","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.4","@types/glob":"^5.0.33","@types/graphql":"^0.11.6","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.51","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node  --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"2a124697921f9d49b525a4ff7f7bfa673b62b650","_id":"@atomist/automation-client@0.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jbqfmgUCMXB6GkDkvJP3KJKjv/A9681TnqFJqfPLxN4PwkCUVfhfOulS0jQlh+eVi+LcC9KFGKje/xIPVXp9Qw==","shasum":"3714a1e585a792893910e8003640aeaf94724a8e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi0M9hp+GnXVwpCSMdBU4IwPhLEZrO+Qq4PoW7WtPeCgIhAJW5LmjoBtp79K2Bd6zKx6fm5MKkYBS/iK2suNG4mHSp"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.0.tgz_1510628626161_0.8194281291216612"}},"0.3.1":{"name":"@atomist/automation-client","version":"0.3.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.6","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.0","apollo-client":"^2.0.2","apollo-link-http":"^1.1.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^4.0.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.3.1","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.4","@types/glob":"^5.0.33","@types/graphql":"^0.11.6","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.51","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node  --trace-warnings build/src/git.info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"git-info":"./git.info.js","atomist-cli":"./start.cli.js","atomist-client":"./start.client.js","atomist-config":"./atomist.setup.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"136ffac74e4e3fc14c79531929900d476c976b13","_id":"@atomist/automation-client@0.3.1","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gFLhqP2Ai7cAXLCFgdAOc4W7JLa9nWr4upPqnx9HzEVGFsNUdZlIUt9QsnKdWPPW7+ihct0Sx3tV0mklYysSuA==","shasum":"3f1e9591fcd0e082319b3c2941a91e27c4f4818b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7Qx5z9w28AYtR9Xk9D1nTUKPRBZPX1RrAyA6notLVlAiAR/ArUOsw7Caj0KKvTX+Lr3Fy3uRnvOxSk5MOMYDB5KA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.1.tgz_1510629899096_0.36705077276565135"}},"0.3.2":{"name":"@atomist/automation-client","version":"0.3.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.0","apollo-client":"^2.0.2","apollo-link-http":"^1.1.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","helmet":"^3.9.0","inquirer":"^4.0.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.3.1","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.4","@types/glob":"^5.0.33","@types/graphql":"^0.11.6","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.51","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/scripts/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"852e6fd02740c071cec7969c288ce524c99c971f","_id":"@atomist/automation-client@0.3.2","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-YN2Ur7lyGwvapVxJXwQkl9/OB1KwQVRO33Ypk76ke1rqTwyul1TJAjT3N6ArJ4Gzob0+q1l5HK7pk0gnKFPFTg==","shasum":"51ad1e0c7b1fc348645f943f8d82dc2490a52ea4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd0EF/OEuvCq1fFu6fiFot7Czncol+yC1kd2uzAM+qPQIgBk8OTgVSW+TKRLTm5mVxOWyb+dTs8uU4vOuBQbe2How="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.2.tgz_1510719454199_0.9739532331004739"}},"0.3.3":{"name":"@atomist/automation-client","version":"0.3.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/cors":"^2.8.3","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.0","apollo-client":"^2.0.2","apollo-link-http":"^1.1.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.0","cors":"^2.8.4","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.0","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","heapdump":"^0.3.9","helmet":"^3.9.0","inquirer":"^4.0.0","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","winston":"^2.3.1","ws":"^3.3.1","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.4","@types/glob":"^5.0.33","@types/graphql":"^0.11.6","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.51","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:api":"mocha --require espower-typescript/guess --exit 'test-api/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"34112e97e6336f69d62318f73a7f5bbbeff84f14","_id":"@atomist/automation-client@0.3.3","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XZ0LXnuoaOHNVDAxz08CC6PxeE9kfUH4n+0GZtk60utVAHptMLsbaYGV7CquIauQvFoS4XTD8vDaOXbuDczKmA==","shasum":"ef9d18f9a3a2f5a6378d172718a17c78a0d30c70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDryynv9x8weTI4dOOoaCcpubY6jqvW3fP/2JhuzGGGJwIhAP8MbqJGg7xQw6a9eVVCSBIoI5vnuMijmnqLYG1zoxvE"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.3.tgz_1511216540648_0.07568214274942875"}},"0.3.4":{"name":"@atomist/automation-client","version":"0.3.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.6","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.1","apollo-client":"^2.0.3","apollo-link-http":"^1.2.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.3","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","heapdump":"^0.3.9","helmet":"^3.9.0","inquirer":"^4.0.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","uuid":"^3.1.0","winston":"^2.3.1","ws":"^3.3.2","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/continuation-local-storage":"^3.2.1","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.5","@types/glob":"^5.0.33","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.53","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:api":"mocha --require espower-typescript/guess --exit 'test-api/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"bf7829d20f6d9a19f790a13a1584f39e5bc0a920","_id":"@atomist/automation-client@0.3.4","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LRQ9/QqYl1yJI8vhKRVizn6fIBFEPT1eZflgjZv6ievXZB/zaMasGBB/R4EeBU5w8mypDLhidtj2G5s51qKSLA==","shasum":"89bdbec0c4f7e93cbdd665e622b6818f246ae765","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACIFXOmr9RY2gqTbPIuEs8DXP3jn9V8ZB/dDt29EwvTAiEAsFiR14xY5LjWTXdvAFXvM715Jajzs0i8sQ6X+rB4Jz0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.4.tgz_1511360015898_0.5453964855987579"}},"0.3.5":{"name":"@atomist/automation-client","version":"0.3.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.6","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.1","apollo-client":"^2.0.3","apollo-link-http":"^1.2.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","connect-ensure-login":"^0.1.1","connect-flash":"^0.1.1","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-force-ssl":"^0.3.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.3","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","heapdump":"^0.3.9","helmet":"^3.9.0","inquirer":"^4.0.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","memorystore":"^1.5.1","metrics":"^0.1.14","minimatch":"^3.0.4","mustache-express":"^1.2.5","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-github":"^1.1.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","uuid":"^3.1.0","winston":"^2.3.1","ws":"^3.3.2","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/connect-ensure-login":"^0.1.4","@types/connect-flash":"0.0.34","@types/express":"^4.0.37","@types/express-session":"^1.15.6","@types/fs-extra":"^4.0.5","@types/glob":"^5.0.33","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.53","@types/passport":"^0.4.1","@types/passport-github":"^1.1.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:api":"mocha --require espower-typescript/guess --exit 'test-api/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"f38115f0b72518a2c38d3fb0406b24a3441dcdf8","_id":"@atomist/automation-client@0.3.5","_npmVersion":"5.3.0","_nodeVersion":"8.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qnOwI0C26S3zWG7jMeTKB576lF2CFUFOeuZb5dxmAu/L1K9jN0JOsvMRUlIKVKifVsAr82eKZKYs11Ca7zg7qA==","shasum":"a1d3b66185c9a1a6889b551a93a9a2facde6f2ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.3.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEOypjgKpt8TOTea2QLKE+nO6o06TCO2y6AFqaMKv1ZgIhAN+BL0RixRAqAM0er6wfodyNs3WfsMilolnhicGFtSaA"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.3.5.tgz_1511389569658_0.8506463163066655"}},"0.4.0":{"name":"@atomist/automation-client","version":"0.4.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.6","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.1","apollo-client":"^2.0.3","apollo-link-http":"^1.2.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.3","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","heapdump":"^0.3.9","helmet":"^3.9.0","inquirer":"^4.0.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","uuid":"^3.1.0","winston":"^2.3.1","ws":"^3.3.2","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.0.37","@types/fs-extra":"^4.0.5","@types/glob":"^5.0.33","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.53","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:api":"mocha --require espower-typescript/guess --exit 'test-api/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"c20e13673afe30094e5bdac63893b3fd053ab14a","_id":"@atomist/automation-client@0.4.0","_npmVersion":"5.3.0","_nodeVersion":"8.9.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-iqg6rVGnytvmGjSdbrwZZqDFmC0uUVehp/785cgUnhCAoIpKqiLPpfUKohvnpv9mw+u6tkky5Nsa8iTbZuwLlw==","shasum":"25588d19cfd84fc8ffa963b60cf69a2a77fb59e9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBowcxLvcSs5d9O2eDyrAPBkRIyBZE6Wh9i/CQhseJaQIgVwVMz1cmug0Fdbm8zMOfZNMz9QzlrFyJrZCQAVkjAMU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.4.0.tgz_1511892100217_0.29072599206119776"}},"0.5.0":{"name":"@atomist/automation-client","version":"0.5.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.6","@types/helmet":"0.0.37","@types/ws":"^3.0.2","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.1","apollo-client":"^2.0.3","apollo-link-http":"^1.2.0","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^4.0.2","github":"^12.0.3","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","heapdump":"^0.3.9","helmet":"^3.9.0","inquirer":"^4.0.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node":"^8.9 .0","node-cache":"^4.1.1","openurl":"^1.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^2.1.2","uuid":"^3.1.0","winston":"^2.3.1","ws":"^3.3.2","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.0.37","@types/fs-extra":"^4.0.5","@types/glob":"^5.0.33","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.85","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.53","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.6","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^8.0.2","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^3.3.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/**/*.ts'","test:api":"mocha --require espower-typescript/guess --exit 'test-api/**/*.ts'","test:benchmark":"mocha --prof --require espower-typescript/guess \"test-perf/**/*.ts\" && node --prof-process isolate-* > profile.txt","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5d4f5e2148cdf20a910debcc81e39962caca3462","_id":"@atomist/automation-client@0.5.0","_npmVersion":"5.3.0","_nodeVersion":"8.9.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qT2MADM1hXr3nnaL/5oTiM4tyCvCT3XgyZjfITlvV1yf1Nb0aGpR07PIv86ieuWY2tUqWjRqNWo+A9yguX/Gmw==","shasum":"47e778723e05be941e5c2aa4fc6ac6b230a1db5c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpHAd+kWbTIrNgJHXQKqMrjU5KPpSky3fHNqtT7+/kVwIgSho60zcB1mliHYMVCWRZWkbc1HfjIp6HA+51R8s2Ep4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.5.0.tgz_1512658390286_0.07978994632139802"}},"0.5.2":{"name":"@atomist/automation-client","version":"0.5.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.4","apollo-client":"^2.1.0","apollo-link-http":"^1.3.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"^0.17.1","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.28.1","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.0.1","glob-stream":"^6.1.0","graphql":"^0.11.7","graphql-tag":"^2.6.0","helmet":"^3.9.0","inquirer":"^4.0.1","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node":"^8.9.2","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^3.3.2","yargs":"^10.0.3"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/axios-mock-adapter":"^1.9.0","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.0.37","@types/fs-extra":"^4.0.6","@types/glob":"^5.0.33","@types/inquirer":"0.0.35","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.88","@types/minimatch":"^3.0.1","@types/mocha":"^2.2.41","@types/node":"^8.0.58","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.0","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.0.1","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch:server","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf '{src,test}/**/*.js'","clean:npm":"rimraf node_modules","cli":"node $NODE_DEBUG_OPTION build/src/start.cli.js","compile":"npm-run-all compile:ts compile:cortex","compile:cortex":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/cli/git-info.js","lint":"tslint --format verbose --project . --exclude '{build,node_modules}/**' '**/*.ts'","lint:fix":"npm run lint -- --fix","start":"npm-run-all git:info start:server","start:client":"node $NODE_DEBUG_OPTION build/src/start.client.js --open=true","start:server":"node $NODE_DEBUG_OPTION --trace-warnings --expose_gc --optimize_for_size --always_compact --max_old_space_size=256 build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit 'test/{*.ts,!(api|benchmark)/**/*.ts}'","test:api":"mocha --require espower-typescript/guess --exit 'test/api/**/*.ts'","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess 'test/benchmark/**/*.ts'","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch:server":"supervisor --watch build --quiet --exec npm -- run start:server"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"13c6d34dc499410fb854881cc24fde9c17445446","_id":"@atomist/automation-client@0.5.2","_npmVersion":"5.4.2","_nodeVersion":"8.9.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NfNUeSixqpIGHn/pLy112MNCUFGzEdn+93VFQ6utz9OCj7FbCcN/KwvTQVX8tBuG29a0WYGn8Gauv0XM7LK1vw==","shasum":"cab2e728cb49c75c4c20f5c8abdc43dc3e315d4f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.5.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9LQuCQcqgY0397Cn924E+mTIS/NckZD1Jy87a4BpfkQIhAISgl+G1tA3+Yn9qcD82PGe8VH8+1zzSEJvF2Nz+8oDQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.5.2.tgz_1513880440833_0.1857513862196356"}},"0.6.0":{"name":"@atomist/automation-client","version":"0.6.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix-20180111160124.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build clean:benchmark","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"442c5bd610493ccea3c009367718c6b4eefa5133","_id":"@atomist/automation-client@0.6.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8uNpGP1RXwCDSfGPJsl/5pr/ykkVMp7fjhKCMuoCKgueXZ195f6HhTWY80wbae+DajjkOQ2YeWJddLgdvttb6w==","shasum":"b19e4f6c730c47d7912e71385e5120b8bd3b408b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXf7jRmyZ4wDzVBsxHjL6Gd+ryc5Y+x5KgJOhLgTWOMQIgEcfik6OLsIe/lnTRGSCP1VdiDgf4nFO2dQLosucMDHE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.0.tgz_1515708677918_0.9987388285808265"}},"0.6.1":{"name":"@atomist/automation-client","version":"0.6.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build clean:benchmark","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"84c76f58192336f26e11a0b83f40a1268df0dcfa","_id":"@atomist/automation-client@0.6.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NDTLttUxu8CrUZm8zKKw/DSBhbOyDVrqQuIp0xKpcVeY3XPuPrGMIWxyd9lWX0cB31eCtSX8jskAOAKvHAYahw==","shasum":"f78f3f575ccdc13d81063583b8de0ea0b7aace94","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGY5dU7+BBL25MVJFLFnspv3bVvwTfQGnhyWA+IrmntFAiBbGZZTLcU6a0OTNhuU5MC0GG25bLsO+p2tahjVS8A4oA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.1.tgz_1515766094275_0.09654832957312465"}},"0.6.2":{"name":"@atomist/automation-client","version":"0.6.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"4e601254ec9c3ab1246a5dcacc65b074e33d4a23","_id":"@atomist/automation-client@0.6.2","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jNCvDcs3tei3G4Z6acnkBxIrWJLuSjd+uh9xdFhQ+X0Z/7hQF9H3ob2IG/q9vIJVRktFeq8bPXtuQq3RrbBqxw==","shasum":"05d50b5f2d76673581d49f81fc15a488f760d694","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICq3P6mTPEsonZ2pW6fXbQc0EuErH2Jk1zpNZ37RzRS3AiAbfMU3kSONwiz3CJ6XD/sa9iDZ9Q5cyTVeT2JGCD7lbg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.2.tgz_1516027206189_0.8605257442686707"}},"0.6.3":{"name":"@atomist/automation-client","version":"0.6.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0a7777061f141e14d26c636c69a0503a8394b057","_id":"@atomist/automation-client@0.6.3","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pKh1ui/+YHWnpD4UvXzth+FfDTcBnBoNZfE0IwQMJJ2pzj9QK4z54bAg3iZuSbxKzU1XZ9ni7xkrMUnTHdbENQ==","shasum":"322fae4ea66c2bbf27e7c122b6a654ae806c3cf4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYMlMvHdY99ZN9KH2RDR04PIzF30wcUJ0LSIbe/VjgdwIhAOySQqgs3IdGvi4q4Zkx2SsnrON7kQNlYXQWfe/XU3ck"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.3.tgz_1516118300469_0.2201134436763823"}},"0.6.4":{"name":"@atomist/automation-client","version":"0.6.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"454c17a75f4bd0b0fa0d5846077b1d89daf0e893","_id":"@atomist/automation-client@0.6.4","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dbG40bH1mjxHxRx27koSOtUelehQCJMUNJ8AUXvETOdIklHvjMZ4jdu7oH3oc8QCdW2Z79+t4f7DNTGFQP6eQQ==","shasum":"0eb50fd7185141707f79eb773f7e510d22dc9c07","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbi0fJo/RaUdzQv2DJKrgfxs9LNUclQdodnx9Lxrhf9AiBIVi38k7EBgWHZcr8zkgdhKjApoXH5N16G53gQVw4Jkw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.4.tgz_1516730087338_0.0647310211788863"}},"0.6.5":{"name":"@atomist/automation-client","version":"0.6.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"cc30aeca115e6dcdd2ff63b03eb040dc1ae800ea","_id":"@atomist/automation-client@0.6.5","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8VpyTv0Fd5PYSR0Td7t2Le1/+FUlnCj2L0rkctxBH4zzQ0yVSh7r1QrEr4SfGVN06a6EJdd+nZTIfs9bgDKqRw==","shasum":"37ff6f8551a85fa4e671323c13a2d6245d32f856","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxqQhHmcNCS6t2mmw+mbJD21vCYnviAfcEKBYFeEI4MAiAinyEvKx2EMp/SWvK5RD7GL1y5jkPqXr8iJkk/0dpsNQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.5.tgz_1516836507643_0.6107309313956648"}},"0.6.6":{"name":"@atomist/automation-client","version":"0.6.6","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.11.7","@types/helmet":"0.0.37","@types/ws":"^3.2.1","@types/zen-observable":"^0.5.3","apollo-cache-inmemory":"^1.1.5","apollo-client":"^2.2.0","apollo-link-http":"^1.3.2","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.0","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","github":"^13.1.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.6.0","helmet":"^3.9.0","https-proxy-agent":"^2.1.1","inquirer":"^4.0.2","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.4","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.7.8","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.1.0","winston":"^2.3.1","ws":"^4.0.0","yargs":"^10.1.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.33","@types/express":"^4.11.0","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.33","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.92","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.46","@types/node":"^8.5.7","@types/passport":"^0.4.1","@types/passport-http":"^0.3.2","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.7","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.6","@types/yargs":"^10.0.1","axios-mock-adapter":"^1.10.0","espower-typescript":"^8.1.2","mocha":"^4.1.0","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.0.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"bbf0128332383dfb7e85a3f929b8d9785d95523b","_id":"@atomist/automation-client@0.6.6","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-C1En6o0LMz3Qfcim7GqPwGaozczkxntzIsAvWto0ZJAyRmQKCtjom5QRijTKXSfaQp+V15oMx+33CzKnYeESKg==","shasum":"dd1f7e68b5d48f55484c3e0f021f09b5361db478","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.6.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChT9SLaaj41jgIiFfh6igeDkAusrThlOqFyeJpmwZ9bQIgMJ/M5q5uzcaPq6Mw82hjvXlhdivwG1h52dpW1vgubJc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client-0.6.6.tgz_1517428625693_0.6882413136772811"}},"0.7.0":{"name":"@atomist/automation-client","version":"0.7.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","child-process-promise":"^2.2.1","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","stream-spigot":"^3.0.6","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"9137179902eee32688fc8e9568dca2034e8c4117","_id":"@atomist/automation-client@0.7.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cziFImp91+a4OP2Npz1znK/257FlgwE2xw1rwgFjLzmCcBetBjz/2EZJac1Ksd/RtZaI9Owmx1t7t5hxIokyOQ==","shasum":"44a6e5a60e65838f65e91e5b23ebebaaa2c00644","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.7.0.tgz","fileCount":589,"unpackedSize":3399228,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEDeKmq6QnWR258TKA6xo4Uk41UbVWu8/j2Om/5qO0O8AiAJJwrQ1ofbNtpXePiBQ8JmIeIh0nvdoAMVHokunJ9ovA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.7.0_1520463146328_0.13221759374068442"},"_hasShrinkwrap":false},"0.8.0":{"name":"@atomist/automation-client","version":"0.8.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","isomorphic-fetch":"^2.2.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"af3f1540ce1181293770bd9dd4b4da52b26f0631","_id":"@atomist/automation-client@0.8.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/v6VG7sr6fMso9WXPeSV9T7W1riOHeaKSHE4CsdEGbiddexkmb1uZe407jk0udcN8GYIdGob+FNcIQz4aJ7d1w==","shasum":"e2672c18295849da1b5959aa4033b6fdcfd98cd8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.8.0.tgz","fileCount":592,"unpackedSize":3462743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpEudfbQayF1iMRdBd4/WyXGXk032/ZBzGuFSdv1VCGAiB/TFbJ5ARoRqNt7rvs5En4s3AmzOjUoqha0gNhxPSZvA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.8.0_1521463297560_0.05904198327702348"},"_hasShrinkwrap":false},"0.9.0":{"name":"@atomist/automation-client","version":"0.9.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"992044c7526cebaa02e24db44879920cac718e38","_id":"@atomist/automation-client@0.9.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-YeSlTlrzV66DclogSxaBpOMKs3peJQXQ7nasJNwFcCvjek5Leg7+NhhRKIoc6BGT2milGufoySN4J8BuYcrqUA==","shasum":"692986e7970d29e56a7a5aeb7ef13db25a899fed","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.9.0.tgz","fileCount":598,"unpackedSize":3515855,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB6H1muczN/0HVEIpInzt8UdIp6ekn3EloL7hTdYAvpbAiEArvOWdhYYrWDoVqBQ4fUO7t5b/IX+xDcO7UIx2Lc3GJA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.9.0_1521666321553_0.6506509632645994"},"_hasShrinkwrap":false},"0.10.0":{"name":"@atomist/automation-client","version":"0.10.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"033ab696be822df5303e92cd47356f35230417dd","_id":"@atomist/automation-client@0.10.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-u5+iZUL0lNMnMFNTWRl3o74D4n0u8vzWoismEOZz1jK73pULSVK8WoYAWinn2CiUSDXefcmi7zVjsUuCobg+Fw==","shasum":"48ac5053b974ac1426c1bd8164b38df6b8082418","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.10.0.tgz","fileCount":598,"unpackedSize":3470098,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHjP+tMn+4seVtKgy1gMaFpOb4uC2R20rMBeOsha1ckAiEA2mlGz0POA7Vg1CqdncgzlR7v7eWjbAPv3njT78TqRkk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.10.0_1522076834856_0.007077067162095663"},"_hasShrinkwrap":false},"0.11.0":{"name":"@atomist/automation-client","version":"0.11.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"810ceccdca8e2687e0966f7307bbb38073afeb93","_id":"@atomist/automation-client@0.11.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MzbIz9u09uGJ+iDYnRddv4kIXhRQzaO617UVOa7+L2s7H9BNw7UrvMH0oYR7ZpWRQ3EdV+Jpkv631F/oKBAKnQ==","shasum":"ec5b9d0f240b3c43ed5b0dc6ed545467852d3f6d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.11.0.tgz","fileCount":598,"unpackedSize":3515016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICddfq/G2e/1nDVly87S75cayVZkW6YyW2KOMGrPRPkxAiEAuqVkP8FKaPNbZ2OJsnJJ0cpSF/8b2fFmVrU879GmMik="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.11.0_1522084590216_0.43028653822882057"},"_hasShrinkwrap":false},"0.11.1":{"name":"@atomist/automation-client","version":"0.11.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"9bf59d9914e1e760cbc01e2325ba32c8636cddcb","_id":"@atomist/automation-client@0.11.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wvJdkp+a4O6+5ukY2tSDDvo6xPvzAwXycRlDVhYrVkh/VPCr7FJZpGGm9TKfrmvUSJi3PB1snX9yo8Gm1wwbxA==","shasum":"432d4c3604497d5274dce1d7d3914fc5b71b94b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.11.1.tgz","fileCount":598,"unpackedSize":3515984,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFHsVFt4J4K04VbzClPvvOZNSkQYt7KdeXbtTDevV3P8AiBv95i72z2ZEYEqYEwEbzhNICSZVlIT4QQCbNE71ESoSw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.11.1_1522087135297_0.997361439050672"},"_hasShrinkwrap":false},"0.11.2":{"name":"@atomist/automation-client","version":"0.11.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"GPL-3.0","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"54827ae4a898a8018145e179450f8bc91eb672bc","_id":"@atomist/automation-client@0.11.2","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xv+z21nk8TayGSjXfK+AYV7ameKD0B/aOi6vCjPpgqrJOGQk68zZfstWk0H/YDn3D6AHPT2fKb68/UQ3+dlSSA==","shasum":"6073dd7029b959c556d93a513747e47a24d1d6ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.11.2.tgz","fileCount":598,"unpackedSize":3494118,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBo0qNhGsb2nX91CP/BHBDTw7MbxOxJQFwDl9nO1x6QmAiBZaY2YSN4aghcnfyBRvb3yxM3Rc4aPCXwjyN5zbr5TcQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.11.2_1522260295313_0.6177291759530981"},"_hasShrinkwrap":false},"0.12.0":{"name":"@atomist/automation-client","version":"0.12.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js","git-info":"./git-info.js","atomist-cli":"./atomist-cli.js","atomist-client":"./atomist-client.js","atomist-config":"./atomist-config.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6fe36d8b1034ab1496af1561e483ebaa9e188047","_id":"@atomist/automation-client@0.12.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OLswjjOwC/bPd1gTgzuI8S/pNPzOMZW+Pwu0PbpgnHs5WnmMHlnwJI7HxLgy0+0eF7ecCuiAVTx25ILKdNM+vg==","shasum":"43936c2c83fd872f63231bdde30eadcc9e5fa3a6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.12.0.tgz","fileCount":589,"unpackedSize":3495800,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxhzPpiXde1SK/rU3vlO29VcKkRm7C5pE0gG0ewqSj+wIhALfXGEKSBapjdvg8G8zh5fm5w719cYrMhEXdqV1cgs6+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.12.0_1522783929000_0.6398822581274337"},"_hasShrinkwrap":false},"0.12.1":{"name":"@atomist/automation-client","version":"0.12.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"b85aec8ed74854497115f0305c277604ce45988b","_id":"@atomist/automation-client@0.12.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XQS/Eqxagu0XOV3l0oVrRedEx068uKS7ZVOtBJBIznRQoxfqyU1Z9rq4XIYJuDSuPVXohHUphHF9sWpJunM/TA==","shasum":"e35d73938a55606bad7605790e9d00f5cc38ff70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.12.1.tgz","fileCount":589,"unpackedSize":3487873,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkFRcFc2PDrVv28Yw5JtSVxKVeN2W9bBP0iJ7r6kWZjAiEAyY8LAcM2vGG4z/448YWewDQkISbd/KaAAybIVvRvSbo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.12.1_1522785858951_0.43997320571163967"},"_hasShrinkwrap":false},"0.13.0":{"name":"@atomist/automation-client","version":"0.13.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.8","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","apollo-codegen":"^0.19.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"53303d1c231132589303dfbcf22157e6c34200f1","_id":"@atomist/automation-client@0.13.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LVdm/yRdTU3nfyoSVAizf6+lKNF/CEt6V++hvMTWKvKpnsSEdhPLOPWgez2stjYOCRSKJhUI771fOryS+4viqQ==","shasum":"f3215a83d7fb9bcd73b924233b398ca03d8a4c48","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.13.0.tgz","fileCount":589,"unpackedSize":3504176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeYJgUREmf/pb8NLoHLIX+GRWAO+fzI/PUX1OCkxEkIQIgYh8pXKdIkLrfFA6e3ryChwsKh34kS5CYtEuLcIqdslU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.13.0_1523389346984_0.6582952770813135"},"_hasShrinkwrap":false},"0.13.1":{"name":"@atomist/automation-client","version":"0.13.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-codegen":"^0.19.1","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"c55ec6facfb8247cc3a7356acfe0138fe2f29ff1","_id":"@atomist/automation-client@0.13.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-F3yvhGJaEHmogi8UAO4k1X4sMHva+84GCYnbmMsYgx7g8gysNOpf5Hspmg8UShggTlWEAkc9cJ+dpT2yYkpbbQ==","shasum":"f713dfdce086c12642643e46d5cfd142967c5361","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.13.1.tgz","fileCount":589,"unpackedSize":3514539,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0qYgw2ZvIIHn4wEjmpMRBLvpKuomE3Rj1zXOQ3yfoOAiEAtfDM1qen4k2zxiPeB8aLEjuy+xLPW90u0jTCSgdjN1w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.13.1_1523570294852_0.36997901852946424"},"_hasShrinkwrap":false},"0.14.0":{"name":"@atomist/automation-client","version":"0.14.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-codegen":"^0.19.1","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.9.0","typescript":"2.5.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"57f0ca6b6c6e502a19eb2a70c0c5395a706ec55c","_id":"@atomist/automation-client@0.14.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CLLek/unzjPwjBh/j47k6k68vMfCmEdA/uvbygkGTzqzzRBf8Dj5sBBUBGSKndJAsOdKZDpEjInr4lJnQlenQw==","shasum":"a3e44b84b28e4efba7710f7ffef00a8aacec9cea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.14.0.tgz","fileCount":592,"unpackedSize":3523645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4yRHCRA9TVsSAnZWagAAHAIP/3nObCvAAM+jl9VMMq0O\nrBHCeBQzlC8WWEJu9NveUaYvo5So6qzulwqzbT3WLVMizAR8S71fZJ9zGr0J\nixiqfQ8oyk6WUQY2OqA0We66bUOu6MG1MXgCX4KyY41e6SQnpeZRUNm/G/Up\not6XxVoXM5KJ/q0jo6L1TuEIqvOWSsJii+9knGNEbTidWx/7/me3ibFX6q04\nBTf8QUdz3q7/ZXUMokhDQ5S7O9Tz4tk4Aunzc2wRudaCGD7ASyurRuKgdlga\nvm4hoFPGHREDoAG/1ovVhF2N4EmHvD0+ic8FFxuaf01oESiUigHXNZFdi4I0\nItRln+bj8qqd96cRp17/ru81YMzrnBDtVSC2IOll/vWfF4NbdkO0H3h9njpu\nolNTiIjJLefogwMqvLv9P409jKE5YzvPh4rt9q45LLMyBlF5SqB5ul9ScCf3\nMVRCncsKUPisI3cQF/I8QfI34eKrV/drmT+GaBnUnc08hV+kmRuPEu0kUU4p\nUxEEUDePttIH+z/a6NsG45oK4PjFqQrJOXv7TNnZ1hF9cH11CFAmKX62Y9vX\nRifCXJV3JSW8M/tWicMAUayoIP1KNmIQ7cDC9CiLv/Uov0tUndDXZmb8hrjF\n1Y+Mx2ficjYXcqH/r7Rhhcnp8k+p9UF5NM1RT8rDCT86+hiWc/c7erQMnWpK\nwOpg\r\n=Tutz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhIySCaefCbog2r/MsqMQhk2Yd7DmCyrgZfuEOwd88+AIhAIGnts2t16Pzs1saeQePRnty2DY/vmzr+fFEWeWDu4zX"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.14.0_1524835397746_0.4327630277634664"},"_hasShrinkwrap":false},"0.14.1":{"name":"@atomist/automation-client","version":"0.14.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-codegen":"^0.19.1","apollo-client":"^2.2.5","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0bfb6bf9bbd8e6a69668aa033e07f1fe1fd19aa3","_id":"@atomist/automation-client@0.14.1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-44JY9GjN/y5SbrAFBkJ8A2aE4ifV5KB4d1n3E0DvVqSQpfv8E3s2ccXTBUaU56w2XEDvG2S98w3qIyfEQClaZg==","shasum":"042c3e2f80555185bc4f56aa1b561eb0cc125ac6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.14.1.tgz","fileCount":592,"unpackedSize":3539693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5yrPCRA9TVsSAnZWagAAhPgP/3moZjzYpclFeC5ZzfAU\nIGLcXI7HTxA4iKaRZBbN0/8xP2Cz1YrT2UofQYLy+vu2Db0Y2/steXL43uIS\nQgfhO+5B/EW2nQvr4HqXvCWdjYQaAMz36V1+2SH5aKk1dfdQ/gsThL023DNc\n0+BCIXM+9JCtbQO5Ydh8F+/S/WCM677PXOxhW2PsQe0FRThzYYyk1K+SEOFb\nkg417prnezLbBTRv/Pil1/nCPmjSuEzryhyVVdzKySBkNFZXS1Xz2orca67Y\nmc/xprcxyN6+IRxdWzMeiSnEdzwZugJA+sORMjod3jqj7jxugcCbVUDD0hpM\nnelq+ZHTSveUuGFSeCKxELZI3E/ToKVdQJl1j1Lmz2qCzI5DCaH+ARsQE9FG\nieyI1GbU6QvDND5qKNL3XDuvup3MA8U20ojnTQiurQfimtGp+TdtJaw6sAdQ\nrAB+1WiWDUSpEN/7BE8gicLvXlEU2dgBTilOt/54Z7/PIbmIgLwtk2NqPqar\npqru1zZHXotXVRCJELemsa9qtI2FcwIJg0VAZG8yffhlYl582CzjgBg7mQk9\nyGoffxH4ur+AZVHEnceBz2BBwGzglp73tmkGaAbhwwB15FdDSi6xLkkPiZRn\ncCTlF8uYGF2JxZQuwyAM0IKpkBTD7s3TlidrMNL53wQwzNFInzbh0yLs6fW2\nWKGc\r\n=KfB0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/TzqKc5JCczbFYHxwJ6yhDkUrdEZOj18Jm4+XxtqQQAIhAN6I8gY6eTSFlTYvpXCook/WTN0qGzILRUBu3uOxFSsn"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.14.1_1525099213079_0.7388244849005057"},"_hasShrinkwrap":false},"0.15.0":{"name":"@atomist/automation-client","version":"0.15.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"823acc087a694cfdc4b05ecd7673bfaa574f03f2","_id":"@atomist/automation-client@0.15.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JBuTFWy+GNvEHaBYyjlEhQtKc+EzTzA0DDMIlmTh9N4kgYl90toysj4jQ6ThIXwW7c81jzFChabP0jztwsi4JQ==","shasum":"4e56523165c780656f0e81f12c64fe2cf818ce9a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.0.tgz","fileCount":593,"unpackedSize":3540781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8G5MCRA9TVsSAnZWagAAW7sP/juQK9JfCCbYbtRbELak\nbj2k81RXJ1uGIu9kKGnM3pKthTKKmJpqUh01g62/MMpV6jeI2z6XHWnxarae\nH13eK61sVYGbDcS8/f7nE8Mr4W2bZBu0z4eg5FpjkONpssIe36N+g5oc2Tgc\ne3pzgCZqSKRDreemr6ZTKr5D5p12WK1e8tt6naVdnM6zkN79uEsw0qzEfWw4\nYIzk0vGpNaKDe1QKGgTJg1cCw7lbkDfrs11JvMcbRqQApOZX+yJ448tthLdK\nT5Q7hmESQ6vdwhhhjdF7sWsyw1bGKiiPL0flO0k6rvbYkVm+Gtk7rQibFmnS\nu/WROChfX1Gwjpg4ga4lr1zHna9SM793rqH8zCaOoXdUyc5W2MOoAl7D8JAo\nBPlBm3gxv+Og/FrfSsPeKWneQ2ztYDNozrMqTTT8rep7TdwKy6WUfFx2erVt\n6YRooT6F4Cl7/kQTszJb2YU2rdjUtOq7M7hXW89LwkFSv34FXuE+Hjn+Xgch\nPtyKMCDQN3TMR2PaID0uhMaT3Ve+aRYLzm8v6DvYlIRgWQNtKvtKzKuU4eSd\n1NcqPibmHqdKEZw71udy/aiJXro/wAfa+05/9R//RMtWf3G3brC+3ehWGQ3t\nErAi6wKy1xhMBTBJR62TQbRcmX0UkiRVVVVmHtL4N2Ix1Cgh1W8A5TMtg+Qk\n/xYm\r\n=WMEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEnH0BeqvFPuC+7yZ48vTy4eiOmO8CH6zq/MkRMeYB2AiEA+kjC1xiVX0EKrfI21KjZYbb4zXaloR1vqQDUOyRTDL0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.0_1525706314642_0.7441026492879999"},"_hasShrinkwrap":false},"0.15.1-20180508012326":{"name":"@atomist/automation-client","version":"0.15.1-20180508012326","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"9ee331734e6f3cab0048f41182128bf706d32374","_id":"@atomist/automation-client@0.15.1-20180508012326","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ujlTCd2aefxF4xJ9QPQ8WaleNTwAHNB24YbuDbk0aUzguaNl17dAVIGlnca1yzNfZ+9qXzNZMB2wIoYwfLp2/Q==","shasum":"5922fc25eda1fc729cf83980507794791854a5aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180508012326.tgz","fileCount":591,"unpackedSize":3253076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8P0JCRA9TVsSAnZWagAALm8P/1vdwHK659Zv95w3nN0w\nlZ506Xqy9LLRHJcfMN2xGH0M8Ge/FBHo2ufMekcVDy8czMPr+muDnEOmPkEg\nFSwYpAnFI4gbuwyETQI7e/eijAXHDURyVjxlPFLIJkeyuXYLn9uO4I2pZ7tL\nrd+8iJojBdQKDMBhvvXEQXIjs/4OH1oF0FsGH0j+gmc0R2OkuyVUKONyRs9L\nimUDhEScjYKO2HkrNc3JsVHVwH9L9fRSusDABwlAXovbwKRj+yPenMuAQvRZ\n92Zo7pQHUfgAhD4SFUK6+WA6YVdcor4U6z0P7xKGaGKkznT33VgwGo0WcP24\nkeV3DYbg5bcxQdBB8Qb6yj0Yz2PNc7Is4u/GObckaP+xaGOXCAWLuqWWjFop\n9V95kV374rFtiWZc1WqFw5ayEtZmZeVLvtStlPAIz+SqE1OV3w+RtUjGaHln\ny/wSZ7YTGhDWBGTcUvy8ewqJFK7eWaX3ckfvIb1psVi2WdMgmxVcaMH+h76j\niX5pk5lLtuiFzn79qWUn0WOpYrzjddaf4DFT+JK4slydW0PI5o0NzM8I6f+n\nh3QEplS1SgWpY4tQ8iVcmgICwtS8r4c+14CWm5P5N0OPSnzj/wDXVCxinIgd\n9Z4KRSyJ7YkvAoJub6Ko0TL8QhN+MOwVg/Eae/m80IB82U3c0oVHg591zGJ8\nbzyp\r\n=xQIK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3luJvYcYYYHzUiUZu8SL/6HGLOMWhqsO3ZMasqNR64AIhANO2i3Gpc3yzqGNorHI6LcJc/9KrqzJbg7LQ265NLACF"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180508012326_1525742855689_0.5838209930453746"},"_hasShrinkwrap":false},"0.15.1-20180508014857":{"name":"@atomist/automation-client","version":"0.15.1-20180508014857","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"882ac8c2f0ccccd3a1f611c1600a5df59c9029bb","_id":"@atomist/automation-client@0.15.1-20180508014857","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cQ43BfvEd97EonG5SFQBJxEQl8+Gu5ejFfOUY7hcSaPb342C4GGR6QGHcj3/efE2on/QnpqqAG1xlRPgwHEQMg==","shasum":"4fe9b2ab88dd13883e4f2d187ab3c7eb53f6bf5c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180508014857.tgz","fileCount":591,"unpackedSize":3253238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8QNHCRA9TVsSAnZWagAACzkP/Rb8BXvmVBwbmRFAjN9r\nlF50Ne4tJx4uikN4hM6uDXrXyBE4m5wG9v2ZfUwrKCJQSHNE8f5pXcu2ZiPM\nP4Eh4bgSta/YKyjv7exF6yrW8jKsqX/UO5NvWgqbnG9XLBDCD4uGvLJt0DyG\nxDlXXGlKOwrO5G5O7ckLPRDmmRsY6d+yo19RIfS/AKWo7oivjQBoNcdjPluj\nuscOBSCPOEOuPhIkaS7PxPTQv4+xqfzBgALU52/TN21mcriKSE86CBFbtGCd\nZ1W3sIE/wEXTqu3Mxx/Y+6Omro6mTuy87nYIVU1+8Mrxc8eSQ4IO6Lr5zfEl\n98iUVWd9RPwvDhbKheZsghbg9Rwh4/0nVrK3Ya6KJ5pNWuZqTZN8VD+BnkM4\nY4wdIxYAA1zgJZgI1BC0NrMSaQNnN5RUVdxWLiXN51Gs+HncboOPVG67oNU5\nf237YBL3h2IvldUvsEHhDRy6YG2Ga3BJ6Qj/ndphCKYIt3igcn7BsoYsbplR\n9gHp55flQ2P8guhPm3xjct28BsXrsm37BEapYfm8lgteYG8kLhu6riRV9lWr\nJYam3n1gow8tiZqT5eYCC4lHHUGAsepCc8dj9VZBpZQMBmvuksEsw9bBC2DK\n9phNlH0Hctk785zITA02U24ehfxIsHwU2XUXNp9thuWQH8r5Gv1k5LD9Jc5r\nGD4w\r\n=3gEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUvHa0MwdI9qaP9Mc04XmvjQzeVQEE9E6e2FeGCROnOwIgG+3y26ThJyMiLDjmEKu638PQYhKLpts1zFNIDGFBXms="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180508014857_1525744454439_0.6892463575704619"},"_hasShrinkwrap":false},"0.15.1-20180508222453":{"name":"@atomist/automation-client","version":"0.15.1-20180508222453","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"d15df4e01ff2edb6ebd1c2572860e04ba1f139f9","_id":"@atomist/automation-client@0.15.1-20180508222453","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Lq0Lj/dXI/3ZNYD3M9REcXakOppaBgvqFFtf7+NViSfzlFlWXiBqfHY7vgDWgvylXaG2moeSC/Q5TxOhVwMV7A==","shasum":"ddd45736c57bff71a668df7e2dd46ff6061189f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180508222453.tgz","fileCount":591,"unpackedSize":3252612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8iTMCRA9TVsSAnZWagAAn8QP/iDA4y8H6r0/aKGY3YE8\nbqSn1yT0cn1LJj4+ZZwfnmvbFyGAAACUxBzrVZd2+sQB5TT+SSJ5oQ/cl4uz\nPLgyVQcsukJdoAXndPlpDr5kph8+JQuA3xhVlzK8O86F8mMRWwHOJ5YVkXlb\nWn5HoLNPi07QSpaFmNoaM1xez/Zzmp4lrkml9bojeW4Qk/vd/3IqxcIXDY5E\nPdseeom2p2ll13O0a6yKBHQf+GJKf16jvnZ1ieBhI1VJP5CYNl56oBYS03CT\n89LXY/HYXnMd44xzW1Uh/nE4W2u7gcVNvn6E20uqW9wGKoWUIgX3s6hUQEkb\nVZb1ouNbufiuWYG1Fydj1Ih9MnysbwVN9BJXCOzxiO6vJ0hy3syI3T+36OX6\nIoaY272u7Gdjps2W0chl74wDlOPj0LQSeseB25s1eb6AuQYs8kHsyVB9+A0h\n5/URDVRWuthbuQ8Yjms3ffM2+iJBYxLOxsUCTlRJd80sjTkgeeUMnmcCLJen\nDt0btfc4tHwp1L5l10tMkQWuQB+srFSmHPS+qElXhQ1udK+XeDmYfB9HVrvl\nQpFMJE2leraLIPadEJR0keEiju/S9SmIYoByk7oqsbbxiXtMnEqKCt6DQl+W\nn0DQvax8cTdqTd5d0VGcTQyRtWJ6+x7hqQcmPv/PY1Bn/Vvz+ho82YSQvczo\nRxZ6\r\n=DxCD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKyNpz1sDTJP3k6HEINeOsMo1v0mR2qBfvuT0JjVXVsAiBis9xpGTNSdxtI0J84pZ1yJ+F9Ilfr6CLL0L2mMiRxvQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180508222453_1525818570575_0.7405031837509082"},"_hasShrinkwrap":false},"0.15.1-20180509000127":{"name":"@atomist/automation-client","version":"0.15.1-20180509000127","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"db3b6aa0a6bfb0d63592a94609ed07c66a8bc580","_id":"@atomist/automation-client@0.15.1-20180509000127","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wNRqQgWhpeVRU2aEjXtJoDXY3Jb/pO3UO8gTBoah+eF9MaN9aE/ryOTeFyzAJ8N/z8B6e3oZ9yoPj+pZvNtluw==","shasum":"0fd0e0120d611f2a5365fba51cefcdfe7e04bb63","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509000127.tgz","fileCount":591,"unpackedSize":3251621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8jt8CRA9TVsSAnZWagAAwYcP/2nmdUD4D9dUxsl9vhlb\n+eODwNGdt6ccNjhl25cycubLx+zCHONCdb2OhjN+DgxUW7Bfvf65qBF8FvHz\ndrSs8AwdbMBkSCr7MEV+TzSebi3eHbg5jAk1QbIp8O2OE4wQ9PoolwsDbjQ/\nuntsdDrzVw2Lu4PYyZIMGdQYyvbrShBAIqufGlllCFx4k4zFT/FTUCBGQOwo\nDOEJ9QHxGNAr4zImcUf05TwFNCGjRrHFpUbc6l90Pvc3sbWajVIF5+600+PA\nstkfDr6VMWIeKbHsmuDbbcM6IhMqgmI7mTbnQlJ2g++hL9aR5cmCWbrj5N7+\nIPeLuAltBqV7isiJQ3GhCNNg5RPJm4u6L22AbjOH2UX3ab1cFPcEXZ6w0Uvn\n6aQfX/D4xrXSJa9wqmTmmymEoVrhmcEae7adweSTRBaPP8ebvt6w9Pu2E6yc\ndB1a3Yx+wQwIxOg5pBM0dRgBmWQYjqwyMaVCCW4krY7tYGWr8VcrVs/hR94W\nPZ1uDVMU8OWlTfenw4R4mC+MmQ172LFPrByFdoMnSrTa/zhyD6FLpI6iMoHf\nMyVcZ7OoTfon6MwvXTkZtnezRKvrjyJUhW6O21+f+JvvWMzc1Td7TLjAO8yV\nMUxFf5EDcus9fZN13v4vZxtz9nas2fhtcGKHJHSKnxzKol0hQ5hrqMTt0iIL\n8+ne\r\n=fhoi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM/C04vYBxMrnlYJueGzhI8irILKj/4fOXsg50xSa/2gIgEkDmpRhJ92lUlfHtvbWUasJqaKFoC7oKS/tTy2cljZU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509000127_1525824378736_0.22295580201345966"},"_hasShrinkwrap":false},"0.15.1-20180509155237":{"name":"@atomist/automation-client","version":"0.15.1-20180509155237","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"eded847e5ffbd7287eee61b02d9d801fdc83ef8e","_id":"@atomist/automation-client@0.15.1-20180509155237","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MDFSLHV5lPASMEIDN7ki6iqmHvr2N9WRSMPezuhK/9HDarxYI2c0VoVq7bFOZliDZxcpttwqEmubTZCk5OJj6g==","shasum":"5d2abece16e5dd52de8b632025d45246744b8070","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509155237.tgz","fileCount":591,"unpackedSize":3251813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8xpCCRA9TVsSAnZWagAAFDIP/R8PExV9DNC8k4c2HX2J\ndFVrsmdv6bpRCqKS054Am7DY2HTa9r9GA0zTsbf4iZ72WvX9ICRRXKHoVAuM\n1JTtCBjt1PZ5vxpReDlWIcz2wTsSfAdBi4embaaIvP2f1H4LCets8vDeGiya\nsZOS7CaArDlQAWaRYLRivJOgrIKjPVtIYGHebDaZPhXp7PeAXCduFycXw+OL\nW2YIfoEmCWiIgFJJL5YGO1Dn8MymBQC4G4hwk1Zwx4WC20IruxeTYGBBU1M+\nWy0VIBu7zftfYaMHTVZd6Z2utuz4apb4YKzjaGBpdMnX8txsbsjgAJCL8agq\n8Ivjvt77HLK6cm/PGosiF9w8rWHDSCuT6O+ySHKUNveyAYhDpQv6sWXFzuxF\nUn4o9BFyAwpkeqymSIufvXbhi87DMd+N6/wPm7ncEFhwWo2nQ1NWsvr96YoN\nqG7vNGjwUwXdBTaDoZAYfe3G1k7IlDLYDaOf/7FUJca5q2Y4k7scfXL/sh3m\njnZnWeYt1tzKXJ0cViV6lLlz5m4UHiGbjub8iFx8ae0I6Uj3hgzRvlUWNvlB\nH+EtE1Ch9AVgUIubuOpIj8aidz1btvN0MBKm0kjfQHMMF13aRGrGBxY5sZtp\nsKMiCwblFnYRglBYTO4gwT49u8Ph8R6r9JhteWbEzsLx3Xu11QMsXKNvxcNq\nf+cs\r\n=EMkc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICigvqw6Wzo+WjCWCsm6OeGoD5XSXQctAT0LIJt9zefXAiEA1Vv2TZotBZeN9LNBacKwZi/F02r+vosa0UNVwo3PnhA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509155237_1525881409048_0.07114877034352718"},"_hasShrinkwrap":false},"0.15.1-20180509173131":{"name":"@atomist/automation-client","version":"0.15.1-20180509173131","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"7b1f025ac7cfb51d8bbb49e7034083259fc5b4f9","_id":"@atomist/automation-client@0.15.1-20180509173131","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1b5osnOrdn7d43/3S6aI6v3G1ixd9eRTYroH3QyWA53+eSOtn+IICOGgK+St8UPFfiVoHEVBaRaYaNkzbdWfzQ==","shasum":"eb43bad33623f896d3cade7087b4b2d56ab3295d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509173131.tgz","fileCount":591,"unpackedSize":3251891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8zGPCRA9TVsSAnZWagAAepcQAJozypWpRs9dfkY1DS2D\nqXYRr1hEYVat4euPas45qDlJU9iIxW/Mj1wQm30B/hKNbj6yEaBYS3FQQnEO\ngyrdjnfjqqR34u6PNzKtkYGLjzvRPqExXtJNXVNYmktUNWg0asyZ4UKlrJWQ\ns806XOjakuXWNsC9vjFaOdw1bzry5suw3D5J6PML6kygbYHwupxYAEhFOSaF\no3YAnGq7ivgLjsCd+yEwaN2GpPzrI2R009RDEnc9Lu/0NcAJxf2RVDLWGb9+\nKDk2xi43TBA+8TcHBpmdXDCxeE8o1PWanct+KqKZjmMA3PPRhGDSkWlNIkgH\nPg9N9V6KBcdos4tiFRdcF/M+zAcU8YWkWAMNaflRIX03YNJHGZMlrIWBzUw7\nsOl/D8skhEGFEOH59h0AIMt3wz/CR9C6UyltsRg3IojbiwSG6oQavB6CNbYf\nqfTBav3C4ezMMWnkgjcYguz1l/MV0EIqlaj7uaOOOg2Mji2qCR7lET20EXfB\nLqE86SJjfJgFCmAHuxACKvH2kxcWVHjTrHo80udI5L4wL9otrEH6bgYHae8W\nl/ZGJrj2AUY5AnQv3CBEgi4Ey+Bft+9JDy82q3/6wze9tUR22gOEbn2XYaUT\nJa+GDONodzg99T7EITTX2UZu0gExtmS3zMCf6EVu7i6KoJ0BpPKdRQqJgp+J\nO9oq\r\n=+QX0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+y+DQfzbQI/iwUt+tY+6Wq0XsMKyWx3Hyz7eCDtLj8AiEAiCSNrZfgUfoODp01p6rtGgqbjOETaKguONA75qE9TB8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509173131_1525887373407_0.5415991825681647"},"_hasShrinkwrap":false},"0.15.1-20180509183655":{"name":"@atomist/automation-client","version":"0.15.1-20180509183655","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6f3dd5eb984d61c370a020ef520043c7f3e7785f","_id":"@atomist/automation-client@0.15.1-20180509183655","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-09iZtKsPRcB9ipbBbHT0JqU2A+RXK59RWzzyNEtbJhYtGvPsSdca7U1tLO9iyZeyEPqY1WcJG6eTTonpeQHEsQ==","shasum":"d76547df60426c6a06b632ba746245e09356b75a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509183655.tgz","fileCount":594,"unpackedSize":3252464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa80DgCRA9TVsSAnZWagAAxkMP/ApLFRZ9Rxk4OpMZK2vn\nFFpCCla4s63EfX3oMjMEOxJLcAfl+GXIbZmpp7Dqmdp7RJiBgz4Ir/auVG6Y\n7/Dhk2TEWXGDP0DZt+A8HUTWKTrc3HPGgSqUQPeBtDf47jN2R3X57nKGJTsh\npkbbJrrOJdA5ohuvjWWsZ1F63Uh18t3XsIUcXC1rE45RUcuEZGxz1eETY9fR\njfLnDyZuK4NDeILYGQ+4n6NvELX6fwHOVvVb65J4KOf9+znzMgyFQjPZ9ie+\n3R1EjlJRKRKkUFBN4oRA9ftQ7K8tDUM/VeBtBfxlqeXVjniTuzZyjADiqiCs\nMn6oU/urtP31WqkRPgZjVt00zHuxh3NZ1THJFKKeNGQN/D/q082ED0nMB904\ngq6Aayj4NQSRL/61pWD/+yQGPHxmG/G3z47yhrZ6KKSuAqBoNw5V/+AUlpaV\nWMLITu9rtLYDs2ec/l7K8MtjWsgZs8aqv0IBKONtFSvpE6LIr+DLtUkHRBCJ\n9yzJJo3k9HCOzyaviTnXV1uyIyX3LTJen3ZcaJgjxlgxP4DxlNvsHQoY0h9b\npy8pI2KjX9UzsPnn0t7tMKjx0Kc3zW88dDdqAb1/FAIeHWzLcb8902gS3vHB\nnKr2ws9+avfafiiYJrlmTS+nzJWqrFZmm6celWk52jPn6t5AgBaY5fdKw2d/\nDWgH\r\n=3l7N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLGW+PymfJdTR9g5+7NWf9sZz2vm25GdW8ETC1FNj3fAiB5fR8vz2yzql2kgxWuZicE580jChwBn4zkmUGFV6ug4Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509183655_1525891295537_0.7065320937670851"},"_hasShrinkwrap":false},"0.15.1-20180509202510":{"name":"@atomist/automation-client","version":"0.15.1-20180509202510","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"d2f1cc3e2ec03343d62e5d08690886fb9ff6210f","_id":"@atomist/automation-client@0.15.1-20180509202510","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-c/GVdW6vq99m/afGELN6qMnUYWGYofkMjA34j/hMCojkhjkOw9C4JbbNmXjY2pRd4eyXQ+/4XhzoToYk2+eg5g==","shasum":"181e3b394f5b1bcc771d419069649aecfc6676ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509202510.tgz","fileCount":594,"unpackedSize":3253663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa81oeCRA9TVsSAnZWagAAh84QAJxE9AO6oWqefoI3BVJ7\nK+gVMzMG4cgNc+G+c4IW/UjZDG6xs/hZNbeovNMm+Rm3JXpzJwZmi+IWjS1+\nwsXwQGsc8s8QyFMtfGP3ko+zIifHNVQi7GXEY1BrRdbkDgjLWrJsrCth08Tr\nFt0RGawGbFfxUYFwmGVIdXIfy43JUe1zPa4ryy1i8ppbGtbjNtXrz83v4FVi\nSS9uh30PdtBkM862S27iE6MiIVlHxMXy3975/ruqQJGeL8s4cvckVarYUHbd\nJ2OupX9Hsmr6HKx07FTRCrCH8VLZdGsjdqNSirv5RJHYGVOBO+/oe6l9+VJt\nzl7n/EyvYX3KO8ZZIjQ2j7NSeLe9dbfF7mo6oVngXKpgukemwDW+698WaDiy\nMW3KOgZ5hMs5nHbeBiXerEKqRyIwAgryxM1bgfjIS9a6dbRLfbvn49zIXK7Z\nKNf9aFHpJq/0PHMGqc7Tatv4eRql8iwB8+Eet0yr82Tl3j9W9jGXzVjEttVB\nFIDWbhJmSHVWbDNThKXHrfZk1XQGTxMnwu60McJYb92Piym/BjpKPXyVm+C1\n085gy/ltbC8xVxIEOIs/+ZkM6sI1OC9zEfJVY141p48n3XvIuvuA11kotApY\nhwRPDXZMaPKULYBQRdMCtmmVoTWGsiiF3tONJ5UcEFVZx4EgnT4uMalx8DOt\nX124\r\n=7uHu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5y5NKZVRkqlcSHkS4Oi3eYGlvDu3VIJ+0OF4l+lXYrAiEAyXKLaUWZi51Jla685xPk7yTg7Z921tBgwrtT6167bZc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509202510_1525897757101_0.1492929942549659"},"_hasShrinkwrap":false},"0.15.1-20180509210118":{"name":"@atomist/automation-client","version":"0.15.1-20180509210118","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"14db747edb5b783f66cafacab7d7e6de425c2e1f","_id":"@atomist/automation-client@0.15.1-20180509210118","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DFIn8ykGZ9Wi26JbrgHLnaJqg2RFqWmkaX9tDux9K2iDAWIjuwi/BEgvn4lcpd6Z0UrA5juPR03ETj1Tsf1wsg==","shasum":"639030119002689db176f1624f9b5a66c19b1125","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509210118.tgz","fileCount":594,"unpackedSize":3253735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa82KJCRA9TVsSAnZWagAAjcUP/1b9iXZiuEYWpGxS6wgX\n1D41LtERZt5g8Q7YYDuORrcf67Z1Xvzp66bZRc+9hpxJuknvxTMwpJqC8NDT\n2SSOZybKat9Ufnca69zDBi5r1vNhl0WwcCvIALz00AXWYVrLbXKdkXQ7WMEj\ngLceb2y/zXMpNLrKLZVksqupM0PQrlt6+TuZfx3UK9vQDSaveCXfDm8bgXgm\nSdCBkC8Q6W4e3j4WXv/2w+xqRS5AfQn99YwA83FP0kP2niyYQTeMxN8Z3e7+\n9IVD7ULcebR10GUcmMaBAQ0RwhGgJth0plVogatcDM5zLgAP58wFXnBp2vre\nkSXNmYlGmiyoq15xjoPLc7NPtP+XBg905NHb0oUn1ooFCoka1lWl0AMV9H1Y\nYsmc6OkFiJjDvZbf6/QXlIOBpw6J4pM79nv20qRmKh2G1fT1bGc+mVIsxDOr\nB4cMLlVFN7aBalekLBjwbdr9wNN+9A8an9ND2lQQoCwg4jIQPSqp7wKNbUFf\n8V7enLYLEJ1dsue+Q/SSOGFc2gdmQ6OTB8QT3oFt80MRM9Ix/xjYqnhaVTNr\nsLZ2emiGQZZiaA+8eseGxZa/OgR4LZ1/g8sms871mHFlU7eu38iWCU2Wpn/Q\nJXwSLfriFElhAnlrFE+zXj/vgPz5TYFP8EXmwQ1shxkzMi4cKQp/WZQAm4dQ\n1yy2\r\n=/aOT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlHL/l8N98Wp5lhFaykPayP5sPPes/DVNX3Ug1aqIbxgIgUmyXYNnBOeNFONdt6FOcsp3I5IWLbqYpe5q83uH/U9Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509210118_1525899911028_0.49599611478768413"},"_hasShrinkwrap":false},"0.15.1-20180509210125":{"name":"@atomist/automation-client","version":"0.15.1-20180509210125","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"f90d0d82fe86c0b8eca5ae341fdc920d25780b5e","_id":"@atomist/automation-client@0.15.1-20180509210125","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PqT29R3HqulF8T1XElfMVqUvZNvaIo21f+R5bqtGbrOWVI/RXOPrRfpI9PZjxmAj3SSml2VK8y1Kc8nQO8ACEQ==","shasum":"80f40f099698fde735964d5a80bf1059db601a21","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509210125.tgz","fileCount":594,"unpackedSize":3253734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa82M9CRA9TVsSAnZWagAA+w8QAJZfWEGQyRxrW2fpKKk4\nwkCC+8QcbNUZpPHVi0U6bfP68sjcBwf51x4NJS9eeC6IzTz/X4FDjvDqxjJH\nr8belzdk+Y96JN3K3vBGZ/0pv8JVBfrGY3ajwm9N/IaujLNQM4RGRvi0QHAY\nurOJ6qC0tJ1yCcn/CUUyRFzTnny9SXrDLK/gGcbVoYKzwqhUFWzlrqD9IVus\nMJvjxBr8/DggAQKiUwtxd58PaokGoxBGEvtvmn4Mf+2n0JttZWLg8tMh8nCR\nE0/oW9v2TZd1Q1FcSOU7pouyExvAUalrG5phH37yoOL/TB7ggSrn0lGXyPni\nuEK9NMifkhMvsx4WRXK6aBP3bb5bzsof/By7vTYsQMQPaNp7FHUUiidCqz63\nvxNsG4UjxoDjVT+7tyjSnuk2YjUaUp1urtLvIuVtj3zR7X3cZWj5XA+PJI03\nV0RjQoiPN2W5hYoLzfDR94OMe5H9j+Mder1o4RnXhcBzOL3nPRw9QUzw6AUn\naHh6IXYaRY8VRNPriuskI6/xCbSL3y6uGzOii776BYjX8+0wKPAUhDBmJG2m\n+nMjhcMsxGDL+wuHjqrS2Xh3xWsD/7NDvEx9guyuB5oEWTErkPLvYeucrsxH\nLCfxKIs3vmoNi1NKQWvJHgs9fxfEpTuObJPAwCOWHu5nwJagEjENVKwV4HY/\nJWUB\r\n=cGtc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAqMJRVJPuqT3jJKOJeKXQplz5LECBCls1XqmB1vEd+TAiBSxw+cfxcYsU+0HF0tqOFYq3ISrJ0cX6XQXYZ3b2Meqw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509210125_1525900091104_0.8347661995761007"},"_hasShrinkwrap":false},"0.15.1-20180509215141":{"name":"@atomist/automation-client","version":"0.15.1-20180509215141","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6ae3ff8c0660e092649db89969f6347f8e705e5c","_id":"@atomist/automation-client@0.15.1-20180509215141","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bqJSvurNr/NbrSGP5CdA2VoFLSsaCy4hRzRmM4IvvjFAeg0XbiufHTXOxMV2AHk+5x3Ci9PDT1ESGH+bwErOPQ==","shasum":"979a242b1e9a78a6c6a92d21d5fa2b34a95ed381","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1-20180509215141.tgz","fileCount":594,"unpackedSize":3254357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa825oCRA9TVsSAnZWagAAd1AP/1eC3xRK1imr7CWu0VU0\nEx1kDkQL10VNKu6P7QPxfbSSW3WnwCNP3twNm7mVEfJ6I3Uqx3WXpyHw8r4f\nTE1d9r8hEXmNOIxXt0YHLaEPfC0/B9yu5iLImRrjwYBg33S5+Hz7td8nx3gU\n71Y5B0hYWN5t34Ot+gMZjKMRuKD7JRkIjRuwqZK1Iwhl1QpiejyQmPR/RbGE\nBCo88eMC7gpePa6X0Ph2oX23UE3Wr5WUY7wnySwFawZpTKnhu9RXAu2TNgbp\nDvf6iZ2JIuxSd7K0QALFlHVNLRVsdNHisylA+AgPA6jLCBaF17qOlsAHOsyc\n2p1+RRoMN6Ni5QNDZx9JOP3xIP1V+IibvaD97JZLXAMEu4B3+U565YmbCL4N\nGYMkHFGZwIzp8r9lB0MiW5FvRJCqIHqanR+rp8hJXOIZ/Mzq03hk5kwVOXRT\nJYvCU51+YjzNiNutLBGb/y0FwqBS3YLkhukfWXID68FYWbeU7l2Z//XSf8aP\nnhlCiRrnj/EtsB0SHKrvmsyv9x1FL2mld8nnjlcY8sQR6PPG91kJv4y4cDxs\nh62vttDnGOeMRdIiInK2g845K6yYERUWNtlVxIUsv46DEGU0T9or2G7YhmOB\nQ+5P6Lb60Nh3h27mW1GRJ92dRH+GEftVmbW7w6+IpideqRAQnGVuYgl1+ZCE\n2P6h\r\n=M0Ux\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAGp+XWXSc2n5t6a5yH4GrT8/AgdyYQpGgT1ZNU/N8K5AiBJBAv5U4fouQaWH/GHwa5/ta+4EUMXIMbxHC3aQZRWew=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1-20180509215141_1525902950646_0.1297014894703874"},"_hasShrinkwrap":false},"0.15.1":{"name":"@atomist/automation-client","version":"0.15.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6ae3ff8c0660e092649db89969f6347f8e705e5c","_id":"@atomist/automation-client@0.15.1","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-o/f1nspJqDKxHq/y4q3ZAofxf8E1TnoXQ7qoZtqhmIHYiT/BxH4yoGScRT4Uh/TAp153W/FjTCivCPDbodmXhQ==","shasum":"6965a8c0e391ef211843363aabb66baad91141fd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.1.tgz","fileCount":594,"unpackedSize":3254342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa826tCRA9TVsSAnZWagAAMzkP/3XYX1hGxn7He6QUiGx1\nnrouE8sy4/rzO6J3cKa9lhRyns6TMwgHkkoNPEiCfr4WspRSOdJsfXWpTfT3\n03OYl/RahgFzHLlhX0tsUvEzKLWBJpCvWRVMctf7AJ9C0rEW610lzwWxldGP\n6bZO7KPbzSegT6H2NrAqBt8jQ+YHNwfr8bjTYnnvrkeT63Cg/MpU7C/w5VqM\nVscNai39AkwoUjDi5LgjSXtapr31A7WlkdcLlbqG11MLHsYLl3EpsTBvpJcB\ni49v+4U6V/OMfDGBmBq0TDX9r/BK2WWANwc2NT/5OrGdZ5Pd2RlEi8n1Mn2b\nIDqL/xPlPmQdSzFWqLkM0Osz8u9tT8BIIOnUISgLgOLk9a6+f16VeWSFcgiW\nLctXrkU7LmKggbkfswEIMLyw6gK6Gl79T2D3TgcnPXmmHgmprsh6F70/ZzHE\n7BCF6utKk3vw1t+8DnYdz9FNcX2l4Y/U3xQjQSdyj6TKE7ThZ/GHuGpCxggr\n96tzUWOLQLIc7lqbghihGruhkj17CnRuA1m2/DJe5ig8qwhOllkK7Td7hjcp\nPDPiW4BOIJsFk6aYt7Ww7FNRUeyEfIB72R++9WbDbGbVoLdTieJhwJyYxNNY\nCQ7aANAIceL/L298gVi4UTJCiEBNuXs+f5SX+ZURf0uh1Lph/1YSNX7sEY32\nUBqF\r\n=TSsJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrOQ5+6DvZgQ1k9sYhROkrv1gj7l7jZbMMdEFX8EC3FAIgCj81/hOQwtxhhLIVl+eP25WClniHIObXQvnLP06zsWc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.1_1525903019158_0.11274869812191546"},"_hasShrinkwrap":false},"0.15.2-20180509220257":{"name":"@atomist/automation-client","version":"0.15.2-20180509220257","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8e5dd61d5d03d69647103b1a25dda54443d3a109","_id":"@atomist/automation-client@0.15.2-20180509220257","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-SDvxd3m24EfjtVeNZYP8a4BkVO4/extSyUAlfZzzXM2kxQEFDx2cHbCUZWFOA1wBN1mTl20n50xHms7Sph6C/w==","shasum":"d8fee7c83e34a45cf16c67260d46084819fc03d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180509220257.tgz","fileCount":594,"unpackedSize":3254357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa83FACRA9TVsSAnZWagAAib4P/j3HURzhR/3PKC8z8rPq\n0tpDCoCcYS9DUV6j3vzlemeGcSzANBbJcswMKgo+m7JkuyjPfzKPQxrH/ytJ\n5RPIqhamiF7i40nilHZqyBgffykeaqniSalIu8LqGSMxMuX2Gg9sOhvtNDsV\na0Cdq/cwroZkw7gSt0WH3JCFNq04GoSVILJNNhRTEstqobCxpHENkedrYrom\nrf8dXVoFvUezEmssZJdIzrpAAwiPTN5TxRB0ca49OO9GUYqC0jCdO6MmVAZm\nH7b96EbSVvpyFUmF5tfGDt9gm/sEd1hQopUEHfH9S2EjaucJdzy3J3eNSByu\nRpqYX4BZEgDGvKfqrhQo9/ylmpVyJHvgrMzM2UKsr/naD7EL/s80lW2ePkTl\nRkgjFMK+v4r7kBBDq7QpeT2b1B6YDJoc5n1mHmEMF7I7/9OBglP01Fkhe1Fa\nq1/di/j3VTnxfpB4G/6Hf0H5hLjUw8kgHaRpH7J8zWZTkcY8uGqQonSKy5bm\nLt+rnwgk24JqrsRvMbn8IbqNWw5PBTqj/VqZZscl2ojUES7JdmKYspZ31xPB\n/j85dlr2Pt5zTnhHOTKWNKyjIPpTQaqNtFBkE48hokBleLazRxaJlG+NKJ/I\n52CLMODd02/PLPrQvAu3L6BVV1p4MScZZr+HrpW8YEM/yKphSF2wSDXNJ8Wc\nUPdf\r\n=B0xJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpUfYy9QmuPc1VxoRljpoHX3OqjC7ddLqnibEb/twIawIgHyBaVWuL0A+23gRs1hFUeoO0NieMZPerKrNP9491JwQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180509220257_1525903678378_0.12159539064065572"},"_hasShrinkwrap":false},"0.15.2-20180510000413":{"name":"@atomist/automation-client","version":"0.15.2-20180510000413","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"2bfe35a4affdf41fd6f43e3989679a973fc05ad3","_id":"@atomist/automation-client@0.15.2-20180510000413","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ro7/gtFCBAN75opKCLkJSJiJ8i1Xur5JXSwBgpTJmfpYtmN1+BBFQ4bS2rZe9SyxOkls5hXjAsis3nOlHHSKvg==","shasum":"8928a79ec4dfa8cda01de218361fc9e96e211ac2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180510000413.tgz","fileCount":594,"unpackedSize":3254381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa842ECRA9TVsSAnZWagAA2eAQAInzAnJe7kAPWkCZIy0r\nfF3CqRyOZ5y4p5C1rP7wCkfAjokvBhmUv8I8ZDHQ8hV0EMM80Y4pVo2Z7ChE\nPYjhdgUArfI+EyWR6bXmqLaqqJE3RPjwoR0BZlGCbwj2yvmfubguFtA3hYL5\nnaPX/tCjdaFp49BWm9rL+f6jrsKkGWa4M2eqQ5JLC7tYT3MB74z5vPtekt9H\n2TnDjQiqyW2s3WnlpVlA0r0ngx4DFGEowkuLsYUFTtnQimYZTB0BHoYXOpWl\nGOgWMD4kw1U5yK5wsU66wL8T3NimaGOcjVely6okcJDaTim3Tz6dLqi9sc0N\n3E9MPLvHmQv5Y1wMngseXMoOLLYRbmSUlzX0n3xfO7A+KIxDxcvUynnN620Z\n234YR/ErbWWAgU06n8DuYa0sCLV5Mpx/BWd+S98eMV+KkKBW5ZSwoxNKxF+g\nA99QRk3LQFtar910/zz92uuZy2hDlJ11ka7kUl3svTj3ax3UHYdzD9bZ24JK\nvPhJYdgPsxOGXXG2opndJGjplyHWdn5f88bWiwXDZmGO9dLAuILIRVCLnaWK\nqiXamPUdet16msrWwgZ6DqvyOaOgxUCcFzHhksIMVrFprw+PWAYdN2DMcp/c\nFAuXmhJMiOGwRACHKr3nW0gGbIAzkzUp/nRaXBuXK1yY0D11YlWTvmqmkv+4\nZ1vq\r\n=mFzf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHagLr+H8N3qlRdMmeKpfsq/13gogPs/jViw4cCp/NcwIhAPdZO/KkbHU+2mWWzECeYWW+aBGOGcQ1KXgMvhbtBu51"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180510000413_1525910913972_0.23865501466750927"},"_hasShrinkwrap":false},"0.15.2-20180510013515":{"name":"@atomist/automation-client","version":"0.15.2-20180510013515","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"7fd683638ad1ca8c3c7c99720fde1d6dc1fff5d0","_id":"@atomist/automation-client@0.15.2-20180510013515","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/NilS+/QpC4YCCz4iA1GlLPCXV2ohbW2yOFAGMlCiyMrYTmsVuuq/M7lJzoxrbDDxcW8kYyflpyAL3+8k+19/w==","shasum":"c4b300c68ce53d61305a0e2a6d907ffc8c59ac64","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180510013515.tgz","fileCount":594,"unpackedSize":3254665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa86MECRA9TVsSAnZWagAAyRcP/0VzxoOwoZPmjkmJP7GQ\n7qyNKUq7lLjkmA3OM0EI0Flw3+kerh8N/O083x0qf50Cwdj9kwZ9cFej/g5o\nSrOmRGUjOUPZ7G2ltJnRSXjQYXZdaRngdf81Uqcr5tbHpMaHp6Hv9Hs7ETq2\n4MJDpOHqHjG1d6fuNiVkk3AGYOs4A9UL9J6XmZXbazsIsipieh/n4gan24GD\nHi4tHBnd8JnNV1egIohgGzrc+eZiAXehIYWDTx95bZQMVb2Y+c40VG2UVtwN\nubcTWdJ782uIKG4SWH0ZrYQXTz+1TV8FSZWUK1GQfWYu7thIDSXGco8vA5Q4\nEGNUIzf7cN7gNwC93200jvx56zxFqH8Ce3o2CfR6D76W3LdqxhcDddCyiC/c\nBFsMXcN1T84FKESuGg/1kMvx45xN9v/s0jq0EwZ+SscgDau1RgT/0pxZTtu1\nrGUwtcrk9Oe+KKvxVjj53XpFFQEHxk7ra9wCbN7vy6/OZmOpg4ctTMWMXbfQ\nel0qX579FzJjjrIlVTnHq5yMousJvvt8mJPApuphex9b3iC75J0kEQDmzZXn\n7pRciGA/s9VdnPHzdDAL6xmEmcKTSzucfnI/8nXDvnXmht9/0UmVldTXERD5\nPDuH/d8ZqwGfV+gyxqvGIlP0z+QqUa7hCPUJgyy8aoIKFSBAL8IFtwZXB2Dk\nt/ym\r\n=sl7h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQ94jbxgyw9dvPacZQfGrGzJMk4BxIxYCue1zc/mpqCAiAj04gBahgieHTTSL+HmfGOWK1HNM5Ea526ZahxfO4dNQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180510013515_1525916418684_0.4407031486846704"},"_hasShrinkwrap":false},"0.15.2-20180510063432":{"name":"@atomist/automation-client","version":"0.15.2-20180510063432","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"3342bff19adecdcb6411fa868db8f5513de5731a","_id":"@atomist/automation-client@0.15.2-20180510063432","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UCQk/UvP4AYlrFubKd9F11u4nARA9huvhrxWx3q+vfPEGvFrL6xDtkvUGGSwKPGUOY19NqcO+8DTPTt7TH6obg==","shasum":"e23908761e476e8b8749473c75f74a2dd4779c65","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180510063432.tgz","fileCount":594,"unpackedSize":3254647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8+jsCRA9TVsSAnZWagAAkUoQAKEWYu1Ns/aAmesLEA5/\nC/lEFStGOP4o08NNgvB3+wFWxYB41FL/AOrdomDb+aiWjIzslrRQJFtwyJrz\nXPfZqlEOxkzd2sSAQrhtF/od5q7kC/Vx9u+OMEqFCZeS1YUHgIbszRWMG4gM\n8rvbmYcjI59MUPeE/vzv0qmANUzrlqdp9tWxN7E8zpNkXJ8FGugero9snCfZ\nLdiNA0BsDVhvMD6mdOBi/YIRwwl6h5iSwJytXwsrSmrbsjuNjqjqvLN2yTO5\nf7uf4SXJYjBGJs5ibBhfa/sBRXyuPEb/hmVCUN39Zi4qT//b4ZV1aBm6Kz1j\nlvZLgfPnP75Fzcy2zA6BqPzMubCUdNv+NjhEk8VgfgO8NFOGp4alE7OYLlP9\nxjbT1a5wf7PZFzuUnrWuQPt8op2P2zHXP2EsWPmAVtTqCaZcXPoupgR33Yiz\nwCr9PH+bo/uD+L2j6ksCn3FC0irfud49dFrP7cW0hpgQBWQ2Qnwz4AHZTlE/\nt5gLLHFq0MUuEvpYB0OIromspTmwRKo0mtPrHTpfEQYdsAzVCxWGh2gqkGa1\nHBJXybWvW5YlGT6p2CuR1cRbckTX5Zruj6+IJSrpBgXSF3xY9x8Sk4MZ+gKV\nx7fkzFKY2npBFEBrDlhBoYVVAWDhXjkzcsRRi0RKDoKnV2RwI6gST1RbIeZ0\nNfM/\r\n=eSq1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/0N7KWFNkUrHJcEN66xhD7g14djK3wjtXAOm6fsGNtQIhAOdIlEOBudmNJvJfMlIxIMhBQoGAy0/KE68SKqs/M90l"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180510063432_1525934314369_0.056189009364773"},"_hasShrinkwrap":false},"0.15.2-gen-intf.20180510172039":{"name":"@atomist/automation-client","version":"0.15.2-gen-intf.20180510172039","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6d72ca2d11fe1969092ed91fa23e1904939be047","_id":"@atomist/automation-client@0.15.2-gen-intf.20180510172039","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LjKJ5cQKqcpRfmHeY3KIF/VRXtcK6oaWKYR1MLEZHmmxe4sG+y8hgsM8tpBnqTeQn6apZEnLaRm1eOSKnEV/QQ==","shasum":"71ac225421776bf5686b88e3b1cfdb21a9622bfb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-gen-intf.20180510172039.tgz","fileCount":594,"unpackedSize":3247441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9IBwCRA9TVsSAnZWagAADyoP/06HbPAytyWoGdzoySgo\n1nlPoT0znYinrE7Cx746GzS+uC0eek69dfW8oiflUr9wU0HvrwjjR1+SryTa\n+6H6ZBHH4Dy3w1bk3yqAugL1mmiSaOmRvJ8g5uoCrryjWjOoUiohAR7zJAzG\nyG387YersyBgTPoDh81y5b+UquYIZIdJUXBiyzirFgRX+Owo3jbl4EyVaPYu\ni1yIe2WwEFu9x/x65ds8FP68yC4tEuw19yUDxG22WhUQfNRaGJSgL1LZRh7m\n10b4egJBdcqXIqoMcIlqbRctC9WX5QV+1Ajbs+fFxSHUCoWIU16SLacHhm4L\ngf0XLXMf2hbeJFNu7Frp959QY0n3UGdec85tKueL+m9VPGIn/vfTLK6udNV9\nrbL35ha3RdrcGcxnAN3x8Yp0doVnPWanPxqD96/6d2IkqySvcPhtV72XFkst\ngJJ7g96FtFyBiioT5J6UYeSix+4Q7HjmATY3xKqOsl694XyiNty4YJKkvxp8\nbPRKzhFd9rosoc9YLF9gAP1MKW2G9BlJwy0oW0UMFJvyJqinQ6ddj5PkESTa\nQPf9CAhWo5WPSxLRoxIYC66+gTb8AkUhiFblignR4v8JNOgjX3LN5LdlBIMq\nWm/ix0ihTUa4Ej/dERRxmF8GDafAtOIyiX/qBSMhz/XUQqsTRGVoNXKsDYXu\nOwSP\r\n=n16T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTG0H0bvnyivcdyMvLm+0uPaNMb4QGvQ5apJoDnB1PUAiA7c/ZybZmOpSs9YR9ybHJmnsM1/X5BVLOZGzK1B+65tA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-gen-intf.20180510172039_1525973102191_0.20604417438809008"},"_hasShrinkwrap":false},"0.15.2-20180510191705":{"name":"@atomist/automation-client","version":"0.15.2-20180510191705","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"12aca806f3f49276d06aecf4207e5fb27ce4a6df","_id":"@atomist/automation-client@0.15.2-20180510191705","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Un5nL6XA/Swc6w8pW4q+k4HJXpw5zGWN781Ha0O+xoLEOObqoZcUdl9iFAJkSIoXyZC0DKicuwlPTxeVdmaqKw==","shasum":"2165e2e3768dd1d6c7b273dbc03027fd271b3e5c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180510191705.tgz","fileCount":594,"unpackedSize":3247432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9JuuCRA9TVsSAnZWagAASWYQAIYLijeshManA0pwdUPn\nKrIfnYRML2WuCS5Q+Ted1XOY7vtz+BU8kwKkoJhm9I4OCzf3YquYJwf7YR6W\nDnuz+hkgJuQkchOnaF11dVWkK+jCOF9U2T/j0bFIE3YNs7Cs+QQ6xHuW5ur7\nUppq22/zSmO3OgYwVu/L55U+x8iSSZxfL44dio/vf2z7kVtECs8dq5hR7ewv\nZWsZLtqH4kCejVn7KRQBDvwdGBHJlBoLj7cpf0PbTqdjYvedHOgwkgVxlsUA\nnppn7ywiIBKxnec52VCMPOJQwck6zAVGa/2m3IRzizcGXJjEuFreBlIxW7Dv\nDGJMu6AM/78PZV6YAmZSxnDJ59KUrk2xy8HRUWCCsvSCi8zsmxJU8ba5MEIl\nS67U7aCaNfR1Vmb3EzVRUPbNDT073b1P7YjPMeqVueOuijQkv9iq8Yfk/5BI\nD6wUXEo/6txMUp/V+mHFKl1amNYH/fGnx3kHYtBjBq5AyyJ/+H1Ye5Eh7Jss\nSdmypr78fGSUOxU7nftHsMqKoaFFUi5E+qxVIvzJlmNV0lgF8mbwKnY2Fmmo\n19oZJ923Tbz33O6XnPiZGHv5OTKseVr6yyvWjvoH9ZdalHuMPPXC+Bdv7DNa\nYYXR8kwJIboDXADdJRDL6wPuuaSCeHp9ZaNBvq/VAnuLCBd2OCymtlMiYJLr\niyE8\r\n=laO8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQJ5vkRxWyxVS++cUptIgmTHw38IgBGsm/gw8W6hjvawIhAIeZHgTtuDwKXAU+83agtswaeihbnN4mKKKSJVzb4L61"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180510191705_1525980077158_0.4596137321848117"},"_hasShrinkwrap":false},"0.15.2-20180510195817":{"name":"@atomist/automation-client","version":"0.15.2-20180510195817","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"80f5e9d3ed65c766940359591781f0dd535d6a48","_id":"@atomist/automation-client@0.15.2-20180510195817","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pbwQodQd0QZLemkuq4Tza58AqBQo9H6AASoW6l9q7MChHX4BqdfTALK/OwzCnJbxm9aWvpSSEhWc866YYBy4RQ==","shasum":"d83df8d078db601af251f11639d7961a47ea12ca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180510195817.tgz","fileCount":594,"unpackedSize":3247725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9KVpCRA9TVsSAnZWagAAAKsP/AnzdA1f6d+Xkdrr7RQB\nug4XE7e7wNLBqjA8mPDI/atosV9ioAi77W2HFsNNdsZZ2O8oxF3KLkth+omB\nXO9zX3vTj60ea9NUtkr8CBB/UoiL5V2RZbCXpKXDApW2LM22+lf6DTi2V6n2\nKmQOkXvAqL9LyXDgqef4OSq/tBXQvlnRgn3T/+/sIP9Y9+zgNqBSmue60avl\n+SaE/vzNfH3UzC4k36Pa5vGLztIJoNxn4CnCFNZfgo4HLD5pHrmEoH89RCeb\nMwRhRxYYqTXqQEweFriZS7JG33glKc2ZfrcEkcSQTKa6s/On/iRF08TZRXh5\nUlcL2pAjSseKiuZY4FcthmuhIctMgDw3nZJzMJI0vkWQvFHOaMtQ53skjcMU\nbCFLJ59r6YoEFnRWR+L8FtMiKEjTqEYpHlibChUBotfJQrU2j1jYQ/YJf0ri\n1kTpxt13wLGXQ8Q5PpVhp+Wu2ax7qqYSc0FEd07Bjyj6pEwGdJ8HYofjetSA\nqw8V9HrAPPs1AlBTdjGyCYMVE4JvTjdIOHnBlPyZu0yTHGSrtq4jTDnmuBau\nz+sdPRb88GfkPMjuNBYhrV29fSRp1P2+2hoX013b1iyEYUke5PFxTugOvflo\nDPN2RD6U8RwFaBv2aMBqe0ShGwYSfwLcFD510sGGbusA3W9Yu9GIduhAz3Ea\nsKKg\r\n=lWEP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBsFgC6zhD3RXpc1K9KNQXr0JjW/DkCzIk08srs5ANipAiBfrVCndu/0H9uveUhlhNDeVMWBkl3tmgzVS7NMvMQEMw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180510195817_1525982567582_0.003095219826784179"},"_hasShrinkwrap":false},"0.15.2-force-push.20180514174349":{"name":"@atomist/automation-client","version":"0.15.2-force-push.20180514174349","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"ac82ae6c8884cb09de5fdfa8dd157022c83ce165","_id":"@atomist/automation-client@0.15.2-force-push.20180514174349","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JbAPlmX+IEdXk4Fn30zBUtQ7hWcX6v+OrtIvP0Xc+eIQC/v6JoCMH0NupJ+0Klb9QTWuzmRHbQy/ZcGlVqnlKg==","shasum":"5b83a8e395a649d1662ccca9113983d662b78a73","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-force-push.20180514174349.tgz","fileCount":594,"unpackedSize":3248991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+cvZCRA9TVsSAnZWagAAs7gQAINenOxdwTOAOBtTpoI3\n/WEm1zh7AlB+fiseU5u4CHtRdqJ0aSKt+KlDa4Uu32SczOCHWMJISDyop7tg\npdwWo/UCv8/ovsJNPLSJ6OeNCSBMw6GCRVfxRF+o3Z44i3RznLjQAZuWQGBd\nxua3sl0jE4SQkxuAsHv78Fj/VkFVtcKeH8sYB9nwxzUsefiWgs31+hqOdriC\npoxMTav3nwitts60qXfBUm+EZ2r/EtPxo5TtCfGm+H40VRcOg2H7XxkxP1OA\nDem9Bx/yTPht/gpHxQME4sLMLOOhtjzfISwODnE+jgItZ52fGwPiEXnWkihk\nFUclRTPpzQDzNcirG2pCWKgPK3kayx2SkDCUtjWSCXN8c447ucNZWupEcYJ4\nS3DmqqY9+JhJ/3oGAuh6DvG/Yd6keZhsJiUSGM8qbMERO2L8Hy5iZwhEjt99\nhScyj85NM09S0RJFaN1CzZz1RTGNv5SAShbYnLBVfSU/r1vcxkZL0zT2ud+z\ncHsyf8dIpmwVOYMi9N1srntWOq42EqWbObNqUMURa9/Gj8Qx2mW1kj53qMrj\ncbNyuW/aZ9gyxs03T63ZbEjv5e6++Wg1izNS6WjbXZMcZFz+yBlZ102GOWIP\nYRMddX/mwI4xN92mDISfsc7t35O9k/yK3E7ivTcJq1TFmaDEV/anOam4YYXZ\nDE/w\r\n=GNfy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6VJJXehTy0eBF8HrFGdPGFGmhp8uXZNdLN1oeJu+togIgBZHued3nWt0oL7kfnSI9NSLA/XJ2DXVdMVDtThpGlqQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-force-push.20180514174349_1526320086962_0.9388973810852579"},"_hasShrinkwrap":false},"0.15.2-20180515121050":{"name":"@atomist/automation-client","version":"0.15.2-20180515121050","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"658853492acffd27b81cf90e594d3a745a8d3f0f","_id":"@atomist/automation-client@0.15.2-20180515121050","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+fI5w8JsmiHh8vFjc1GX9ZeZtzrYbMB2yKX8pI6q1ejBmqqXIf2I9mqDDju2q8OFx5sFHp+ZX8wHgt7/iOsJmQ==","shasum":"9a1312042d319d98e94f650cb96ef1a6bffc2aa4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180515121050.tgz","fileCount":594,"unpackedSize":3248980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+s9YCRA9TVsSAnZWagAAzM0QAJkrQDaHcCoIbp63k9tq\nT+ZaMsXClbDQy/oyx6+xPwHr6uvOFsK5RStNWM766Cf439voxU2cluuDPyX6\nfJL7rMQXl//BLh7a895BrVTU3032giqsTwcjwqwQx9rPE4K5TMfa/PyAthW0\nJtJc3gKIpKOCotORSyrSaYiqY017ZXyu81HPwjnjdc9B2STOne/fzJtyDanC\n+zj9waqnYAFUQRebCzbnRWvx4bpOfYUsdxvmh11y4gOEQKPArHJtVRnSXZP4\nYLrtw6nxUqeKSAIBZvZ4N/631QJ1pDy8BMXohrw+okOeEDaRfTOgLSjlBS4Z\nYG2oPsA55fC3o/4PUtwkxuWLVSF2v+zfur9xt9ScZZShff7XFz/L/kVRJlWi\nDa6BS2PtMqqXU8S6kLWgrURp6L+mwlaeHtCWTYEF9B8HIiIBlhSLV7M2HA5v\nWetuZKwSTbpeEzjSRU/lS3bPPYsS0ufo3HrPnRwvVEZG/xzscPyxsqX4n14n\nlIVEJfUSYOzHfTv6fPixsYRhY3esT83uuUXQbV4rezbTDoKUj9x73ixrQZgE\n+PuKNwtJVATcAvjBavSc4GZSRxOQ+1Newx3eG1IElA82XKya+hw3G07d/usH\nWOfRbJ4es4us2ZUIOfs/2n+JFw3JBrd02E7gxc+tbhOT0w+sK5RLCiQV/xEh\nAmbe\r\n=GiVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVkZP4nG8cVjdCdTkMT3Jk8nZaWsqe3170Kyq7DU8jsAiEAl+jLkVNExXr+ID6mWbJwREqbn/lmTqZPClST0Wx3cTM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180515121050_1526386517989_0.7484063135677748"},"_hasShrinkwrap":false},"0.15.2-20180515133528":{"name":"@atomist/automation-client","version":"0.15.2-20180515133528","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"30da7f89faf9dfa2b8d2aee7c5f39f7e28e3dd4c","_id":"@atomist/automation-client@0.15.2-20180515133528","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CwnINf9YGj2rgpq7dYcfIyscIHMkFd4FphwkC/YT+aE00vaKi0dAljtR1OpmleNH7QrXnH5+GAdZqWrI01FFHA==","shasum":"d74f1ea6d2eaf9e71c375af6f7858a002d6e494f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.15.2-20180515133528.tgz","fileCount":594,"unpackedSize":3251367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+uMUCRA9TVsSAnZWagAAPV4P/jJ58LZwH9ydULa6lBpE\nhbH8y8Jc7WzMV0g0FglfX4VwrmtElaEJ2CzdK1wR6rXJHjDMk1wj0AR1vcj6\noChXsE8DLYychAzEuen9/20UOPn16BENjE1Z5aVyqksjzyaiqWVceYtU1cjH\n1hcuxhvoxzF7nhXt1Lr+Zt/OOrDt609o2uIra8yi1eAe1KUFaowl7ITulcpC\n+/DW2TU/IJpcNrlJeVSh5wu7cMIgICNY7SrENA7IjlrGXRa7xAWsD4vgVGZp\ncVF2PHgv0yux0C7+EfcEJ70zJKG0bb2+jdYazNRTRGX7tJLptwtsl1hM/HPT\nXnG0fiZ/Ay1YoWTSSfyMdVwXrt4ASBagv4F4bkz1VOUKTM12OD4v9WwADFfD\nzJNagpV7VnVXi/+cfAUl4so/4YLhVw/z1VYG77bhFfkWp5F7vZ++RQbGQZI7\n2SuGTnYB0ihPNEuZ66TWyAiS3jt+Wl/JqEBSibP0hwSI0FsTdFrwfZ6p1aJB\nPpXn85Y8okIEbUhPcejdFJ6Y0dY//4DcUJpkLTjf9WZ0mgZQtl5+NI5FsAyE\nUm45hR3CjNP0RJHlY+ybDA6KJVQkbdKvi0Mv/0ACLZge17kpCFs3yG5rDBx1\nh43X8MaIRaY2Lh0psn25DHM/4tEQAeIWDvD21ES3cZB7CzXfp1rd0sa9gZsV\n/Zwg\r\n=vbg1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/45TbqMYaEZI3VlkG3e8ALUhTn5NxyX1l4ivNydak0wIgQCRf7BOGcuu0CDgEIdNZ2kN4jPtOaLZN8YzkFkY65r0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.15.2-20180515133528_1526391570468_0.3967272043719763"},"_hasShrinkwrap":false},"0.16.0-20180515142515":{"name":"@atomist/automation-client","version":"0.16.0-20180515142515","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"be6835574cd10ff624a428d80d9197bd52a71109","_id":"@atomist/automation-client@0.16.0-20180515142515","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2UP9E0/Ws9wbQZXReQwkcYyfuzFPaIFH8dEs8vf70PxbJcdCoZkuSTkCE8/NJBRRex5FKXj28FHjQPoNyUEVcA==","shasum":"a4555b2f82c0529c41cb03fa98bc09ae347b5bde","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.0-20180515142515.tgz","fileCount":594,"unpackedSize":3251786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+u7ACRA9TVsSAnZWagAAfvkP/RxYBjE1O15GdQ+pHGuq\nEGCVcIeVMg+yjiLD/7zkRLu79OsZZz2TTFE8J7o9kjT7L2DE6Yl2E3ZvijUO\n5mR23P4K0/0OcSWdHBfMRGWvcEJtILcOz0rxavxCKmSHCs94CDatsJCk2dNF\n6ITMgBBm2suONlr5T7Jo9feAr9eVnpL9X3qJExI0T4pg7KIVQh+dXq2pp+ro\nyjecls7C8eUq9mU6ObQf4pdjKacdT2iUFJJAIsbMCNHZI9grlotrmi95Tmn+\neQE+uBJiFap+K5XhsbH9CpSD2RmATcY8GKu6SW29m8ECZQYbxzfXf8iIrhkI\nMWZKgt3K6l9vabkYgFFSrTPH/NYaCj7sPDhPlQbnzRyUKcVJupycQWdC/amI\nBkuBKHGTXsc4HWY8A3tCWPu+LiqGsHJXVKJVyhcLlmEeOPsmgEEXXoO6d0fz\nmBZpnpzHuMN8gQ+/dIcoGeX0bF22FAg1MSUFQ6GZiexsl0EJtgWnW4qIp5Ql\nRN1M8Hqi/J7m/o/2j2M2wb7lWY9gmMoxz5phzQSOGzziV4t3ef93TjTWEtMY\nfbqx0ADleRTovjt6lYkSrZ33PWs1bgSmXWgjIooK8VRWNIgKdpBD1RmNPeW9\n25r2HVawhUrwKrE2NIuDOg6PEYbkd1sswX/U32a99Ct67sE65ljOlkyR3kLD\nBXkQ\r\n=D3PK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF7/rfkAP+D1k3ISAmv/6uOfT4KNHmnEL2P7Yi9CbycQIgDSqYcRlaMjHYspAwvL2BBV/qmUmBfp9lbnVGJMztz14="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.0-20180515142515_1526394559129_0.9317170473046836"},"_hasShrinkwrap":false},"0.16.0-20180515153512":{"name":"@atomist/automation-client","version":"0.16.0-20180515153512","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8f52d8c74c78db718413343173adc42e26290d61","_id":"@atomist/automation-client@0.16.0-20180515153512","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GBcgnWbhJZuCFyRZN/PZ2+vCnY2DcjiCEYP6Ao09OF+y4D2T5fw3dj660Gq4vvQg8pGFDNyDxAmKvFdkKEdmxQ==","shasum":"654f92e9f8c4e7c9ef921e8936b02e0b946d39fd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.0-20180515153512.tgz","fileCount":594,"unpackedSize":3251786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+v81CRA9TVsSAnZWagAAAjMP/0U+coxqrA6uPviFUlY5\nK3bMjv7D8UwhPVkeSRQ8FMXHlvCxtjbNfyCaBMF0VTPpUGMb9Xt0Ukt2CqwK\n7S1FsxAGHEvfKEhdh73xEM+KdMphKziOS6F11JK9lKS5k3k2ktrSfrghDgrp\nNNUvKK6LhfJ/E7xMUhJw+MSbtHX8LZjdKmUPS4wabmvF+GeU9IN1r7Gd1FNz\nVsDzPj5HVkCMw1v2VasAlG9CSO+E8L9xU0qNZ4S3Ypx7mzwt999wCOVNYX54\nG9TjEcjCmnIPz/iZ7kYK3OQv3tqhEvH3AAJuC5eM2f8p4R9n2vjBZI0FLAo3\nHMsAFCp50sod42SssibZMQgprflMBzxMe7WJiFIFMoQhGsrJTOpVN4nF6Hyj\naLbrCdpjIT45jZLLYRPoql3F02EtT41GadD0oZq3iBoAS3FBHpfJEEgi456w\n5fT+c038+56cfTJEcY0SRwPG3p2UaIGY1MhXJpjpYb5nyi2itvwmRnSCbsau\nJg6tpCMC05Wg68kJzrNXEat7z8Jj6lpWnNmeZr3/rFvG1EC9xMH1IqSh3ktZ\n/hZc0Y5nAuRASxnem+8AZZOt+Rx7hNk4tpGUYagsrpFC24kueU0F5LVlYWl2\n8ju7CCeAAkHBsO3U4l8/VdpROMUtqN68hSO+BYw3qZHcmqm6fbJT1sI8HFfx\npBwm\r\n=WhJv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMUn4HLFGwlu+piyx+NwSFmZgsLXEW7TkDsg0TmM6O4gIhAJ7NAi60GNJjdwLV/VgEu9DDs0bRQq3iKsJHyX3Es/9e"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.0-20180515153512_1526398770982_0.5807198713358674"},"_hasShrinkwrap":false},"0.16.0":{"name":"@atomist/automation-client","version":"0.16.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8f52d8c74c78db718413343173adc42e26290d61","_id":"@atomist/automation-client@0.16.0","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CmQDy/nia2dmVCc9bPi/YJiAI7vZPrXlzTaHZNV3seRHlR8uQd2Ao+1lTofbAHSgznjofh9L+IyFPDhe6jH9MQ==","shasum":"c128689a4e8d05fe74f4a535d936f03d2f4e7f75","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.0.tgz","fileCount":594,"unpackedSize":3251771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+v97CRA9TVsSAnZWagAAvHAQAI2Bl9//3MJkAdvGVlT9\nsPWy3vA7pS9Cphmk6pmeVJvcFGKFPt1mIsS4rhnEExNAU1oMdLgHThHFR576\nNGAvTS4XMW+js6pDtJcWTFukmzc08VgKZJqPZ8TDS51PAaDBb2EpgWo+JfDk\nCGY8TD2O5uxmRVIxBT9ug5p5xNSTopcP0btdX3NsPvU/zD+jbEWB0wL32tU0\nAGxdOGyduKVqzrHGo19DQppDn6NEG80Fo6UzfWx37ZjcFCSPBMk5QFth69xn\nMCu4N7xf93/GdQUZWgyHJDxN4n0eXrJMeOeL1Z/aqpYH18LFkjjUYYdnZjUj\nJOtNBWaYtvN7pPs25rUE8no7kx8S7nAANtbjPpjrJb1YkpRvbJeCTv7rI6Nb\nkaFJG11TIrsuqELYnog46vWjfPArOO8zH4bQz98o4SvvejuzsyMy1WSaWV7C\nO1fCp6NuhCAS/1tWhbRvj6Y3nXoS7Y/uf3iwW3hv/MweHlNNWaoOBzYtLkIb\nfeKqy2TihDjOGc+wikG6XRz1lVqRSbewOmq7aRBYkrkF9DdoYOI9x4LTnNga\nFPOzd1/3Y65k1dgUmp0ScfuvSiR0TleIq8QltNScKXsMcruPQCqaABR0OG+b\nTrJUbsoW5ZeRkAL520dkBl4DWTsHsAqjnZG0AYZv8fePFMcCk47c4/ZD+pZn\nrWhZ\r\n=ccta\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICzMXxwcEiMB5xyjurJ+ql1vdomAY+KF21lKfOSgTOikAiBMDSuMKZb+CiVqtAVE02i0PYtutwdtM1IirkrJw9g1ig=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.0_1526398842089_0.45556354992553594"},"_hasShrinkwrap":false},"0.16.1-20180515155239":{"name":"@atomist/automation-client","version":"0.16.1-20180515155239","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"05d939f168c39b03c9ce92322b4ff5f606ab6edb","_id":"@atomist/automation-client@0.16.1-20180515155239","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TWcaeAqdPi3DZ4brS8UWbPy0SH/0VAOLDz0U65JEPe/Y7yyr51VJf7aSdm5ayEdG8qFXd+JayOdoZfpQqDMhOg==","shasum":"71e579c47461daff467635d2648221866ac6d2f8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.1-20180515155239.tgz","fileCount":594,"unpackedSize":3251786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+wNHCRA9TVsSAnZWagAAd8IP/0KpAQEx5LPlYQ9yt8Bq\ndcUAoYsFNEnTzLedZtUbyv4xdpkL0l7ZaqU3Bfx8Tp5M4X1LYlBa9V+4ZnOd\nO+Jh9HHs97QD2HOxpbKA43nS7A7Emgc5SGWBXh+k+CBVkERXPEalFQCbA2fr\nFIi6MG4rc8gFEZ4nfEd69YbgxrhkKXohc2pHsNaAmARKYcd1VvOWnrHTnbRg\niwJq9UzrOwzX6MRDvx4mqD6sMsJY9h94owhOXK668lbPQidXiGhXZlhCwbZt\nKYG1BIBbfPJtaf34VGm3ssjUla6BUIknf5XLcVaqayVILXZT/nl4FMHb7MBV\nhJ+cs8E7zIsrKqRLn+UQoQABALUIPQzufeuwJbGd9yYyB0crEZFJvmu6HTlw\nFFXi0p7k3knXBXUyWpnxmzjfctzcP3uK4qd49MMlP/86rRCQVZzJZmrsjapt\n/q5qi0mf4r7XWcG8NQkwyN0B7W+8EXpyZwXq7tsYMv1YsT1ZTMnzdkK/s6m8\n69fdwk/AxCmlkEROoq1lqbY5il6ifJnCp/gite+x28knTsKqST5RKDFF12rn\ngRVdMcG4O46Nni0duPSYLlbl0yGEzQHm6j2tDl5Rk6IXESkIN/0qRyl9jW0F\nCM41rqsua4kVHesK7K81P1tDKOpXd/asKuIBwQEWW0e/VBoAP1/meY4lKZ0r\nRkxX\r\n=QdEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxzE0aICgAPy4Z3qZt1ZszRqfzNhFFh/Gdz+M07VmSiAiEA8183Eg1kGP7Rk8lpXuhnWEJdt9i92ZWjYJYGs/lSMow="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.1-20180515155239_1526399814340_0.04611809727704186"},"_hasShrinkwrap":false},"0.16.1-20180516224516":{"name":"@atomist/automation-client","version":"0.16.1-20180516224516","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"01f61be31734bc28201dab4488a2902add223ca7","_id":"@atomist/automation-client@0.16.1-20180516224516","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NATAx7npgt0OGBHTYnUElvy4EVJsglSnDjGIg7URT1d69WMWhA9pOFLqsYYeIAld3aeHzETUooXcwur8++IrMQ==","shasum":"267a85582fbd294aefd9cd261ba719cf1a83508e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.1-20180516224516.tgz","fileCount":594,"unpackedSize":3250222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/LWgCRA9TVsSAnZWagAAKMgP+wXwNmq//ItmwFjXSwTe\nwY+kgUzNz6QHdz7m8LBdlb1qLZpWuG4RIFiogts3j6iUAsjgguuajdzUjUMU\nwMjQHcwOrBtWhhOqIPnjXAltXZqVE+w66RBtCBtK4gUxMrZgy66dJIHw6kbt\nWpnDT8WPgPvzpywGgADYBPJb83/eirmuhZBcKG+P99OeocJkEf9FSfOuU4/L\nqCC2EuVm6bZnZOYaG+cZ5I0s3KdTYXKUVH/paVJExBuRi7hOkJG2tZxM1xA6\n9b31ugk9i8+ZNUrl/samniBkkgNZxSVwwmiTWzwKQWxH/uMNJxEwsW7qKoq2\nLT6c6ttMe/n458Zm/S2bJW1JLeOe2yKpbxZplrMJq+EHmkHJASAWPKh/3aMp\nZwNq/0gTD37/tZC6ZNMXdcJ10bZKiwHkwWD3BoPkD4YJBDwyipGDO3H+dfvJ\ntn0CI5ZPyqig4ThDAcM6WJKuZHE5wR+hJ2CMVBCEXr35tPAuMP8t6SxKbOuz\nmwxqIHsYaGz2qDblqqoy4OsB7urj1SWHIPhXRfEx1dxqdgvt7bYrYLk5DKrS\nOM1UNOQPJr3tRJY5gBH+7SMRj2qgPGCYvAH/Jh+jcNdVKJ0YOzhJATJ+7T+u\nL2xW1fxi6F64hHm1W3wjkZqq/fTAp1YqCrJKJc54f2ALqI2q67RJlcnBQQHy\nq3ua\r\n=lt3q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGdJf6/2ufkGY0r8AgWDHdLjLVhJXWQSHyv/+lJbcMYVAiBDQSvlCRxKh+k3NCmlokomNDVHxrM4HJXZyku9avJASA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.1-20180516224516_1526511005798_0.9252202994147789"},"_hasShrinkwrap":false},"0.17.0-sdl-ingesters.20180517221419":{"name":"@atomist/automation-client","version":"0.17.0-sdl-ingesters.20180517221419","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"f2490829949ffa98700c0f3418dc146c995231ff","_id":"@atomist/automation-client@0.17.0-sdl-ingesters.20180517221419","_npmVersion":"6.0.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yqdUtoMaIQwWAyUVYC5TfVK3N1otPYcPc9YAF/qM7gAmAuiVGIUCydEOnnHhFT5rzCLZe0f5qPgI99oeBFE14g==","shasum":"1c7691250b433bf999eb2bf22dc4f0ead9b8d202","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-sdl-ingesters.20180517221419.tgz","fileCount":594,"unpackedSize":3253247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/f/6CRA9TVsSAnZWagAA83kP+weXkqHUg3iDgM9EGDrp\n56f3RftckYzA3t6ywLDfekUn6V/a1cOOd7qO5hBN08s7YbNZiVuSomDj6Zc5\nVGhGfVDGX/jp9zVIxV9tsA5G9uyCssBojhtozXFZGKvTn8CitA2KwNttFpMR\nmqgIHHPfBuuMW56lW9K3VqBwYGTPrK8VepAtSoSSz96mPpbhnKSEuocS0T87\nX1EOmiOPIw6gkYZUKmrPRDduFPAJt+jAVJ1O0rnBHqT8C9bwce8sH2FGXW9o\nXuiOpmbvTjhMREnEH87JVJ8Ar94d6r19r0RGF5peahpdfKqEaXQoiobrCJlC\nNGpQ0zg1pyeTvwJzCoO9cl92x/hfPH3rQz11t6kwkclEjzIQNfatv3cM4uc3\nRTejU3VbGPCMo45AlRCZ9QDPjLfsDwnp9Q4IhahVBBZpU/+pKCOW45qX05zV\nDuBZbs84sVTD69puji3lr9R9vjBCJGDm9DQhoINpiNLajJ9c4c74VlRU6kV0\niWCc0dpREQFZsg3ee2ObgZy3oqsxNr467tiFfKcFYuKQC6zSD4y45o+7Bx9w\nP5PJ7zghtg1681gJtw5wEqn/OfYGjkisDFGGgZUuXNp+nnEr7gxr+NnzTZc6\njaAlEJMXJD8Zf4SXAeC2Bsq6pi/5PHKlsxWuX6t6KgRK/zLpZew/38DoQIrY\nu8KE\r\n=1TVW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7WSq9hckplhcO6VXjCQ6WczZU2TT6+vyrwTt2DsRk3wIhANJVgH8xCSBKpypGLfTGSyYv3GnFtZyGyaBjl+nzcqKB"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-sdl-ingesters.20180517221419_1526595576094_0.3763883624435107"},"_hasShrinkwrap":false},"0.16.1-20180518102811":{"name":"@atomist/automation-client","version":"0.16.1-20180518102811","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5d649458877695bda7b7e96890513c7af4c082c7","_id":"@atomist/automation-client@0.16.1-20180518102811","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ARxJubTzR9KjXnf9u89PBTi6hmFjr0eDl//NU/blHD0QVGNDIbaqSD/5x9ZVwL3TaaVIbug4JBxOOBbWVl/R6w==","shasum":"ae364b8247606dfd45dc851abb088ab924926649","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.16.1-20180518102811.tgz","fileCount":594,"unpackedSize":3250216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/qvmCRA9TVsSAnZWagAAmS8P/jU1XVMzndHoY3+kY57o\n655zMm3FywDr+vTM7KFaYRTeJYhYb/wDi6X1Mq7oClmLAZCVZZpRYwAn1JNg\nTAUt77/OldVKEROoX6H9PQpR1/wOPJFm+BlcinTfCNzDX6fu1VYcXH4ng5ol\nkf0Lw0DcXmeQN5+u1g/8kIxF8DK+KYgNt4/oNWIF0qq3dbaCGAY71Kl7Dj0X\nbY0zZCstnPdxI1YOeyS+tU/r/tdY05pAxZB7zGMK0gjXMVcWFK3Pg8lhkFEL\nzpQTUpLIge+KeNXT1ru7vvOPN2G833gnaDbulB4dn/L5GklfAZeb5Y02IbYd\noX0w3A4inz1yD4naubgZ/hGpkBa4KdhzYUSTXigzThRMWaBenCqRX/5ExCa3\nyOkMfdh9yuVNgi7KOznb2zi7+PSs8Ahh/m53ab5y7ahmBsRSSD5NguZzmgis\nSxJj1EwiY0e8pdzbz6eUXUUXe9suNsDNVXRys0ITy3Xu1QQyKzvgjUhnTMom\neM4nJ8lUu/x4fuJTjgb6KKPHpYRcV6YphUrv4/hVKBTtlLabeWPGP2SagHop\n01WhNPMAR4+noNzEYOCyx2pResWPdy/8d94qnVA8DZ8JyH0+pJycZvU8IK1n\nACR7vJnLSmDCeK06oNJaHkDDM2GosZjBGmApXAMe4Yl8l+22GZqoGLza7QMB\nTjP8\r\n=NQch\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlImVrDMjkZUhTg+U8frwbtUplOwPARzEtSt528b5sxQIgYFUK2BWW5LPyXcdjxeY2u2z351Li+yGu+zw11uHlb+8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.16.1-20180518102811_1526639588976_0.6975760257800807"},"_hasShrinkwrap":false},"0.17.0-20180518104139":{"name":"@atomist/automation-client","version":"0.17.0-20180518104139","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"67d0ad4865210ad51bfc61f7e122ae11f075b8f7","_id":"@atomist/automation-client@0.17.0-20180518104139","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LQVQO5r9T2p4RcFLgYdhbXZjPJAbJ4NffUmZ8a9AIqsmXYlJE9yuj8ttX53WyN9YKFj6U4okxOxwEEYbwfGbgg==","shasum":"7aa1201145717e96501ac003ea7943641e81ca3d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180518104139.tgz","fileCount":594,"unpackedSize":3253227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/q8HCRA9TVsSAnZWagAAGpkP/j3uH/XC1+D0YtuGcPhN\nam98tIiRnskjOCW8Ck3rasApc0k84ZAdH2X/zpQmQ6pfekpYLxWwGUJ6W8mr\ngwC5oNiOq7Fwfp4GO5KFWCOhSoAp7uKXkHVrFsj2oNb24PHcpUvF3e9wptBg\n194D7tTDDmainDmwYI3/9s66NM5UXDyIibza8vuFnPliYggUv8q0fqnf6b7p\n9YutTn6te7UFZH4YSxbzeYdOHQnkR8JCWqt1fEhN/5givY2Ye7VhgmhsQuWs\nO8F7PJgVLbjyzhDzjvpDeMLaTc8kAOEYjTD9JWzgtKIF0Zo2lIs+kzVGB9y6\ndjrhPmuokNjJiboA2UN5NsGA9NcdFq7Kxdi8iZa4V1WtG1Whv2qHGH297L/K\nwBSgxBU1qCUoY7ZEWbEps2HNPGSXFryaAeG2Bek87FHJeNMxVQCcWINr+cD+\nnWtdBcpBJdskgEfzlT92mhpzOlmY75Y1AGoC0w5p5thPDMufH30ERgSLE5h6\nY+hMB4wv/VzyxWIiSmBheiSCAPc0z6/8mqSKwusFO9xwwnN4hhEQQ2SN2WX2\nCAZV9uOk7M6o6WenSzBXa46j5++wgRx8MBurq44Lr8v/vnbArVnA4K07yJv+\n3Js73gleuCI4KUrp5PWLTOWHGjwbUJIcLGu2RlYg6EREZ02vpg5BhlqHqui/\nMYxw\r\n=ji9w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgA7Z8Zq8VDvP33cOegqOEXR+shkXoFpk6dZtWjRpEVQIgXZlRSa6KTTA2E7C4VtOBe9jO0JT3m2m7nN/0jHO163k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180518104139_1526640390456_0.9819916738144427"},"_hasShrinkwrap":false},"0.17.0-20180518194834":{"name":"@atomist/automation-client","version":"0.17.0-20180518194834","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"71c500744d0f0a5f64304739a75a27170f1a91ca","_id":"@atomist/automation-client@0.17.0-20180518194834","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qtt6r6FUQtTVKSbfVsXCvaAXJ6hPkapwO2wRPfNiOZuEKr2ZUZfD6NbumteJFUYo0T2jrN6OeUiubT10uBRuuw==","shasum":"50a688e523710d353b85d47d0792293582b3dc02","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180518194834.tgz","fileCount":594,"unpackedSize":3253597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/y8zCRA9TVsSAnZWagAAEgAQAJIQrSv8ErJaxpIewhbR\nPAxe7z/n1lH8AqLLOHXkfF+IS2C7GE0fe+O+RKT7Z3YbDM9ctsXdtLuFj25F\nFIQtP6Ch54hjtBcSxbrChOfERSoApy8qFcgenXN6cfd5yrw85HL+NVy4ONcd\n7SCJyZ2dz1CsSAbLWfSUMhWyYkUDfRrTW6B+M2skt8L1mceMfX130iTF3xnh\nk2IeHtye8gjkFLaLF4uHIJdMqo7ulaTNo67ef+AgsFvV1kWjAtOBHc00S32d\nJM8lllOdcb21syanQgEEqnXC/B9D/nsWpvhpvTPLuvXHA0L2gg7CtbQybtgX\nyVRboUv4WeggvdJqJJskU02k5EA4LIwSy/XdJfA5TVizEa4L/jsxkGW3tHxM\nxEQLulnsljpQkrLXQO9Qf2EHS7Pb0N4Lq75H4vQ2lUBPF8B5r/Fo9aw9+azY\n6bamkBqswluZ7/OWmqzTDS2WtK6jGcKG6hACpuEonyZzGvrUL5+tN1pkfjG1\n1p84ReIJijZift23Rlia49nQy+VUIV7YIlAPesIh3cJsL3i9fizutEUhR77j\nT0HhEghF4Um8U9ovnoYvgmqPQnY7bW0kLxKRvd0fI5lziHC6lxcJ2JaECZnI\nfYeSlttv/xiKNoWMxz6er5vqtUmULTzWssB/jUjtg7/Ut+YvLh8UiSeEndXd\n0PZe\r\n=qbpm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf+QyKuGazMVzWvV87TlOQ54WgRxXwYa+umG7uIfeWmgIgDyTVpNmf5l+c3DKUq4/BlFKVdtPP/faq1hUhAsNk+lY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180518194834_1526673201937_0.9108039416863263"},"_hasShrinkwrap":false},"0.17.0-set-branch-293.20180518211506":{"name":"@atomist/automation-client","version":"0.17.0-set-branch-293.20180518211506","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"cee3709b4c98b6d5705e93bf548278d0d0df9ad0","_id":"@atomist/automation-client@0.17.0-set-branch-293.20180518211506","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Fr7T1KJTgpaNFOb1j7/PgIbXU5wxVR7AemRDZC7+BCOnEl9O5uPJuqMr/m9TirXzADubKbmVYDZ0i/32wq903w==","shasum":"b918b56b78e8757917bee3d0bcf1d739ece43238","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-set-branch-293.20180518211506.tgz","fileCount":594,"unpackedSize":3254321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/0PbCRA9TVsSAnZWagAAsdoP+wZgap/TyLrzbAJdaxVv\nfcuv0OAzu/EuP58IvNUsuII+irWFE+onR0/LrU7qR8zm+YGSHrrOOqm/Xt0n\nsjoc3kkog2a5+5ZuEKFb+F3AVLbOp+WfZx2UG+qPy9WuoxsjGrBwun7U5thd\nDFF1QpNAjys/sZOS5Xe316ZamoclmgfGQ5KYfVXItgFx0dmI01DEZCFzTVHb\nmJOt48X34kBtw8hf9o2QKyRIgk0EZ00HkpH87UUBSw63iu9/6k3SGZ7pBlHK\ny7mFoTRsxDKQRFZBsX1fitqiO1zlcMewl2R3N/4aPF8LQSO0gCxcic3JjA5Q\n6YIgR86E7EYT5ofRGsICxGdJNwpXaY7uNMQdXC8LTL9omI2hUGEB1MCsW0q4\nySYGVrr5GUmXSpQUzVM0Ls6qM+4LTLFWv+K+bUqWSP/qQrsR1lpZcTKR7H4e\not3AfNwitF/bpzffKGAwFNoqutwH73gkWHxHEm2tIrke8QxtDUaXFXu6T3GF\nBZeG1WsckOXzVwjDeEG3BWStg1wCCfoRvreXDNzb5Grsm4pAKgzySkJteiJP\njxRyz3FfzRoB5LbzuhnCluT4v8lvGiNhGMPsFJPOPMGUedFNgpgzN8mRwtEh\nQ1GwSMIubgCMzSG6JmYO35+kATeGNp0GswapySW65T2cplCWy2BG503Aoq8Z\nwyOm\r\n=RtoP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKdNOAGdmcmAKwlxZvF5Np215i4NNqtEDIBWKLFTLyrAiA/JPnuAV3hkqSmB7QI2NW6LiVhqA+6ZV6kxNH3cmbgOw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-set-branch-293.20180518211506_1526678488290_0.6925339063785381"},"_hasShrinkwrap":false},"0.17.0-20180519040557":{"name":"@atomist/automation-client","version":"0.17.0-20180519040557","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"db79746d799d568aceeae57ca13c9e20d33ff386","_id":"@atomist/automation-client@0.17.0-20180519040557","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cwDo0RP3x3tyYDzLJj9i4IbxDUkBJFPlqtJUzsVu68khaTK/wY5r2UuPhzowcT5/8SwC7/YFElgYiMj0P9epfg==","shasum":"7e8b5baa1c9f8845136460755868aa02eb28138a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180519040557.tgz","fileCount":594,"unpackedSize":3255757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/6O/CRA9TVsSAnZWagAAGMQP+wTjhglDmdGtTTZLlEov\n+BhazF9lyULd7W04yvsHUiTR3YLdioCwOSvqKex/ST4b2sV1tLRWBl5U71ef\n7rwyD+2cRCDAG/5dZ7i7odZDuL3qN0E2rTnHgcN9Eg5qxlQLeSbIlBqhTJf/\nWEpCeqhs+5wyfLOT7p6X6xu9ZVGaVCZuqk18o5xzWcvl7FZs4cmgPzNIUO91\nN6IsWhTM3aqBfxetCs5CkYEHphZAdi+s46GFyVvCSEGaWmT9eH/o9pMVCqSI\naX8SFkv624XqFkJ2ObfCpzivTMwWpVreVclxQ6LuXdGIFErOWJvps8kKBfse\nnMrL7RhJjbfex4K+NcLRYn4s/SLVHl3XVLAguXsyb3u7aTgWB/mTx0W2hqvY\nKbM3bG2O/148L0WfinS244TxuFOrvFMJtHq6H2WJGJyakedN/zW/d7ZKtZ3W\nqzzvUhDTnZdZdAdpmBncToUxCpPs72EOfgotIsRVnRblDeq8Luoy3p3Qltlu\nndxWyuyO4b68bFXwaZ2iWeiK0FEbdBct5xnermgeqDWy3LxFI9MUhKFNcS9r\nuYenM++TziUrpMGI4SzE9OhVIP/DNwbibPETMWhupf1BAuE9CJl1OOMbEyE9\nxr/3YEDMJgs44I5oLSd4Y+hqHXY/reDSdolPuaROiNpXsdNZDOMU89sFbbXD\nRvsy\r\n=em1R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQjZCqa8S7LLMHDFiNB8NTgkaiM9Gb5IgXlgXM27muyQIhAIWnZIZ4pIXL30QhcxGSRcDGXOCOmagpTTdqOvfVFxor"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180519040557_1526703037690_0.2254004709348234"},"_hasShrinkwrap":false},"0.17.0-20180519071246":{"name":"@atomist/automation-client","version":"0.17.0-20180519071246","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"cf07e14edd1b8203f502e4007bd2461b1029ba76","_id":"@atomist/automation-client@0.17.0-20180519071246","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-j5Ijz6eg32Yp1XWo8R3VcIshOgLC3M5BVbeBRt6AIei/++XNI/V6eV8IS9gBKiT4Yc2ldVWH0d9fou9sW5EaYg==","shasum":"9273c2edfb3eb9ac1244cac1663773d3dfb1efae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180519071246.tgz","fileCount":594,"unpackedSize":3256466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/9C3CRA9TVsSAnZWagAAraYP/172ToHWY3hTu2isCjKZ\nMMcMt8jFGVa6lvGNTVMvm+pXRrFKdG3WxHGGVGdHZ0b2K3G6g583l3KRrWG0\nHll8MCtkcY616X9paVOaHlX7ZPZyizXOaJ9AXFJ2u6qhHx/Ug/zCxzLg5Dkl\nDRO3djYcxpiOASzTzNGgBRANTnt+HYZlvJnKNEspJdiGnHSi8m4h94Dx2Ysg\nEHJWXEDK18L7k+Jb9CuNPkVsMhHvQUOn3sr2/PEmINgyi3rQBV0MeXItlv1D\nJNRuPi+KcEYX39zUsZjyj1xs5yY0xqCcpJX49VhezOYJtNkFxGTYU8mWxKmX\nC9PWL8hCSipzIfFDkAEZh9sQGm1/zJ6PitU8foaByoH+q70cEjsR9IM/Atyk\nS4QE8jq23VOaxU5uWjUtKZkTkCW2162gbPg5S58YHttTkoj0gC0gt1i05CD3\n2El+e6sI+ERjFeZ4RA11Ja5jGkZzL/Qvfxqe6yWDKetCZZjj19Cz0FJaL2bz\nhCEADpM7keIHZRjNpZPNJ8Ny1Deu3L6A8M0/mKeYuDQdDIZThoGZRR2xe2UE\nmcX9/pRIxxRN0vNp6nzxMdE6i+s3efJG6OYLhhREAOIyXPcvqn5vWgua2M87\nsqVM+J/wiMm0B8FxVRYWxVDYt2Jup8tq81J0N4nwECGxsNfIMniLRmMjDt1s\ny46n\r\n=7IuX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEa7Wgnq1v/7LSkdEwEiGhPpy0xcZ/87UTnp7v6OP3ZPAiBVkm3qHXIoN3REwQ/fuz7mBRFEt1d3biwQSmsr5Oqt5A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180519071246_1526714550779_0.1787347436891149"},"_hasShrinkwrap":false},"0.17.0-20180519101353":{"name":"@atomist/automation-client","version":"0.17.0-20180519101353","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"3b4f18e556e4abdae8053fbd89b8975d05659649","_id":"@atomist/automation-client@0.17.0-20180519101353","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ri6Fyoeaiv61a+crULCKgZN3CvJcRl/Jf39vjTqoygv02m68NfHTlhRyW/VQrb61prZoSAOWS97t4kATKHtxKQ==","shasum":"1b074e0a9154e2c5c3bfb0aff837d55b00bd0274","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180519101353.tgz","fileCount":594,"unpackedSize":3256499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa//n+CRA9TVsSAnZWagAA4igP/icLzZkf4xMH0sDnXK2F\nmlGWBxXjvzDsif7sXiTw8VK9ZPvK5m5AzN3SleJq9KGau5gfK81SSMlbDq1j\n2Phda9G1Iq3GLLdRovi0K/BRn7KCFFVoDljUliMaqxTct49Bvlj79MX2ZChI\nvMf+Tae6zOaM4SoqlLAltxyNLxwdQ23/MeAxbxKKwucQKk4fn++cme+YqQty\nUdpEAf3AkmeUm22WgQrNtpVKcBhqy91p81ucUQ5VgRqOyAFq0k3aX13oFCbg\niJYF/GGNOLXlZQX/6Z+G11eTggosHU2rpU8831OXG41ZjhUBWv30D6VqddDy\nLZonvmprM5ZbQcY/L0m6NRroCxOlc/IS3BkH1t5L/D5TN9qJScAuGzryzIUF\nm50Je4pqVeHIt8qk8G3pIVaPk9/Gnzn9te1CsFI6Wpj2Y0mBlBG2fdNZYjAr\nIKsyE/17GTPX6u4VeSQFrpMuTCXJq5rLW6CJo3C53fKrjPAhqWcOQwjWlubP\ntCJSL4vU225/eOnzSCcL127jNjoM0HaSuvvOEG2HhY2J58cKTuNGRdopCPyz\n12xaeCnMlngiQ6U3zYeDMvMLGOUZ+y3t3XSCOjTxsjrQOm5hhzqKxjE97m1N\nDkSHyUQpOioxmGp/DDxmWr7zBK1SXeeckidRs6ZlnRSrGgZocw/Q5mzPJ3mY\nXBkm\r\n=J412\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmiX5wpieED1zyiGK1xPZbB36fkPNOjE0mRriPbZuX2gIhAM7lAZdL/qIZVQc3TKjMrVvZyuwrMpxnTMiqa0yk9zV5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180519101353_1526725116429_0.20396157200614384"},"_hasShrinkwrap":false},"0.17.0-metadata-rewrite.20180520210605":{"name":"@atomist/automation-client","version":"0.17.0-metadata-rewrite.20180520210605","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6729778531c213aae4b7c86c42dfec5219b6375d","_id":"@atomist/automation-client@0.17.0-metadata-rewrite.20180520210605","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-zup4ZvigzQoz+Oe/jkfNdyvLrOZkJEul13GDz+6ssi0DWrjx8myc3eU/sNGi6CUDPyu4yjt0X6YReDINV5HMHw==","shasum":"2249baf8249176e18acfe292c124dc842e7f4d47","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-metadata-rewrite.20180520210605.tgz","fileCount":597,"unpackedSize":3259072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbAeRWCRA9TVsSAnZWagAAitkP/jti3xRzqufKOfN6EPCV\nzfBu0aVUL/0ggeabd92MJ5+MBGtkKFX/sN6QeJlEpnzyHud4gI5Tnmfv6Cwu\nVeB3i/8L0W13o9QiykgFDVtvXSiHwghOBfrNoIZytnKV4FgXVyR2c42vxi2P\n9y5FXSJhpwVawtTb/W+HH8tmWIMPbLmQS8YhH1KVsdZmET8WdMF0QS+rIGJA\nNXY70TeSbYjMa3ZMCCFmdgi9K3AFvtRT4Xp+5Fc6EBqiR2Q432s8XRIYz9Bs\nGkmJ+YYnp1aZUMK4Iq1KVpzgVOOQXg0DsRXmv3MDc/dTPb8aLAofnXqhkxaX\nhOiDrnQ8uSrU9bAotTWMgkGluMxNySIfZfFqS7fzgCk9IQhPsL2571O1h7N4\nPUfDXLJjP87pxrtdVRB+x7G31hqlxekd0r6MQ+xmWAmMkhNP4mCb+SR+70lp\nx+IjyElyF5bOZsCTscNIxxRHwWYcotQAkIZb5l7xWOveSX8nBFt1Jhb3yn/d\nIdEAW14C08UJ4GrEsUbisCeQYDhNMOEEZD/Df10MoG3iTrri3pFl22eU6c6h\ngm4H8oJGwUyJ2kfTGlLbAiiXa/dPdaEklGFRon40mO7XXGJd5+BGJVvqld+e\nGBFbD2yiTGss6KRbAGNfSzaQsJ+eYTtFoC14d9JJTROvc1AhdaASgH9b7zol\nBBWr\r\n=c/yQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2HVw2ArVqwQ4ZovlMXjF2NKVzabK8NhS7/sjcdQksaAiABBVq2l+DOqPYOx/rZoKRQlFPbx/a7td7gVynrsP/aaA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-metadata-rewrite.20180520210605_1526850644061_0.3967513826397078"},"_hasShrinkwrap":false},"0.17.0-dont-hang-after-importing-index.20180525210745":{"name":"@atomist/automation-client","version":"0.17.0-dont-hang-after-importing-index.20180525210745","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"a66825656cf56e9a0d9365fffbfa66c5cceb09d2","_id":"@atomist/automation-client@0.17.0-dont-hang-after-importing-index.20180525210745","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5P2UR2kNkuN9LPZdzNFOEEsHLzQB3XYx6xx3wpP5sPXQ8mlMy2UfPdpXalO14X6opZ6ZcBn08jI7jvgJqnWwJQ==","shasum":"ba26414cb418669b2afb8e49545d0efe9ba0cc08","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-dont-hang-after-importing-index.20180525210745.tgz","fileCount":594,"unpackedSize":3256698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCHxLCRA9TVsSAnZWagAAJqAP/A6uIKE7xamxX7z2+VfC\n5NdBMNzq6NFiG+skKZIzw0Jm5CwVhLsSGXVUmmBj+FBSa5vEsSYDDE2R5Jis\nquLK9xqqQcRsny05/iRjiSRR9Nph0xNcDtTOWU9IrSc0COZgQqyLd+zdcJir\nAQNSP4FPZ+p2jmdQ98X9zL20dSEqMWkpn+tfaOs7uErAtveLXH621BqV8VDe\nUYOrXkGm1d9R/OsQKtK7b4aw1NidnhcP3sy/suEXJTrQUhOyEOpnbf2/G7De\nUdqkCyqnjw9GDw1fMvbu0Zd0B+kArAoOf1DpAC+srO2SVrn+eX0xRx5GSyH+\nEduxLLdzi3s4US/C+XiseCbxMTyb0UwtoHQ0mdNcud046C+HB2uyz1//xJro\nd5nkPri2fVRa33AEoGYmXXxZF1+rEyKJrSU4PP3FGGcT0+tVB1MnGoU9ea1r\n9whVslN06K+yHubnmlfcLtcrkTWD9m9Oc15Yzm0yKob3NyJuHaEI1hFIX8mZ\nkEVb4drX59jJzVOM9MHFKGvjlhaNIc7O76sBx3PVEHVimEiEbr+So/AepP8E\nWGuZ+sRyf1YyDob4Dqm0KkKq+/oikxc74OYqlpGNvQjWNxI79krBWcB5PPo/\nqmI5Jk7Bh3gTbLkFSRc9rcEL4sx8kt5XJ5Ple3gRpfNFg7OZ568vNCVikpHB\nhtQ2\r\n=MH+U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDHfRUD+PsNqvROC3YIwzJvt6k7YMEmKVLCWfxtA2kJDAiBgc53Q0df6cMnembwgE3v9VB27ZIpL2dYOkl3ml8YXlg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-dont-hang-after-importing-index.20180525210745_1527282761372_0.8797342275144735"},"_hasShrinkwrap":false},"0.17.0-dont-hang-after-importing-index.20180525213148":{"name":"@atomist/automation-client","version":"0.17.0-dont-hang-after-importing-index.20180525213148","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"c44961452f680f9f445b99e94a107590f5ac655e","_id":"@atomist/automation-client@0.17.0-dont-hang-after-importing-index.20180525213148","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-do5Bkm3DJNa7CXPN0cFVTLE7wfcen0ZRwamFaCZIsl+V5z+O31E9s4U9XO+M0/HuP7hqvCERMD+5tJtH4rD92g==","shasum":"1cbd01fbd0b8b9697c3b6f5387e11a11018c19c0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-dont-hang-after-importing-index.20180525213148.tgz","fileCount":594,"unpackedSize":3256926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCIHqCRA9TVsSAnZWagAA3nsP/2P/0ziAN5r3H95RFT4K\nIT9LzS3AWvuzYRgDPdTIq04SP/g03xkUEYbOlG665r3Mi6F5zl0WeyK4ABpW\nMbP+hkT6btlNY1g1nH7cS7lbKW4/zyDJMXM2Mtmyq7IXMG8cF1Po+92yBkRz\nq/3qsOYjFSgkRTHCSC3ht8PdSA/5AmiiqFNc27Wt13yZjLo90VzRKk6EWTpt\nNAZXu8ZH3lNR4krxWItyBKIvMDeG8+bapXl4F8cH0qoQl2NtFvY+UdRWKNlS\n5UTz/r2pCr0RR9FdTd+M3OP8AgqWzC2aWhmL7Iw7Icij6CXxupfJ6HjzbNTE\n3+ohyeDNvOzJwsG4N3EjkEH9eRSDzbo4oGpjQQzJKjhUNikKv/bq1VGF5guJ\nqMNZhsHcByFrasfCY052SBKGMm01G7KJsDkS2YRpbCr1sFmziuwKLEbFNC1n\n83JFawTNc/iihz9DA2qkO6BWEf6Q58p8egdTKI8v2Zd/Lh8RSAuTmUtFkbg5\nyhUeoC5T4XFPRGlkwQUU7eUeYdLikUdQkbQPVhON7vOMGdCPMobEC7nxzPIk\n8dEr+RqKdomdmz5xmAprL6xe+/9UL+27IkU0zWsYUlDk1gzetSZGHwo08bh3\novQ8ShGeJUDABfvTpOUizu5U2wr4nkubTdAORu36yfvULvHX8ZmllThYT/zK\nnXPA\r\n=49tE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFfc7FMv5Ji+zqMb55p1w3C/8VHwX1mOU/7xbaFwmOq6AiEA7MxldyNdBVjkRJDcMMt13IVBAcPWDzE46janjzPe/AI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-dont-hang-after-importing-index.20180525213148_1527284201504_0.9906897439807134"},"_hasShrinkwrap":false},"0.17.0-dont-hang-after-importing-index.20180526075953":{"name":"@atomist/automation-client","version":"0.17.0-dont-hang-after-importing-index.20180526075953","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"31fd28ffe07fd05a68f5fd5bcab96ec356c520c3","_id":"@atomist/automation-client@0.17.0-dont-hang-after-importing-index.20180526075953","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Evz6Uz3Kwd47R+1ua7pQ31JUG4eS5jeQWRZ+PA5hI/xx5+//foGnogNwen8cnuERGUnwlYQX9i51nE9LsKTr3Q==","shasum":"ba2839e547c7fef46f9cb0645217067b0e3aa148","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-dont-hang-after-importing-index.20180526075953.tgz","fileCount":594,"unpackedSize":3256930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCRUaCRA9TVsSAnZWagAA4LQP/2CXa223Kocy5VL9jX+N\ncD9hPK/zMh2K3ZzQpHNPmf4frONT8/TM6IiDj63zDex/NOvdpKSCorEAZU+e\nmlmmeuCAfpUfDBFaNl2UBlJhyB+iuD3Fks608FrDlvUnrFhHCh/6cu+rb5ab\nX2qpZdncrJ82LMRt4bhBQdJ1+gv0crVAZRsB2s0QQmbZ6VflePovB1mbcNLh\nuJix1wJJT0q9WtfqK1zO/ZcPbdM45JD3S8b2hlbXiyh/QTCtkYJzYQYQbYWz\nNdjvTC3XoqKv0vp6ItsznFBYCLPAYjuOPORIEBaF6MpzoMLLkrmSEnwuQXce\nHl0w3RsjcVTt+Ys8X5loKImFhcOo1UaCL83aCW9CSYPSsnvlmrPoFaHfW7F3\nhCt+2PuxbVatcGPAKwF504lqSiFo9pNTyJPftGSLgJyNx70ojWqOH3a6lmBq\nOkew5YYPzgS2PPPyNhIIDpGezCJy3cduNDqKZdYSLopFNOwRTTzIXVYT8/Nq\nqo1UdJ7aV2zKKa71OyfeW8hkeHWWkGmBV2AY+R5zpo5quC1nOrwVbbxmukkU\nODGkdQ4LF6gZZL9z9os0GYOVgOrh6TN1vekhSs5P0lAcBv05WUz/+mYfNh22\nRu9rdiSbfD9kZuiTrfX8h6tSPWeZbUFSHesMZypSodnfaNzdJp7QyqTlryJk\ncGPE\r\n=MUtc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnBtj6lQIjdAqShIyeKStW2sigvQPT1wYCV1IeAi+buAiB9HrONtXqr05FV5hBU9d2MOJUXKVwgwEi3K04U8pZ1kA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-dont-hang-after-importing-index.20180526075953_1527321880193_0.877101182872077"},"_hasShrinkwrap":false},"0.17.0-20180526081010":{"name":"@atomist/automation-client","version":"0.17.0-20180526081010","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"971448f1cd38b87b977b177c871f459c9b57d1df","_id":"@atomist/automation-client@0.17.0-20180526081010","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-zqV5JSIatCJOHHtprQiqjOYdi8txEOXztYqEq/QFdrfoOpKqKvaGFn6Hzv7aeh4OKfzdiNqYLzl6Oc0VS20J/A==","shasum":"dfb15a48da60f14aa09975f579a9a8e726de805b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180526081010.tgz","fileCount":594,"unpackedSize":3256898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCRd+CRA9TVsSAnZWagAAB1IP/RVCdQmkgARQ4bqag6zq\nr1dI3u+cvnlFV6D9tbzzKEOK8gjK96ztWGMx6jI4qvzkoGSobQA0Uy5bTjAv\nRvqN6SciCVIDp1vq57yBUphhJmf7ytKPRasscY08POWafRpPrEMafD2kGexm\n+bHciJYLG/Zi5sVge99pIcKeowjYf2rpELxcSOwlyrG59NdK1icL6t/2OCTd\nG2CHS3xnW/x/wDYZLBA/iio+OPv3uVHUtrCz6QEir1M7RQ27ZmsFa7Eo6Nvz\ngU5ztFMb1CG0oiFgXrx4N3xOgW0533+ev1MdKUQblL2caW8DDlsUw1q+Tcfj\n4DCX9euQBmd9B61QGQWJFv4H2T/gHW3iykzhn/j30O1OSS7ltquUx0AI2Ki3\nx/8fbR0F9+F/xxle9aiqw+XDedwEaTrgAm/p2+ATuq71pOPeqRtLQbr1t/jE\nGKbkgFrbhlhxZlfF9mzK5R7AgwjHPD9ZtJ5yYSM7UMgTTbw/3oAJIMrOkVs3\n6RX7JsNLoGYwBa51PoqeHE/dXHm36jyC2OES7Y21/n77VM0j98BFYst8BJ0m\nOXG185+X44yge0xoDfy1zHvZCnNkvy7rFj7M/OFCL0g5n9Rc+yxDGqMUfX2G\nZM9GyrQ1gR44RzAgjOLLJ93MdGstBclpcHVbcqEosu0shsuqA9OpbX6kheU/\nlo2t\r\n=Yel2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhdU2XGIlOfmXh1drUvFEyS4zuNK+VrRdwP3JoI83HYgIgQodlwf0gfQtnINdCecHHNW2NHBP9hgeyzon/gTdClsQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180526081010_1527322493265_0.016701552054828595"},"_hasShrinkwrap":false},"0.17.0-nortissej.error-on-no-graphql.20180527182914":{"name":"@atomist/automation-client","version":"0.17.0-nortissej.error-on-no-graphql.20180527182914","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"1eadce02b703ae28507de76ca27cb492e43d47db","_id":"@atomist/automation-client@0.17.0-nortissej.error-on-no-graphql.20180527182914","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ojr/WwGODChgIqJFAcvuBxPnV4GeC/OMNZcLiCAGT2EUXyp/qIaWJ7JOsqB4jE2ccFbgyM8e338MaYZnAl6lqA==","shasum":"34139663fd44bb0860c39fe92e309be2f0e77fc7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-nortissej.error-on-no-graphql.20180527182914.tgz","fileCount":594,"unpackedSize":3257933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCvn1CRA9TVsSAnZWagAAzU0P/RAh1C8JZM1yAWFsevzR\n/DGZ44bsI/91p3SZY0L6XrAops3wWK3q3o/4RPNoVuLS/QpWgGb+RP9fTGPi\nC2jiN7eFFmZcczx0Acbu2QvB1CYbmlwNV0XiMBKI4iW4fTO1AL2tVPrtFjcd\nyCS+hAvRFL0r5kLIQ9fFJoGLJ9FsgGZuHLxlk232WYP2IguPh1mTWfy2sQgA\nwciseO/QVKgf0Dm91uadAEXwBtNPh3cvLOExa1kO0cfBLT29f0bAy0bMkpGe\nUoeSVsfMH3zKxYegzzjkWAovQ2Xz6Vgnx2LV9H3FMNLp009qvdmU93Iqjequ\nEdzoBQ1k0IDrfA2EJQJqG+DfB58b/FP+JfGw0mVEYqv24aTjFsNxOl8WH0Bc\nnosyS0Is9ne49oIl/QAYrb7gS6IYmqynByY0y6pyxvCWbdu+DwVhtSmACrqO\nQTYhdL/I4Ly8od+QP7z6KFnRw+bMORU+pXrx6XjQGvAF328YHXwwrt47hWH9\n9vKmIKAMl9aZGZ4wiwMWtvNhGBu2c3rBFe8sJYX4KXKjylWhxZa+mNK0e58V\nWeqxl1deN92m7aM3LwayYHSmU9hW0xt+YLdAfzhe/0lWBKqD4dJevtHIJFJL\ni+tarltdCnGNH+chQ/dTNqKEdywWeL+UrpcsyXM1j1kP1llm8Qg33gwlYclr\nO42m\r\n=YK29\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHeUOY86YptUZbE8cKZSN11x8HYdeYBqoMkSYyiJrY/gIhAPU8ZWIn3mamFOQDCRD8lshG0aFbhxEIOnjiVybpTGBN"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-nortissej.error-on-no-graphql.20180527182914_1527446003104_0.03628043685622129"},"_hasShrinkwrap":false},"0.17.0-20180528091519":{"name":"@atomist/automation-client","version":"0.17.0-20180528091519","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8bcd27d9fca5c48354dae1ddbc5a32111f6392fd","_id":"@atomist/automation-client@0.17.0-20180528091519","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3/4EX1qiax7E39DYzx1eggQ07JCPyUwbAv9R6SNzRO9fosb7798XhmyCJmYjTB2GpHXwOCrzK/CgW8h+RW/JxQ==","shasum":"2d05fba6138394ec931cc1bc683d37a77a35b2bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180528091519.tgz","fileCount":594,"unpackedSize":3257687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbC8mbCRA9TVsSAnZWagAAEIkP/jwDsjb4MNzTOj9rSLoh\n4Gg+BsXHkm5XFlf9dhW6x+o7e//vOOrhQyK7EnDWffFaUM5ijWLYkNVACCBE\nk2xZLtzRct6M8kYpQh4eVteu4hviwg8q2/TAXqIlX2cbnHNyGl0Uut/QfPPM\nTULysc90jugNT8mSa6GpxcfGvMJLyQKvA6mQTiSEwxF/128Q+vhFvGFjv5BH\n3fsKuB3ls2wBksU4BMRQ08LKkhIwderVh6OfLlFdxW5y7LnnPn6YTnJqC/Po\na2I/Mkw5E5xNnjft1p1RfQwXqirJQf91wX/Zh+QYRa8ThlaIvxEHR0mXiAu0\nQxhh+wuzi+AQCxEzQ4UgZXtwjwc2k4qOZ5oiCeNSCE8WWw2/q5S9akP1AnHf\nd+Gx1OABlLkP2QgJYgzZucAl0+h175tmPZQMmMlvG4GvKbNgXyLL7zmZ7PTI\n4qqKG3kTVgbmq/jqsGaXoXZ7U3X+LDw1WIOCmvmt9gaJdOTjnPd7OPzA87YU\nFAkJ2EomtPXAet7MKpFoWiUIndkS28sieRjPLRSEe+vRqvlZRlpz6uUBZbmI\nI9l3o5msc3Ni1jMVwbZYKlLbHQvK8N1hA+Bd1LbB0jIcO/9Y41lkapKEvPT0\nN4j5/fc7ddj7SVz3gTPxberMcLuOQ+dWjB9aVK83MU+cFUldHWjy1XAsBv4u\n/rFC\r\n=MoMe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrbx+4+V1QbfitVpab8Z5LexDyhWcLNR0+CBXNAs7J5gIgF+nLCgqfN/9vnYO20yccYnmSnk30qIN+gPq/wzXG6n0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180528091519_1527499162770_0.5426599590542525"},"_hasShrinkwrap":false},"0.17.0-20180528171322":{"name":"@atomist/automation-client","version":"0.17.0-20180528171322","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"44b5cd0c1b04a99cf9c44d80a7753b97f0408924","_id":"@atomist/automation-client@0.17.0-20180528171322","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-N9E45q9VikzxMp9tdkml9ClGtUcSuAxfd2D4CpbJlWVXt7PeYA2rFSVI5vM51v5YKVdVJsLIHS+cReHTL1JYwA==","shasum":"7f2616d0804a3eba49349788ac5d3ebb44230c92","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180528171322.tgz","fileCount":594,"unpackedSize":3257857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDDmeCRA9TVsSAnZWagAAao4P/18SiaKXJFt12HHpHJ/q\nRQ1QZQqIuJVewU5G+E9UKd4aYMQuv1EwAf2IdieKF+SCZ3aTSjH37mLYUBvV\nMehGD/40m149bfFThJF2/sYrUUZ55ymt6g95uw1R3rFfdVdeRNyA8E5damj0\nr3ntDuLw3mE0vjUJ4e2eywujZUyXkulMtt6aPbLss3Twl+/I1jyqvfrEfhj8\n8/+VAhCsalaDHSfRF6DXENqcjxkEOb3j5eIjvwB0IRpYuEU8+Z+NLxxt7C1j\nNAeWFY+jB02GSTN1l7CwSnehwu7M8+ZExABdNXx6N+UuQn6Kf5MYTnJjULMU\nRQXcjzV8VdTrN0lwxXnif028E35Y4VqXjC/MmHOhOqOpe6rC5TEQHMCou2Fu\n2oUjzRBgkZ6ofEOP4uh6TP09mWzqO4X7QLSxQ2ScOcaFW4wZIE61Ik7sRz/C\npBJyfIZWW9q3OH4Fb4R8r5PYln2R582spThEClF9PAfowsiGH0VVNrjADC2M\nPdTZyCPBa00ni1R6Tflm1EzUjZFfQUWo/qi0hour8j7w1WyVsCzPNSV+7qkp\nV38SFKy/JwJ5DxR8E3BIyVSo8jvcgUbw3nfS5fhlTgVdG2rpd+cVaYvsSSxX\nCXJgRckio4fOsAbf2UfgNaTO6ETPcEZwPrHoimx+S4u/ZtZsn/plb6J0+2kC\nVJ8N\r\n=czB6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHb0xf1OOTwIgzVh0CnBf0M8R1tl6uRIxe1ak8+tGlEWAiEAtAxMlUaRlnRA6mxOeX2VEEnlnulxMQTEXQgfQG9/UmQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180528171322_1527527836812_0.8278902620368309"},"_hasShrinkwrap":false},"0.17.0-20180528173309":{"name":"@atomist/automation-client","version":"0.17.0-20180528173309","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"cebbe73298c38497d0c322dfd5effc764b24b7e3","_id":"@atomist/automation-client@0.17.0-20180528173309","_npmVersion":"6.0.1","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jfJ01NW4+gYMg5GkmOJBwF4iGSXmxJevxKKkrzgn2vC++KktosDHtjAVK/uR1Q0boexxmKkQRREtFQeuHbjgrA==","shasum":"e241bf67df2605f8368f5000c55fe3454442bf97","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180528173309.tgz","fileCount":594,"unpackedSize":3257849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDD5QCRA9TVsSAnZWagAAo1YP/0rDI7tg9ClXAVRYd43y\nsCejn545lB2wi4gmbYVNBsjG9l4Sb8WnKwB32vFPWMU+32xCN7Ec2x6d3cht\nwSmwiWsCHPFR+KDwO7hERWEj0CXgDplGMSm0NbD56T/LS7os7OnOfrAWB/o/\n74F5eJjPnvoIGQ0ctpw2bLeQKnjmCxQvmuBzVoCXqFHjG/PMUBneJLLOiIrx\nyQCmPddXUHDTdUNm8egmXvYy+6uZpqO8xGZ5NOywk6+e0mAT5D/9CD7QIo7o\nwz5KyfPCPdSwuUk3F3gOWL9181aNPph+rlxwW7ctTFdVeZ8YpzVvO7Niq9o/\nopUNPti4Ts5i0yix41l/YJpO5ExjhOptIaZNjiSxE5cHrIbc/Zqzq0FXtyr6\nSY87hIcAvp5V/Rqm9M8gAnw6XDUnMv64DLzx1N15a1YipDvzqKfpZpeDlH84\nKrxLRNawxbiWiXT8bfS5MUKYgofqXSvc5MkbGS60yjuRsGA6zEo0XlrgtvGW\n1XvBU0xCOVnaWrgB4WoQZfP7kmut6f217RznD0WUg0ql5/PnpZptlOp6YJDb\n+naOCyfGQ3cE8EuMPzx8cKJrrG5PZJvuIku0fNGShSxTO+TB3RgYDB+t7lbz\npfFe9ENRzW1SOtKvj8ZrSf278fHjVTjFQpgRHEcWebkaw9Eil4FDrftB1U6F\na9oh\r\n=0Pzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsIunNWwflOyG02i82tnjPKPTA2ckcHzAGlcnjtbV/EAiAv0wv5SiQmSipvVABvDBPhM6yhCHdJ7ytg+kFDU5el5g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180528173309_1527529037525_0.23329483841396037"},"_hasShrinkwrap":false},"0.17.0-20180530161602":{"name":"@atomist/automation-client","version":"0.17.0-20180530161602","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8e77c4e6176add90459959de295bc7837c602d5d","_id":"@atomist/automation-client@0.17.0-20180530161602","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xTDlZQoQGL1ySlgvlZ+I58twgsUld3LX9gJVVOSF8xiO+QCYo0rHaFSzmvee4VzCgMaZ4py9q3JAMlSXAA6HJA==","shasum":"e1753a662c56d21a286c5bc42dca96b7a3790423","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180530161602.tgz","fileCount":594,"unpackedSize":3258034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDs9bCRA9TVsSAnZWagAARZsP/1mM6xhpNLPdCvILsWod\nkd+HsE0WhDvtA+BV8d9nZHkndETQLwvhmejgHsB2pAZa5W+DWy3lcI4FMsou\nUT5AX+izZAvgqmWhHozJ+6Spz3E5BGTLVifoM4OoOOo9udtUUT82+x1PH8hC\nyzu/P0Vt5hdOtEdF1h1J+lZ1sibf3upFwYfr24tpETiijSCOgkpxMwZHTTYR\nMMGkSmX2oOi6Iv08OvfdtH8JZa9tgEoIzVQ2kBt5QnyTC4No3cd4we8+aYvz\n0tFCXEqDdyzhzaVlhjvbo9UTJn4K9bgznlz2yGh4ZjM8HWkFXqC1p9XMsAdk\ns27s+oj5x3wrJhsi0b8P8k7btQAmXJ0f73+OW63i6WxXpb1f6JjNYeDrbXqN\ntP+KqQzExynZ9A0HCuh2HYD1UK0iLcFriFonjw3pG5NqUP6mN3C9WzDp+/cz\nAqw1PEWFAp7pTlTDgATk82ocLB38vC7HBVEWGTWDI9+JnLn3M9DOvHR4IKSe\nmBbUAYEG2WiQuy15W7TecqlXRm0CLuDQcWbh5zvZguzYP+NtDVO7orLcsz7z\nOLqLX0/iE5I+DNXnAN0GnSNTKM+BYRZB3Dl12fHw4nMrsazekTqPPdG8+zaC\nJ6fYzzGxHluEl4ZEc+J9avQjNR8D8TPDbaQFrKXlxFLY5Gwd8WydYRUKGvjx\ntEDc\r\n=mjuf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIItVwweKIi/vpM5wYs5Ei+MTodbjrhKs9yY8vnobGLQIgIJ2bzOjRBAuTJFvhtYPL6lLwDWgftElE/sOmqi2iPb8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180530161602_1527697241472_0.277263949985056"},"_hasShrinkwrap":false},"0.17.0-teamConfusion.20180530151222":{"name":"@atomist/automation-client","version":"0.17.0-teamConfusion.20180530151222","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"e48ed363219ae9f5caa144aae69d0e545ad41245","_id":"@atomist/automation-client@0.17.0-teamConfusion.20180530151222","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-V7yerXgrprQORlvuOq0GcuW0S6tINbK22Kycr6ln7AVCySCpQ8Di6vxycdvIyRSJjQ25Uhou7NLo9IcZzkr2ww==","shasum":"659c00d96ebb2393275572e8f4a52d799774af33","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-teamConfusion.20180530151222.tgz","fileCount":594,"unpackedSize":3257876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDs+MCRA9TVsSAnZWagAA5JMQAKULlBsHA8TZ1BFNPjvz\n+dfkdJCmrDC98mZ8Ha0pswsZYSjX/gyidXs9GGGPA2t26yB6H8xTj4yqKNXu\n2nc2CJrqylnImsNc+XgIgetqV9WmO0baj47fEOh+K9CfHKJS+MXgaZy0V8cc\nryfowz5ge6weT4sOwrC2IPExPNqep2vJlJej1GYVZ0IadmsBcUa3K7hTyJnU\nVRCk/g3n4iFG74/8i9u81I/hJngjeegFXMEy9C26yszcEe8sM1eSQTERXaWH\nFCY/0e7Xzy/WeL/EZJasMlQnnaafOLNXi2m9R+nHjk6KoVrNDCP3Tcw8Jt0X\nC3gOpkkZVjQxUxDSYmmg6BYU+IDgw3EsP6e5ISxBdTfM/X1Yi/AGhDTIH0k1\nLFQ1jihhitM2Htyasof1d63kN/d3IGVsIJhwMUPDvyTdCeSeyrTAoQ2Amo5+\nLe7BfgucgXbb+P+waJdoKYpcxu5aB1st1f3NCOB+Gc7YflHxxc+NWTQhnpBM\nmIBBtFPkw+GRYQVAksNGpQ5v6X2hF5LpVnbqhQ4qXMuszeNEgazX3pKHJBq/\nhOgW7lZ+e6vG6zyWozbIdfvBP18S5wqGpTMgisAyNKmu5cHlUwprrRz67O+8\nvoFCi6Lbflw3Z/TnaEcCj2YH+Tr0HxYEUFTAyftf/ESQ4MpQdhHfBKpo3HjQ\nb2u9\r\n=f6Dy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWoO2k2BhXlBCis4hsu5nuKQbXuQpcKN/ZS4Q4Wxsf8QIhAOkje055yRU2cOKXJHG8rxydfY1BTm4NDuZAVD5EW3H0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-teamConfusion.20180530151222_1527697290990_0.9260976276375734"},"_hasShrinkwrap":false},"0.17.0-20180530162152":{"name":"@atomist/automation-client","version":"0.17.0-20180530162152","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"e9c73f0030520096ac5ce630a05386d84395cd4b","_id":"@atomist/automation-client@0.17.0-20180530162152","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4Pruw0v6Ar69Y0VHoSsmxxK+bFdhHcxq2UEywfwur+KkJKYlbl+SQaI356+gHZ7feeYxsif8ng3Qo2Bhwq1b2Q==","shasum":"27df3cbe5d596eac937ba5c6b38f227141ed764b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180530162152.tgz","fileCount":594,"unpackedSize":3258047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDtCtCRA9TVsSAnZWagAAfg0P/RUrI0eZHf6SBvHn9f8l\nhRLqQAQ41f8tbEnbJ2eEThEo4/YM974FMabwo3hVI9oqqhKL80EeJa1qInbm\nJkd90/jyCeyRs9z73w2/t+Gz9k6ZVkuZDU0ZznN3wp/a39WiV3sSW/fAARvf\n25qgHu1zo47QQ3xZzhlCt+IykZ4S0MUUN+Y2FK3cq7LutFWNMWU1H8x7nVQM\ngGGJSk0y8veSLe3dAnPi+8D+YnF3B/TPnXerRWVdIG99yQJgs1J/vt6sF2pb\nTwPvIy1Nkz+ZVp6CvJYdT8G6ViXm/lM5HaXicV0V9Rq7/52eLblplHIGUpyw\ney738AlJBVC9HH7kaEtco3msKqagbYdP0z4f6bR8TVXIsrHQQEfBWgozlAAk\ngra2efBGeA/Oz2dI/lTYATs5WV7soxEF0xYLrez0B4hHiJ6lFjgvcJIbtQyD\nL2cLyzsPcXaB77HHGCGLjt+WBoD8YRSqChRPlGRJEgkMOTTs9NGrZY0c+SYq\nCD/VIl439MMhwjjum3hHjLNsPiHIzETg9ksrnJ1EePs+dSTHa+YQzpbGe1vp\njDPn3RSYV2m++g7416Ugfs2fBS9lkg2ec63h1AczHybmqdxj9CtGdTAf3eGM\n/20OqRxJYGlwdgVP4jVtIZda1JE/0hQqLsoEWLQ7sw5JxFlzThHj5HYxYEzY\n1s8C\r\n=VtjN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGw8nhun2vpIIkkM89RWY5bbazknmHMUnOATzph3TfCDAiA69gZctAMah1mHRYF3Y0k2yDsF3JvAie2TxsASRulPig=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180530162152_1527697579984_0.6541239641932439"},"_hasShrinkwrap":false},"0.17.0-20180530163901":{"name":"@atomist/automation-client","version":"0.17.0-20180530163901","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"b0397cc523d0e8346f00ef181a2bd91282cb7096","_id":"@atomist/automation-client@0.17.0-20180530163901","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HkVpTdwqIE6FU14UZxLZYOyUuXU/DVUiuqFoj1Fq90Pg6KXpomdvRmASyFudlnQ6RnxrxZ/pi7n6zhHfP9RyrQ==","shasum":"4599ef6036e6761719969fe68cde5cb82ae60894","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180530163901.tgz","fileCount":594,"unpackedSize":3258075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDtTMCRA9TVsSAnZWagAA8ysP/iAaVOwcxFseX6oFnH+y\nqIYA5c4/cHdX6SHvJXcU4PEMGtaRwmCsvLrX9C0YdwXl5CKptkdY9Mn0Uf0y\nxYeKwkVksR5oI5KekjfN4phWAw9qkjtg2ZIgmVjXS1A5IEw+cShtuvZx2+w9\nNAaLda8UO6GAtgjvnA/Kme67PI9tJKDx6FpY1lkzs5ccnaQNBZBFiMy2GcjE\npkQ+JuoPHBYwP3C5Abd2cSI7/GT57o31umSAiC4Qmeka3cCuyxW7QuOYigPi\nSN3i1awd293G7QdwXbrTlZsalL2YXVLyMW580GKpyWEbPq4JXTjQldA/uvfM\n2TyozuToaXiD2RJZ/6jkaa7kDuotHZTM5ITGAoAWTBeVPDFxk+YvS2bxq3u8\na8XKwnKC8VcriP+iIbwYGaGq/gx0VwjKeqZoy3Rsh5v7UA7fytdHoJHkSMjm\njTZz7GMPvD+NUlm/GCWXMpHw+WktCOqd+aoibVOkTKiNWCurpYprmsq7nm1N\nqzH721Wx0IapCVByblkU6S28VyuvL6K6vlfiAc2TsFAgD+WfLhZPcJERA61r\nfy/m6JhXXZoW2rO7qHdgcPpolm1cJJPWYG8JISWsvCkbNKjIZoRzeaBP7oqT\n+EtUTkh9nTyrvaZKIiD/AvsROVssQOdDKxnLrX2wmZvucGCWfSlm6WF0d4Iw\nKvts\r\n=+dAF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBlvDPWlNVrlieIaVKzUuc3gZnNUzTc9zkTX3HVHwAneAiBa6/DmODjh+gxzcBX2NsSLTE9pEqhfKVIVuvixYdOv2A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180530163901_1527698635342_0.8511382548824866"},"_hasShrinkwrap":false},"0.17.0-20180601134431":{"name":"@atomist/automation-client","version":"0.17.0-20180601134431","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0c93bdab8299894c3b624a68eaab7cd48a96a4c1","_id":"@atomist/automation-client@0.17.0-20180601134431","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hiHF4NadqRMdKEHqcko4oB8igeszZdeFHRUbJ9MC7ZZxm7ssXikTD9tNozshuVGejrRgi2NAvK52aoe0KW6qSg==","shasum":"cbc3d731087759e586a270e801faa69b0b71b4f7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180601134431.tgz","fileCount":594,"unpackedSize":3258081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEU7PCRA9TVsSAnZWagAAfNsQAIFlvEZtKlSEBkVi9zGn\nyaKTJW+XEjxHZiglCwcCMKT3vxpM/ZMDZr7hf4JbSxqNt689cDbpCqG6N2Ko\nOb8frnCMhlkAG+tlW1xDYl1aDepV78Cfz3VV4COVgMR3CiKml5a8O1Si5IDs\n3VpBWUGIrZ7k8iQtDEiwteW2eL7WJZE6WFfi6gBkJ640u6QmVThPw0ij9p0k\nJRDyhr9vmbO/9jIlDpvjLBNE6lMPReIzItsVOzE7GHl/DCAh595Qu+H81lO8\nK3cof41b61oBosGrKP2O8emQsSxLkki7ahHY89VOYg1AKjqJmHsIseOtVTgJ\n1bP9xOwe+toDwR4yrFWcVtMpnboY66KMe3sgIYpdcZYN2sgoB1qCSQf980Pg\nlxuvOWFxg+JkMgx0KNlHlNL06Jz2vEXrlwGpMTmwJnKhYF6cSmhfMY9WR7ps\nJVgPzrgB9zGIyTT01WSkcahaqLGrfIzVLLql2qMW0rAq0v5hTPe/VbIRImwy\nDFRpsoKAKWI7pd+RuWj3jM9bRjMx+f4nihaGANfWLDJXDWTg0QxOYDOpEbOi\nw0k+F7e+Zr7Iu4zv873Cf1cKCQfyCncszTEg9eHYNV0b4BuEt5SROStg+cdN\nmx7qyghgK7AwsMjfsZvJG37QwzCNXc5+q9zzdz7Z7mhLot2nNGHzmqA4fALs\nk9Y3\r\n=YQG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyKPRDPKrXmVGhexU4zQLdrssfEqcDHjRSdJUWUnh7EwIhAPVYs+Hp2RgJ/nHWVd48a1vm43ml37gdraLxewD+NMlJ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180601134431_1527860940997_0.5700705990887835"},"_hasShrinkwrap":false},"0.17.0-metadata-rewrite.20180601155727":{"name":"@atomist/automation-client","version":"0.17.0-metadata-rewrite.20180601155727","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.7.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"86b0b38bd1688b72adc8fb3319aae90f523dbffe","_id":"@atomist/automation-client@0.17.0-metadata-rewrite.20180601155727","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-H/67lPEbsUZ1jpERmsqBFmZ9fX+4SecHAV1g4mDxR/p1HBhxxg8UwIOqJsS5KL2mpfDG+H8iDzhlz/2cr6iyXw==","shasum":"bcab343f218482cc0daec0dd7e18a6d32c8bd766","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-metadata-rewrite.20180601155727.tgz","fileCount":597,"unpackedSize":3259072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEW3mCRA9TVsSAnZWagAAzLkP/0TIQ8Su8fJX2dkVYhwe\nOy9Rp5OTgDCVNJ6et2pQ+qdJkXLJi4s+P2tvhyZ0LUzRZGV7XoA2moe26Omy\ntgaMN/zkAUhiXzzpVwBkikbZxB3MrBqzUrEtRxjcNk3UIIzJzbZlF9ni+aZK\nVg2xhBNmbu3Gxre5gF6blPX/0LZvwHtPWXuLXJkFJkakV+BtmboQv2wJoFLZ\nBMzQmReoSb5c6eTp3nAbIpIfw7gr7D2lE/OKnES+Rq78mG2nymxP9reTqYRP\nZnMTi0iEFfOtOmefAC++LFmt5LL13dZmn1vXaMwmqNQoVKyZc2OVpkc2GWee\nWHhuz+bO1lt05Fi/L9Q5nH9EUKaTzybSyyMPaRcR6A4JGpk5nXPfjRqd9kNn\nD4jMHf3OA9CRGkN69/l1qxnMTDvfEdm4PrbQwYiIt90Ch3D2wewIUVS0GSLa\nzd3Xy4Se0RKtTAf1wNj2mnqMi+YCiKJupfxeh+kg6ROlBtSJ9efvXK1nHNtk\n4iX3nQb+EAmiXCTaQ2Qs8e+U7ORhigfT79gGwy6wm7Dxdrn3SZHODRzOyaQd\nazCOL1KT6JpIm0nYeUme1dRIVR4Nd2Vpza2Ag9kSzG5jxmwK8cdLN+vp0JKO\nIoaUB0Pgf3foTk1Tc1MCl9qNSaDJ8lzIiUFEemiCnreIsQINY73HpcaiQJS2\nt655\r\n=pckC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmSjYE/5gQXpoKatDrNqMMcrGEsnULYcEwKSbvSsVM9AiEAteWMHwFBcMHU1HMBf2UnfwrN8T3xRPjQD2Zvu34liIk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-metadata-rewrite.20180601155727_1527868901193_0.8625098879480182"},"_hasShrinkwrap":false},"0.17.0-20180601160201":{"name":"@atomist/automation-client","version":"0.17.0-20180601160201","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"bb3196c2bb229eb69b3ec740d1a101b7c711abd7","_id":"@atomist/automation-client@0.17.0-20180601160201","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QKzg+VEieYgmhIn3nTfBu3rHxsJAJAleHUXZdZsAJljinNSOhKUUaLatj1Zm8+G4imgNm8XGB3IvoYpc+qToPg==","shasum":"e1c11768d24a556015006951c1503dd7ba9fdc97","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180601160201.tgz","fileCount":597,"unpackedSize":3260637,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEW75CRA9TVsSAnZWagAAWtUP/1VM2b0T1Uolcx4iyyJL\nnyG/5hRzHnWSJOUgDYkpCQmSag5pvs3DCb/Y8M/MbqkmAbIteaXkdZu9LJ31\nmCl/jrYpBSY9RXhg0RvjpxfJzzqYRHfEHINNy6zCHyghmvRM2QNNl9h15OkY\nBEE4C53i/P1oZs3TGETA9NpG/yV3IYL3g/YKV5jFWgUdBB7S9dtPkYHzFmwS\n1gYsRsxMFyWwZMd7HePJPkCCOHJuJkUS4HVtWjsPReuMHiO4M31fgu70RGqd\n7XlORxFc8aMICFabns0XGvTKRg2eMbvs2oPKcjZfAY8yJ9HaLVZUwygHypiM\nMP99nThC8Z++kO4YKbPqkWsqsb5jVO8s+BpOErWwm/6x+0a1HY8IvBjNgMkx\nYnOA282nB3UJXQ8/UGC83A1YVWMs7puJBqaBeoasyB/L79rSav2vaelNmtiA\nDjorLed6GuELuFLNQ89dKmaz2GAzl+2IVm6GsHTjRRfBTLppjMDI1tNG2F5M\n6XTrDrKIAu6aXXznmX8wDQ/6TDwr6IWI44pZHGHMEXDAIVtZjqhtM7LW5c7H\n5l4evKc8veqpTtffuANPfZiFhlMr0xLFU8+dpCffscNY/6omW3XJmYSuxdDp\nfTZOjQnIRFWr7eVDMKbIyVDx2DaVx64g3jbQtnFQQMwqjE6z7UvRtCcXPkLf\nWqBK\r\n=Iat0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX2uAWU9qRVEy3Vm6GHaisj8ho9TclPorKwdPHAkZHSAiEAvtTuK15/rcD9S/+d0hkWi20J439jyOTn1H3gJ3q2Az0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180601160201_1527869175449_0.5343074127485108"},"_hasShrinkwrap":false},"0.17.0-nortissej.move-remote-repo-refs-down.20180601193745":{"name":"@atomist/automation-client","version":"0.17.0-nortissej.move-remote-repo-refs-down.20180601193745","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base64-js":"^1.3.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"775c4816539bdac87198b4c26b821f1ff36a2cfb","_id":"@atomist/automation-client@0.17.0-nortissej.move-remote-repo-refs-down.20180601193745","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DfXJ7KzP+4td77+4o607LTNc8Z84tP82KSBXW+Sr8uyy72QNrPXg5BeiFCH5dxK/noB2lV6UtWmF7Yyz55btRw==","shasum":"c77a831e5b7b8437e1c6f966fe22add408c8db31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-nortissej.move-remote-repo-refs-down.20180601193745.tgz","fileCount":597,"unpackedSize":3266301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEaELCRA9TVsSAnZWagAAtwsP/2XNSsPSuF4V7rpXBNRt\n/sWsqeCzv9iTy3/JhxQl69XLBMAL1vumXPmDsLEgnxaD31/0f1Gh2/0DA+YD\nqiDjdbYYPwhSwakJMBXyTLr9k2TKrTyc8Pfr/16tn0B0Lpdt+0gDPhE8w0zm\nidnn3SfGc9MbvUQkpp4fzkF+sDwtKPOmyKjBLwG1Cd1fkl+4tAb9lZw8tM+p\nvGpx2TZktCjVXJnfMcGh3hGVnA6paGzbVQR0ayZilE6UKPhnsrP44QIq7KP6\neP7/p9JFg956lTW2QaekTmW3+gijxmg8iTipjE7PwNPBz3MphAxl9FCvlloY\npeIvnZCcL6R4MbZeGBiVuwbFvc0KwnInvkveuBxFVGE9TmBcYV4/IMl32eiI\n9SI0/dI5w0ra/RmawbO/IH0/T9BA7i9H9FNrOixUH5qoec4uRkidWX3dCqBk\nDDgnVxKqUUtX+9CntOKmq34bTbwQq2NqSu4mEcAUk+HFLwehEH2VpThw5vn3\nJM+1Bn2JocuZfENodrinN6dlxCmRYjYqBmjbP26C/zv94sULEXu+hR0eKgQD\nguhs6ae/NMcHuSQlX59V1fgusJwUfpkSJ8WwUxXiK/n879OLpaidotDHVazg\nhwaSj00yBZ/x9j+4SjcObohovI4Fbvklq8MEi4YadjN7uqaUo7PQq+aenf+W\nJcv/\r\n=L/Ao\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbGZd2z2GgZEkE0PtBeBkHfDlrd8DX9C/LnyAME7AbBAiBLgNiKY+Rdx3EiAoLTOa10TuxPWNbkJXyNFVffYdlwGA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-nortissej.move-remote-repo-refs-down.20180601193745_1527881993495_0.9896074106449724"},"_hasShrinkwrap":false},"0.17.0-20180601224631":{"name":"@atomist/automation-client","version":"0.17.0-20180601224631","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"38826b4eaedc4c9afbfad9ad2b94ba60e9614932","_id":"@atomist/automation-client@0.17.0-20180601224631","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qlhSK2wofsNnMa6Ro5L9g8G3+NQYKw53OCGoXPajxfhyKE4RpFEGli/wXYPMtqy8AOEK6iFWEJO+F5im5vINtQ==","shasum":"043120180715edd9ac79c025a982b2af2bb21757","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-20180601224631.tgz","fileCount":597,"unpackedSize":3261396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEc2/CRA9TVsSAnZWagAAWxoP/jefWSokVf9RHIVxm1ao\noyYpPpzN0/0nUCEO4B2FRdmzUkWICkvU+NvnWP9cznuny81l/fVhg3YMy1eo\ndBOfQ/OL2Ovj9x7hho4KIp4NZZnwugntTftfnzGRCsBDdF+POiJQoqa//KuQ\nHHpIHYtY9emclq3fY7tTPF1DsaVHPedUWa8tKQlT7pds+ICtrbxCRoyoeZDl\nn9rXV2gddRHLHvOP0y9XEf9YqdzAQSNGKNs1igJkL79YFt+4AIAImQoF1csM\nZXT7Vj2/he2+ub1kdmfM8RhJh5qGYb3Lfb0spx/BseJhp/z6YOEbT/pwdVD+\njN337w6tcnJay3+5WAckFPOxPqMw2E9fSaPJWz+r1NydRw3q1dZUIAzeGSIV\nI3j0sV6nJycKEABOIK6lAfrTBvrKquTXRIrIdFKra5x5U1S8Vs1BzkQ4xADv\nVQ7hbD3DaUSerZXhLWFyPYs06xvk/E9BwuU4H16oQOCFCo4GoyXmaIiF5HvY\n2RNmL0qAAnGl36piyla6qCb21NMfBMLs7Bts+ojA7HYS7e8YD1oIpGJBdWOI\nElrLdnW4t8nDy1GJH3VM2WGIIWPXL8iah8IRDH9NHmUnDwMPESemM4yUKUgW\n6/MlOVY6AF4bSAdaY7vAlGudwrvcxjpMtAorapJ5JTHmuauAq6nUNnTadwck\neKME\r\n=YKA7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa7DRdYhCJYY9eAsjJX+iPt24rQfd2rNFTOCYqq4b18AiEAlh6JaU7Ylr/ydazM8jlsRzPrtmMlK1+7b3veJoK0rZs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-20180601224631_1527893437522_0.18981604754057635"},"_hasShrinkwrap":false},"0.17.0-nortissej.move-remote-repo-refs-down.20180602151423":{"name":"@atomist/automation-client","version":"0.17.0-nortissej.move-remote-repo-refs-down.20180602151423","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"a83b2653798feaf99b67daeda9ce1ac3c78cda98","_id":"@atomist/automation-client@0.17.0-nortissej.move-remote-repo-refs-down.20180602151423","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QrWWtilb/tCeHtdEpKalcwKguMRtPRrarmwtZyKwv68WgI1PO4snUk5cyJjbV2y0les4Dud1EfPN3LYNlw1Z7A==","shasum":"35b07f43903c2c1418057d46c68c5b5d790afbe1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-nortissej.move-remote-repo-refs-down.20180602151423.tgz","fileCount":597,"unpackedSize":3267184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbErU4CRA9TVsSAnZWagAA+WYQAIXAAe3cYamFhNsHmXOd\nbekSRY4QJQNzJH/yyhBJTSMbn1J/JsLf9rG5yZhKrERk1O5bplKduBTzGkFL\n+MmGO+pVOwgreu7jaGh8vGMwj9n6e6FlY1jd53G1BzXPllWrjgcNIfCjV15R\n7qoPx+Xrz4lnYze/LboXIlZ2QA3ckqxIWd7TsEG9lUj/B0ernFMeiSaKpHEs\nwQ3TmEQ3aGxidAlgMgzcPaX7qw6qo80BbIzv48ph+tsGlb4ZHqTS+IkNejqd\nzBjv3qHYalPduaEKc3zhEgG9qYVGprAy49EFwVE88sV/W/XQaZ68G7JW/6Y0\ngDQdUcibtIS2DIB9BzTEBA2oXm6npq3MUbr/k5yCKyvotuz+WMi0WwTiQVSp\ngGNR1EWigbjpN61/YSWUFHuZ+/vmoLYOc0r8SbB8ZaGiK23sNw5rhZ9QJ45g\notIe0kOpI4d7yNR/W2M4RM/CziB93s0n48LeMwZZopQpt0kSE/3oPR38p/hh\nFZ47v6yopoLokxMaVFGdQa00Rm6PREDaM0QMMExxZ6Seqf+bBM+JPCYwTHU/\nVMeHvk5stIe9Q9QLKnFsFx15lHUJKR7KNmro4n5lXx6E/Ywu+ly5dOId3ORf\n4+fdNLoEj4Eft7VGGux00Yxkt94tb5ujErE2uLjeeLFLpBtfPnLP7NBOrIWk\ngpXl\r\n=Z+FR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZSaQc024hS7KnXcXD9Q7hIPECtspMygtKAFW0r2zMTAiEAjumU4do5/NKObCfEMSVkHBRQ4Jo9/67HWk3f4eUJO3Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-nortissej.move-remote-repo-refs-down.20180602151423_1527952694471_0.957638186622636"},"_hasShrinkwrap":false},"0.17.0-nortissej.move-remote-repo-refs-down.20180602160508":{"name":"@atomist/automation-client","version":"0.17.0-nortissej.move-remote-repo-refs-down.20180602160508","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"d9a82e5f2b201c345b45aab43f7983b617a92911","_id":"@atomist/automation-client@0.17.0-nortissej.move-remote-repo-refs-down.20180602160508","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-D3DlDbtDSuce4pzPVjxiVd6Ws0pLRiHtDNcfSRXebBL9yk0/D1O24JCpf/IcAT2oA7YL+DfLP5TpfrC2hRT7Sw==","shasum":"0ab3e1f0385f9ed217ec0a355113114a6bf12464","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0-nortissej.move-remote-repo-refs-down.20180602160508.tgz","fileCount":597,"unpackedSize":3267184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEsEuCRA9TVsSAnZWagAASCcP/0DeacxWxd+0eFqmzDon\nr+qbg1/PK0zos54wUlkLtj/cWPdHukS5YmdEbqLFgRDAeQPHqLY02I7wqhrZ\nNnNZ16omCLzNqGqePqW60QXVV0mqoHNUyFSW9bbHPwzm9iKU0XYv9DiizMW3\nGQEIGpGSjC+tmivTMOCBMD8bBMvfZLAbhIvlgfCZMOkLW/lMMuxpmu8RrE3w\nfX1Sih/Pek4yu3Ir5/68OVvKeuDA+V39aGC4pnwU7OZJFNAqCxCn78EZH0DD\nCB65dvwRuZfZnIaaEc8dT/V24lwi8lmi55pyKo6JjZQ63nOQq/cLOpz8mIMw\nQ3g5ofuYsXpdAWWK+p3fAV7Kq3BQ4GXbLXDyz1hWesOYfVnRa9QF3/UeANa1\n5PA72rdFcwryZp00YFErrEO6jGIs7K9MgY+N5MXqHs/WEaDD4OMfl3rY5Lgy\nUqCenFCgRS6GAJwN/PtxdkvEEsR4Kr3aJaD3EJv1vAN+tQP1FhGEGKTrEYfT\nuDGBXxAtEAPmew6S74Hu5fnkQVtDk3JUChC7qGXuEOy82x0eWJK0BWMVlZ1Z\nWp+d9ArbPsP9IIH5xFW4pjVT7GPU+9x9gfTmDgO+afHAjc7muK/9LcBGW+ZG\nq8eZ75sdEpq9Mo1/DSO7H/sQ96W/bMKaMy3NT7YSRow/iHIAqekYkYLmJ97N\nhyml\r\n=A6Kp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChrRkkYL6A9Sp4IEkQemdKzbyB6sHeDQm08tazrprlNAiBhbZlaBF4q1ICpunHlUXHtTkuL/d/Ef0o2zSuwyC2cRQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0-nortissej.move-remote-repo-refs-down.20180602160508_1527955755971_0.8132345429874155"},"_hasShrinkwrap":false},"0.17.0":{"name":"@atomist/automation-client","version":"0.17.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"38826b4eaedc4c9afbfad9ad2b94ba60e9614932","_id":"@atomist/automation-client@0.17.0","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-H3S+vgtoZngvr4AqMcNSlJc0oarV8x79cmJu7iHRdYcWKgj57M2YDHWFLOfbalh+zCYjPbNu8HYDyKxpOlrk5g==","shasum":"109bca83c648de4a331b603b03306d11dad5a9fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.0.tgz","fileCount":597,"unpackedSize":3261381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFXZGCRA9TVsSAnZWagAAOzgP/2GK9fF1ZtOWbIsov/tL\naogduGrGmoIAESytTU7QSvniegrsMv55BJfeOZ8uYzRbvFNfP2ngQ/6Hp99K\n3FJEpo8hAsXU+qYTGcW2j9W2KNbtb1ObrYoFTk2kE3WLVLD2fkWFQZbF2tHl\nFoCz3ZletymXPmWqjz8NY+rkC5DjYmXxXbn6SJBUd3ToMEpqbWlB5aFP6WRc\nGLdGhrF7J6lwG9LxiPZdiim2QzWg3iqd9wxW1Tez+HUtD/pBNRcxLzHPzeCy\nnNuxhP84bVLa1+62MUw+9Zy3lRg0kWkyYOYJAry6XGw/wvNCujBja1Q9ETgp\n8uREYhEh6EgwS5Skf4hymh1xiaIzGFW58XlqXAgGAjrRjmaU4gZ/1PKzQMKe\nnKqFPt8IXk7Se/43RT5F5Kzw5OJIooswavNxqSmaVGbx+eOUQHtl/2wnZMPY\nwIu2GImf8krJmzsvz5sSNaA/l1ffU64c8dIAzRJ/eIepr/XWQKM3e6vkdxAT\nDl2hwt/JFuxgrr0RxVlJQewWgkyh6tE7/++A/EOqtgn8ti8nao+et3+lLTmW\nUHqO6CtFJTb0HExjugZNfPuWJFHy07yDTeZGhsku0wMerhz3p/0IBxPUbtBx\nkaY63BGfWhwOO2DbS4cCuknT5ll/N0F5a1hS0cfz8kg7apoxy/jrwoI+u1+m\nWOfM\r\n=3zNy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdLzDW8F93XuLH5ezvb6D84A9QgKeRLCzU7Q+K9JrtfAiEAp2kmneSQ0btA2Vjy5BkO1No7Q/vjWt1qnXV6Sq6Lum8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.0_1528133188429_0.7847466966597296"},"_hasShrinkwrap":false},"0.17.1-20180604172725":{"name":"@atomist/automation-client","version":"0.17.1-20180604172725","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"26411d29c55b8c8f25b6fd0f5411857774e9718d","_id":"@atomist/automation-client@0.17.1-20180604172725","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1+YJb4SNufSwGLi98Oo8/E8T06nfCE1UywOPPrvdIMU3kRuB3PLIqrrS4ogSm51BtegO9U31mA8dJ/7xfClLqQ==","shasum":"c6dbc2da37fcbd3339ab715960be6393da89ea81","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.1-20180604172725.tgz","fileCount":597,"unpackedSize":3261396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFXd0CRA9TVsSAnZWagAAgPEP/iJqc2/LPBIzFaTTRvsI\nqNLeJhq8Jk8YBvi/By73Nhj26RH/vIorvVlYUrtU0FMe4u9dlqkZ1CfKAfpj\nZzPHCVCeMG5xEtErlKCe8wJkl+kfRHr/jdy7CmU7OOGxS+ENy1FdvAk9g+GB\nNMU8ZBHWMCCjuj9n8CLUkeaNP5hsY84tLWU5w/w7tfoSYWCyqq4X1K7mr0/F\nbR0ihOPCpoBuAY0PM9oIUY/JJDA4C8g65TjH5SFnivXkeoUmy7vpRf4kAwxX\nhOMX9DgeMSzwPd6OtUxjdyiQl1eBxHOTrQn4ezzDCHRTJHMu5l4X4Xe9QerV\nf+GtrnJnzP7j4orS19NveZrxIgwoHx++xpgWZRSXBPBa9P8VLPXzWzUYgTe1\n/Pzcrmj9/nyeUroapYBYsS7usmjhsTJuVMfKIyjwjGxa+I4yxxZTs8wIsqCf\n6IQhdY6+UPY+MqLibddltXm9Rfz8j8LaQI7XAeXgs3UiS0qpRRlIwfh/QBYd\nFsw7oHOITgf0vOZFBUTGDzMkOCd+Fu050WjuTf52unbW4CO4v78CE+ljmvL2\n80yq9NzO4CE2EDgWjuBIIEFPQf9JxMuFFKVVKWsvtweNS3i4RMnFla4KwLW9\nvZY4wB0KSGm8djMlZL3mjpDz0eHB9gkd/r0iJKQjd4mewPSkftIshz6Nd4k9\nnODf\r\n=raZS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk6MopTKbLpj7lBSEbY+3QNzSPiATIAh7sp3BvGybZjQIgEdp272+uK1lzB3dIQzWPkZJhWOBTzW+S+DJe4boF08Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.1-20180604172725_1528133490153_0.6533162107037269"},"_hasShrinkwrap":false},"0.17.1-20180604173623":{"name":"@atomist/automation-client","version":"0.17.1-20180604173623","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"aa93a6efa886f4b8501c7764081de8e55d8fa365","_id":"@atomist/automation-client@0.17.1-20180604173623","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CG0zleUJPyE2ClExyK7/chK6Mi6wiLkXV4LosAWHbvNx99TsrF4J0Wjxsi9LZ/TNF5+3hlkrRqww3z6j+M+fcw==","shasum":"370f1dfc6d9e3f96a29918a61aa480b5ed648154","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.1-20180604173623.tgz","fileCount":597,"unpackedSize":3260936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFXmNCRA9TVsSAnZWagAAGW0QAIAvujEEKhxZkgDWPfga\nqg//0qql5hnZyzOzEB4pScZkLilwERH+tnZ8X373yemEbS/5PCYQBnumV08V\nTbm6y6OXLoZ45Hh916QprK5KuSRXM9OaV5BnEqogAuS4+j2q3xcmZM3pWHwB\nsbeal2rLhjtZ/1KYp+a/nT3w0dd0EYbmwmQrfdtLPHsRpe0g7Kg2PLr38l4P\nVq6M2gCeV5UbTk5g6CM+iPh7RzUNl1P0UFDA8PG02R6ofua66tTsqP/jojd/\nGhD0GU9Au3lUR+BHA7Y29PPHrAqM8jCde3s5j/axazaqxm1PdTMn6fS7HQwp\njbkOYvuEGybmu3rL7lwn7gAdN5O7hMoYsc6DeM0um0BNefsXZXuZWSvPEmdX\nvsNKqORVz46pTFuhCja5/nX9bLhxS1WXk2qv2jziIJPCgUikpf586a2ixaQb\nZXABe8PtzdWTPLUa1ZqzMZKzf3jcwDUEVvyOdUAp63xG2RjeLBrf2g/9z66K\n2FN6jIrsGtNCVwXpOmaquzff/zc9Q3kujUS7Xvb0lf/yHaEVlY+3paSb6Yzt\nC6lesbg07eivzhhQtGFOyJvcfesdXENZdrpvMKQLfs52SbpVrfBDinhHymGR\nEWSmWzKwjt2A8cGaySlQvL9exYVO+zynWNllXL04tokoiZOEUSQJEKKORfRa\nX1e0\r\n=T+m1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDezt8tTQSta9qEDCUCJxiWnG1wpjrfp1ewYzcQ4wjr2gIgctTwyr4iV1oOghSbQ3+BvIgtjj8vk4mtWBOJGMABZZE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.1-20180604173623_1528134027963_0.8394348622315919"},"_hasShrinkwrap":false},"0.17.1-20180604174106":{"name":"@atomist/automation-client","version":"0.17.1-20180604174106","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"34bcd07ec48e3380e322a144ab62e8d587dd8982","_id":"@atomist/automation-client@0.17.1-20180604174106","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-83/YQeWfy/WSt9DYsw/AUwF4I4k2uPiXJ7DR5AJWqrgzBXoUJU589rcjx69VlmWgCY2HGKwWzh2DzZqDHu49Yg==","shasum":"7584f468fe1f96b4b80da9f6ff1e0beea4c0006b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.1-20180604174106.tgz","fileCount":597,"unpackedSize":3261181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFXqnCRA9TVsSAnZWagAAWxUP/0yMUTnoFQhtJn33A+/1\nqrZPnFFZTVg4SdoKz/d8rdv1u/LU3XF9+OIYcM8heDmMfcdkM7kdRScNeSvj\nOna1nm6awEFJXcfyL/Ecy2u14qwAm1yeTnEe7GC5OUo/sHcDJWPw8h/c/fKZ\ny8ZvTeBbUEcQ03uKg0ViZT6pUyeABnvFIIgyOSTUwfvj+/bwOsX0hw3Db7vD\nDawDPABP3QyCowuAqX7liR4dCWB62l+w9eZjAc/S52mMUNfTYtuwVZk27ex1\nfpQ3GbA5C/ljLlUFsj84iobCBNMD3EhDlF8tjT57O0vZ1KKOq/LK2WqMH+ry\nN8ZxY6BywXZRS3VY2DPD+nwN/klZIVnS/z0KIa5RlAr7Tt77IubjBZRMXeCH\nTZgLYjZTyWnRxfTp1HKA2kxRn2Y/yqwfqE4mqeWmXz+2DJwkpwJMSD99Glet\nycyDhRSrj4uodQ6US/hf+bgzy4AEYGo3C7tFuPxT0tx6k1heUwkRNpnQ11SE\ndmzDgvokArO7Y2x3h49VT+J23QFxTx40XWcEl1pMP9TxfSN2x4gkFqwtwajE\nQD3jYcspQmZ27reOwVV6FfEkWPe7ZTIIApMElckSa5c+eeG/vWwqz1TV1H2c\nICMm6DntrytgCnt8Ft8K6W75LIpFhQWjAskqTjQlds8S6/zhN6X0/moBKv6Z\nPc0/\r\n=387q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDW80J0Xo8bsttgyQJPWpePpA/oNjTh2HtYyeOmivxBAIhAPrxEK4XZY+75bPKB/CnW5kcJ59vfOh3e/ZRiWAPj0Su"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.1-20180604174106_1528134309802_0.124397270983293"},"_hasShrinkwrap":false},"0.17.1":{"name":"@atomist/automation-client","version":"0.17.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"34bcd07ec48e3380e322a144ab62e8d587dd8982","_id":"@atomist/automation-client@0.17.1","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fP2850YmahMNA62Zi+n9RS7JRpqI31ct6kkglOEYczj0TJKhzejTHKghCQC+cwY1jIG/GLJxBerFYgMZeOCh/g==","shasum":"4aef68366c99c359c41f685585daed2b94f2e032","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.1.tgz","fileCount":597,"unpackedSize":3261166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFX7KCRA9TVsSAnZWagAAAl8QAJfNEGGeMQMWHCF404Kw\nCW6y6jSWXL/P4gzyjv4rKzBONKEHs1H1SIj5ZqV2TudpgL71+J1AoHOt4cA9\nSYsqSQrjqLN7TUOoJL5+W3/rZjrUq6xvk8ZMNHs1SPNTfYUnFK4oCcyD8Nhk\nnA9sM1yds9tQUYjWPVaJGl8awRT7Z12BUoQE2uU4Du1WDpq/6UKrHpflAUx1\nS46hMsTNL5zF366k2YFC6ljqlhwoelQ8jZIr2fUUTzqvUeu+NteMwpYJYooE\n2QPg9pTGg+6eG5+wpTVgudIlOfvUqBssA0NHedZp097LNyGeGFL5BMLet/gF\naki4x2KuTbnx9XX+0v23t+wqDfAYw2DcArfx9nwms49J/yqPi3kETNDKa3ap\nj2VKzaGT2YRlVaiGWIJFjZBSOlXHGhGLe5T7EPD/5JHupLEsfpq+QNMhD7Bf\nCpd/GgzK+pPsmcYHGU82A8jWiKj8OfE15vLMmD7kBrBQkyZUufNd1hOjKLpz\nxeAJgXtO6WKyE852VAdCx1Cv0k/9OqpRUrxHrlvMLCTjAQWVlV8OQoRun/yR\nfNCHXY790oqHAfa7ECwdp+eI6qHYhSKghOhhX7CoTOpIsgunHH+Cd9NSz072\njFWQnS/rxRZQWqjSMMtqVr7lpTcyuj1r97F7ngsTsaXEtVR0EZ0R59sjuypL\n2coT\r\n=4CW2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbhh8+1Z7CovFaQCoZ+HpQ0k2CLEq5CaTjLY3qC0UFJQIgd3r4LXzUR5zUKWvxAxl/lEhqIjXpEVE48b8xB39eWRI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.1_1528135369068_0.9184039868840335"},"_hasShrinkwrap":false},"0.17.2-20180604180339":{"name":"@atomist/automation-client","version":"0.17.2-20180604180339","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"2499ee9bb0df7c46256f9aab85e72a07edc03dbd","_id":"@atomist/automation-client@0.17.2-20180604180339","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EOgQXCq9P9R0R8BRplNsiXXQywp0cgXbk4E2tllozP7GhWskHP5jymyeyFujv3x/Z10Qd1ne7N4tzqdXVu1HFQ==","shasum":"f0c76b529d43799af17626f706c818dc78939f71","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180604180339.tgz","fileCount":597,"unpackedSize":3261181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFX/pCRA9TVsSAnZWagAAO7gP/Rhdlml7k969X2IX9Mg9\nDaCKO3xLq81x/BP6ZTMEzG6D87cRIMnyx2V5roTldzNn05LtWzgp1OJnkVpX\n2z/nLY80diqE1TkwbbC16E7M2Z3j2Lt0h3m9sieixCvpxgUXEcYtn7012xyd\nMG0S0C+mq6wzaVxl1YFP+HH+qdr168J9lFG/34jb4zMRz3B8x0qNcejtGdS/\nW6+dhDtwJvaEan/PvepxH5KXVGkHH6L9O3L93yaQIjmbUyu0om+qH4HDw03f\n6fYsS3YXhwZ7WsCgedKjOGXDdxK1Eq1xUWglx1tOydGoylanYxV37snMBC/J\n8GbApFSbdzTDP8wznmvdjafmqqEU3PWZq1AkWczrjj01gXuTv/1W6B/guVIQ\n1phMDGZftrkaRRsxSoV1wLgOSrMpVyh3/Q97ADY5ZDr5ax+b2qV4D+qzpkmr\nhCFbBbahxs5JOduvAagJu8OFCeLzAtOPNWzOgnhLe34FhtNYCbfSFYbM8SvO\np02NvhP6QgQjPu9uCTOcjH93en6Vw/S2gKo6oaOP9kCRh/Eph9Yh5PCRnuLP\nIeigsOsxt/jw4vPHRa9AwbzK00z3I1t/deDoaW7hc8oZb62Wl/x06yUHQA/n\nDptFFLw0IYwdb5b+vlRDC8Ovh+UPgvromzUviOQkk4P2+4ylXD5k3nPw1Yd/\nMxYk\r\n=zKFa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCV5JMiXXeDC/7UTWW7259a8XhH5cv3EQsmbDO9oO3pZQIgFbmwt9irRtvbHQw85btQ1ri21oFjvDQeXd2zstbsXhQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180604180339_1528135656272_0.9073366161921943"},"_hasShrinkwrap":false},"0.17.2-nortissej.move-remote-repo-refs-down.20180604211000":{"name":"@atomist/automation-client","version":"0.17.2-nortissej.move-remote-repo-refs-down.20180604211000","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"4602e5ef1dae2d2d6a4140b3977222fe4d79f043","_id":"@atomist/automation-client@0.17.2-nortissej.move-remote-repo-refs-down.20180604211000","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5BEzx4tWiSo6VXmpwPBoH8ndADLRWFg+fBGz5KtBBo2McYL2W1PPotw/+uV2TNMCLLRmbtbqfxvS4kBUUp4l7w==","shasum":"a2eaa1aeff179f8378527bb8c60ba8a03174114e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-nortissej.move-remote-repo-refs-down.20180604211000.tgz","fileCount":597,"unpackedSize":3267875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFauhCRA9TVsSAnZWagAA1wcP/03tlRZagkFw0saN9iVx\nKcTJEbyAav7fMrDZi3JFP6PTbL+Ubv4vYUHiZnlp5rors61gRBWAVB8uG3iO\nja1+TD4GrqRA/cwvEVBwpBZJMpVY3Hzg8L7Hc0X8fxxGFZKimeKDYvEtpBfn\nr+BXUUoh++2XY2rEIdgomkYyjArxenk0y/lZLBUpJq/MbaO8YESAHvfL2EmA\nBn1EYopVuxV1sCtFQNDqSQanGOPXDmTDW9bIOf+UnPRQEnpsXtBPqKfp/0yj\n7Ar/uqD3ff180rV5NdTNkN0ZwyWTxhnolxKiqWB7oRGd/IDURlw3VSU+3rGr\nVp5xNZO7WRw32BtzOF0SFfWw4tv1ak43bdaM2Kzhsq0P7IOmsP9XrwAsX8CX\nYBbE/OZSchOb/wRle/LRXWdnG1ftcc2Lh6eoCssHo2jAQw6lISk8Zjs4uLYT\n3Z9Wszg8SvHVizqbFGotoaxrsMGzADsYY5+AbBD4FzMw2YITu/jbMV3cVNRH\nSy21vmZPB0Wu1huVvtLx11jnQJszmd7Oeop3otBzYVnDN5tXJ9eJruSbInqN\nuw/qO9EQKLT6t5GnYIASljdo8fZCkeiBxdRaVgKVvA0gxYgN6pk4Z2bT2HUD\nxVRDb5XIcNddSrBQTYUaUEsnULuqhbV5jrdqbpPz3CgcpShrMzPhWesRTae9\njGkN\r\n=i3R9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz66LvW8hK+fXNetxP36hM/ubzrQt7MHCRi8R3cHZlMAIgNnlSC4hMHaaanBeug8cpjn3hBPYdzU7OOFnJT5G6mqU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-nortissej.move-remote-repo-refs-down.20180604211000_1528146848133_0.7289989411429851"},"_hasShrinkwrap":false},"0.17.2-20180605032022":{"name":"@atomist/automation-client","version":"0.17.2-20180605032022","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"73f9358410c1b9b53472ace91b3152528db04d3e","_id":"@atomist/automation-client@0.17.2-20180605032022","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qrBSrUr87mTlj4/NJ+EkNnz8+kW9Ip9hLW9Y3ILffwhmCtOznkg1EpWXk8FOIaE9EAcsFBE+xX9rb4cbFZB+IQ==","shasum":"59c37619996091b3f1da1a6cff3724be8b71540c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180605032022.tgz","fileCount":597,"unpackedSize":3267838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFgJdCRA9TVsSAnZWagAA96QP/1xQQwFW3LR9ncU/QHpB\nKNxFGOnnZ1FJytQpCDkp/KtWjqbRlCtrFu4WdhH844/4RbkgHRmj9agUWSHI\nPKMJtfpZld7k0x7yf748LxC3g4/Obe5FjlQQYpquWmjK1U0s0xSw8jB7YPJs\nzfe3E/PxAk95F6XJBz/HYKomFpzE30lglALq6C/9GUNsvRVeNhnXZ7mAO6Jk\nAYZX7GY7a4DuAcyqWO4uQhK4ldzMVP5SW98tXQVEoFnqA5pgAFOpVovNe2Bw\nHqIzYaE753J5j0uT0dB0lAs+bk3deFzGrbF36+42X35xUdxKk1QxIC2n1CPO\nX+QIuambecv/T4W0oJE08bMgarUzRnW32rfbXuBkwTvJkJcXGgrAle/3802b\nCngtnh8gTnOzMCW5WoZkyb8jjytORjsTKCxWwViNOyvLrKT09PHuJNsVQ2pD\nN4YG7hcleYvO+t07LB68JcmvJRtPfwA7cfZk2Qs9HXHjyYBjODmLN2HXD1C6\n3DBVDeFcGocdOGJIoKDpMiBIYm8hdB0H7g+M2N28K4pb6tHAu492u7W9HPYg\nd8Ehbau7MypVd/ZPgTV4fD7zPx9NHTddHBqHP98xwzgaGNmrPEF6Or9Mg52V\nU8B4jIksLkEbXfdrWCEfxeMj0Dzf1OzFhScaM2dHziZyxt7CefUMXA556yPO\nmqHi\r\n=5YYv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSIx8ehCfT8Uc/BlLytLtfWOL5XK6ZfjIhCxUQaGKmVgIgA0S6etKJhN8+dUaDkq0Y9Z/Th+bYtdx8JLRiN49sMms="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180605032022_1528169051849_0.7555844490372017"},"_hasShrinkwrap":false},"0.17.2-nortissej.restore-console.20180608013008":{"name":"@atomist/automation-client","version":"0.17.2-nortissej.restore-console.20180608013008","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"c7988f5c81598c30db503bd292a12edc1013f4ca","_id":"@atomist/automation-client@0.17.2-nortissej.restore-console.20180608013008","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-16aZ8SiMJ5OpSCE8QO5A2UenZOyFM4goA2GFU4LfUNOnb4u8j1XtNAiatgfJcc3DV2ZK5nS5tA6p1YCs8mRosQ==","shasum":"3b73cff97950bdc872c7719c0cf136190e72740c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-nortissej.restore-console.20180608013008.tgz","fileCount":597,"unpackedSize":3268815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGd0FCRA9TVsSAnZWagAAinsP/RcJmpAxwwGzpY7Z9oju\n/dyNE0gBQzamDhaSvd8ulawFCxgCPfxMbS8lsQ5rpktjeej2P9sP+NhIChIL\ngH+pW19GOcFmTy4e9gT1u9n5jqSNYmwKKXHffKTaoj7QZCZTMQjF53gjYdv3\n/7oJDQjL8kz6NDNbl6mRN8jTE325zOkFEgV/UeQAe0z1yk1M4Tw4abLfkNb9\n5KwDsxCEv5N5OUyVtectVTZIVLJIeM2b3CcWQfpy3Dv6Ezhl0i2PYKFmdVjq\nvDErgEY6VDtHhx0bGYvSMVFWkCsrcVSgdO0hI0ciI4GqcZY3zN5AObThrO7E\nDMPF4nmrThvmxbGzEsl6NP8A2qwlKXTRewPKC1rQtTNcsf+fPFsOmGfFKQMg\nriKPhs9+hoxNAuuy4EQ8acLfDVOK1+a5mCy7TMoB3hl8tkUjcu3U1GYPOhXI\nGd0+nKcM75JPccLRQR8LcNkVaUMliPgxJRlyJyvHZ1tHcYQYKZ6ZhNhHIPI5\n9RMJ0cDVJhHYcP8VP6DLbz+yvjtbvj5F1yv8jSRjp/qVDdpC7UGuBeIJklYY\nbqdCXSTlpLkbNvmh1vwYpyKZicNdHBrxh3StSXDBrMeEdAiOKIJNB3Dm8VUC\nm0nm5McPEa4C0IkhX/jhfW4Meh8LUFl6EJfr8DoIR3AzGBEh6OCzEMHFedbo\nWKMq\r\n=WIEk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdA6zN01l5XWPlOzdAkWRxgnDQxzKW/7JOMIhZKY2iKwIgKOJhDXsJE+EBX2XWQusNBbiRk7g8B6H0lE5IbuHtKp4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-nortissej.restore-console.20180608013008_1528421635768_0.399139887529508"},"_hasShrinkwrap":false},"0.17.2-nortissej.restore-console.20180608015149":{"name":"@atomist/automation-client","version":"0.17.2-nortissej.restore-console.20180608015149","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"f829ecc21d8b0ce15890884bc6c4aea6cc0667d3","_id":"@atomist/automation-client@0.17.2-nortissej.restore-console.20180608015149","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wfJRZp8jTMNUjlbqPo7SwEHtRfpZLn1DAh3zTyq+1rsOGExBEuILoqoUwvJ229zRG/0s356FgAVw3hfGeUGgWA==","shasum":"80c45a11b8f744b5a7373774a167a95e8816239a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-nortissej.restore-console.20180608015149.tgz","fileCount":597,"unpackedSize":3269199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGeItCRA9TVsSAnZWagAAIGgP/jDKIWoSrmKYmjfbfy9Q\nsNOOxDOLHmHJgMvTr5JUwsB66oITzNIln1SdKvCAkKUICFKrjA6iAJPNtXn8\nojVQps6fxe711NGsFDfwIJ5QcWNxOeNgrhd/XcVeN2IvESKMPnTYnpA59TFm\nHFtcuDqLilUJjDvCLPb3ttE6LCcDUtBDRRTi4VfVUApZ1OMhYgnh87xtrMVP\n6R9Sj8f4L+I8mj+Z7llAhSvuLFHdFgPeBnAgmqdfWHh/djylvagOjh9ykQ9c\n5RuHM/jDuiyFjFQtNEDicCRQgpk6ZvsKxgZiQz6j5gNLY7mrn4xXygNFt4UM\nu2TJFEGcSJVcKlpOgJfhJZ0hNC6hpLE2pb04wIwlJbHPRcm25qmLODLRO5SJ\nO6qJFGm1gq3oUFyfLynvTAz4iH5hRL3YZcCHrV2ODPA2F/phqi3U/+k1pF+9\nvyTh1DVtBD9dVbGMCok0iBVqUzhuNc5WvL8mTDohLinBSIowSkDj1GHCg0eI\ntmUE2NZRTIvL6Yt/yHRqKq+9tDFyBzOqtOYpCTsB3N2KPd6RE+bo8vDH5fSd\nd5zRkbRQlmQ9n/wXTqnxuU0C5PBiYjniYr9U3KE2C9h+85PGqIlRye8hRBRH\nxXVkJG0Af3rQHkvM6LjEYb8n3Jrz+Uu9W1vQckwj8PXKDZfytvsEQW6/Mie1\nUowc\r\n=XD4I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVA+9RRdxCxLSaxV9Guwbaz4d2uftAtg4TTTtU7NRF8AIhAMYiFMFMiD3e+R5neDGjX8fZbuIYtZFoBEuaA+f6loQZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-nortissej.restore-console.20180608015149_1528422956233_0.10091309120774294"},"_hasShrinkwrap":false},"0.17.2-20180608015228":{"name":"@atomist/automation-client","version":"0.17.2-20180608015228","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"caf2e9b66113c6debe5535ef58d7a85ddd4250c3","_id":"@atomist/automation-client@0.17.2-20180608015228","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-p8hUT/jc9HTH3rzqBiMy8oDP71mKNKh9+X8ohfmLFCjIayOnu+ze6PeWcD8sG2rQod+5Rm98eTSEwyVu8NeFkw==","shasum":"924f793ebc2afa5aec5a06666a1fbca18e664ecc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180608015228.tgz","fileCount":597,"unpackedSize":3269173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGeJNCRA9TVsSAnZWagAATd4P+wdsCPO+yfWToQggqQan\nnhSOpibJ2pWRBFfmlXJqQ+xOkt8voJUSV8czl0lNCP71PAtbl3W5lGJq5yYr\nmD8Q/N0vI5zfwAIYFQe79TIN2kf1Tq1XMJBpQMw0xdtfxV0320k0lWE1Xhp4\n6EHgiCmUY694p934H0wuskAsVPd41xxluEVzCjLI2Ba/6mmEyq4KBuZFKA7d\nHMMY9HskWeonsLmelhZNKe/ZOnRuHBHZjNnTYcp3MFabt9/fVUaKZMCnO8FX\nKWVrGqoZPc6WQ2sV/i6RtoYyyN/b0pIEIiEmXGIK4DSm7mVx7EWoItYRPcRZ\nCL64Vmc5CK28uDGUo+MF+KlePfEmAnkM7lle5QbviedO7dzdI8i8oTOGXm66\ncn4I/I7HetrJXfqsSFOv0wIwt9vyH/E4xVadmmNMjEwAOrIxuAXfkB28yFul\npb4z5ebwCHGVa7t+kbqNQ0uCmxoyvUHG74vZMuWFMW7VP7zKhVt3nSnqoiph\nSU3n6o+XSo76WPT+MUEZgyB4ZBphZNfp0690bct6OFxMw+JmIBmTH+nagkKy\nNTfeqDFex71Jt6K/u1vtHW7omC7K637EDdNwWy7LOu5eGDvLxq7gHTlz+l1M\nwc6YW1uNj/P4bUsRlMlL6KZkadNt4xFQsAnR1BULUb16kn+xE6GbyvYoTr4C\njYkc\r\n=DOd+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzADHkEA+YItvyepGj/syen3m7rvZfz+3gIiwXD4X5EAIhAL9PsSad6Nxzqo5Lf9QEdMYFgOop4Kc0HQiGETrJil/c"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180608015228_1528422987921_0.48725343544851696"},"_hasShrinkwrap":false},"0.17.2-20180609073916":{"name":"@atomist/automation-client","version":"0.17.2-20180609073916","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"4dfcf69832cab226ea8c2936bcb77fde8f751ca8","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.2-20180609073916","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oE46G9bCv5iJrOMR5T2TDzYpVbE1L83mcL1vvlqpmlJmUjKAyn+VKXDDYiGt1zgGBxezdynrrqyc9tQZXxjkmg==","shasum":"c0d6b6d53511d17337994797c99bca7bdcea7449","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180609073916.tgz","fileCount":597,"unpackedSize":3268797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbG4URCRA9TVsSAnZWagAA9xkP/jUN7/WhgfC4tocazPp8\nsPHf1eKlGhPJO1wGwCNs0U4jzqZYk8sWOV43QL4UI2ucjS70fh8xZqCJ5VUM\nn//PJfnJ6DfBxxrEZLn0dUNDVrNsOaqG4dCJSpwLn2s9QZS62A/jx7mwTF1R\nYBJn6F34I1MBApCmAtKqNYuoAc6HqRKZZj7BxP0RQ7CMHeB0QGJN1ZRM+AJ8\nCnFPzcV2J0Q8B0FEokykpZg7LXYIEnv3Nd3bUuItkXKeFTLS3rxTHiK1u+Cq\nPYAB5VQQmHQ8Hbgd+I3OpweUowU6w2V60yHsoNDye+2nxpqf7uRidyNd9+1E\nBC1hiv0emBUm0TpJupQWqlA//1M9QZlcnTd2F9rjc+wJpQGvJYa+vLtBlnGh\nVFmghxjcdo9ZhKfUK5xggpXfLN9J11Y5ScQOLnq2m80o59IiRtjl5/jEC2Im\nJKtb01OfoRTRs6uZpiQyaknKLchUDgWdcWidSBr/xJDQTOAQQaic7CHudANN\nz4sOutlf+SNqTfLxuMnLxgtC8HBFq3jADb1mYRbF4+UY2foV5Ax4TGRNWBzz\ni7nNzAj1xcW1HN3IBaEH6j7Co0DibLkiq09tCpPGQhB7TBOH9p198FaxY9Vs\n5N3vZ55ZqxpMs3cKPePUt/TvwoLctAG3YKwXzaYBo/E/TdffmLOR9cdKyX6i\n6utK\r\n=xQmO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5ktKaF0u/oYu564IrXL7qYUW1R79XzVNfzSQSv7CWwAiA2d9um26M2XEr4iqi9MvTXMDoEmC1IuqDR8TpMW8hhtA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180609073916_1528530191401_0.266267254449448"},"_hasShrinkwrap":false},"0.17.2-20180609132323":{"name":"@atomist/automation-client","version":"0.17.2-20180609132323","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"b59c3e117b4fa67c831593c3665a59f3854f7a0a","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.2-20180609132323","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+sgsDJtwpi6VziSZxNyUZ3jIRu7bLy08apOtjLxQ9ax6qfWfoXtZsphTZFhmDqN96FK08EcngYGwnFBvSvVlwQ==","shasum":"9cff6a2e54e96876fcf770add8665cb4936d410f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180609132323.tgz","fileCount":597,"unpackedSize":3269232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbG9WtCRA9TVsSAnZWagAAkv0P/09OCLxK6c7ziPDqmduV\nQ8gFLPeFiU5s5gaAj4KTf0jBTZIDaXCvXQnjKeOd8MXSi8h0euzds1xHnc0O\nGu2Iy9e3NWQjKaSithdpxbX4feFUZDdwegWsGMXnlx/pbQsOc3YLdNms3e34\nppbFkRpcBr+Df5aeCgi4sQeHuAILg9ZQNO8vt+8h80CavAppvcDVuQc+wCtJ\nm3G/Ijljkfbn1JLX63QDXaUD+AvLL7KCesmTrSvns5gzU3W9SCWeVfzZd4vf\ngJe5RYyY5RJYYKRRsjVYWuwXX/iYYWlmx45wBnqT3cWO2JoJmAg9EGQk/7qE\nCIFxcTuGNfze8OzosN1L6f2GBuZ1kCHSbYuHoXW/O+M9+VPjU+bk/fuTl6D9\nZE1C1egDVvKXauGOgV2K0ZBsW3C5I8StzStO/r4KGdrj+6eMrwvMGXcE7K+z\nlgDvmmYKe1n6YOSfEoTmSqXpEl/Ks1rico/XWoMA7hRiCrw3FSxXaoGvo5lS\nHjNHx8hEMRvvPsO40bqpXn9/c0059Xwf+oz9Sbh8d+YRJhmw3axJP/MJzmvm\nEwTjvYhpMiYoXghuC52QFQ0yOykaKIaQW2shpGIaARde/bEA/91si0lsMv02\nLR94NbnNgmcKxPV8ODDfR/feUUqK+vWoc/ZQUZwa2cwGRUZh9HTUROElEXQI\nnxan\r\n=5irz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFqh6WBEWQkix0dCLJu6B5J+GhHL3nrpjigpOqoWAfHwIgNesq6AhKpPbjwY1630Ulq/7J5sEjbVMTOARjxudGEO0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180609132323_1528550828171_0.9654192060114146"},"_hasShrinkwrap":false},"0.17.2-20180611215142":{"name":"@atomist/automation-client","version":"0.17.2-20180611215142","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5ae9766b0e5bdb02e489bf1e40a5ef70db0da098","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.2-20180611215142","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-O2rF7WPM/1fcy+md0xKk2W6jT9rMqTqhDDTqVrIlZv4rdF0NAwcLNu3zrtt5S/euNU9lEoVRWb99yRwOQ2c9Jw==","shasum":"0e973fc8059c41c2844ce55835c776de4a7ef00c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180611215142.tgz","fileCount":597,"unpackedSize":3271144,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHu/fCRA9TVsSAnZWagAA+d0P/0Hpm7IUGsHRqzpIetGL\ncqCFmFdSN8qNUAm8e7kaB00TXDg1z7n6Utcr+xiGuYgPvQ1sczJuph1PHWI8\nhTSocpi3Nu5EVJalfw2BDsP9dYStdZQ8JzlcRyEgrzSKaS1alXEaVpQxRu0F\neJT7NdtuJ0LGPWZmkmZx7WfC6d/G+qcOa5rp0pmOtGMe9prtfsVB/Lgrn1Th\nUBriKJqKzPlozk/2kSm50bMAy1YIkhWuMTL9lZe0or05yLy7vPPoBt/vcQnQ\nZ5T6CPPRVbRHg7H7JrZlIKm2t6wOsvPdLuxBamTaEcnp64jra9u2Hw5ilBGx\nij0qRwl85VHI8pqjeAqrgv5R8TWJDTa1k4IrctpWyzZ7NNrpIRQ08q14XCE0\n+Nhfez1+dgFTudJDE8rWNFJT1NKdgix/aVA1AcpJpM8qg9M9pkHu05RieI4/\nqvcceQOo9r30DQhXZWiYRiDrPF0sLQ9Gx5Rj1gfDLzM7xQ79hLrQJ/JCA1/p\nMga3ifhnN5nHcUTPHDkm9cAPCN+ugiII1dUdz1ucHvGMGA3HsPCdKA126G3c\nJ4AHpe+IJfupnd4MIjTweFbvTwAf8XYz0Lcelvmem5puaTAhCQOxZwE2S3Mu\n7KZZhwALuhnVKQ6bo6GpDdQZbtRgYOJq6vRTnQTtDzDFQyMp9lI0W69XbXmy\nSuKc\r\n=l9KH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKfiCPeQTemSgHd8MyAZd4dkDnxmZBUWhNPZpGLXUGkgIgVeyZJVUWhO/fwHjSnVD9a4dlnbvi6KMEk492a7zgFVE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180611215142_1528754142351_0.5179213336414241"},"_hasShrinkwrap":false},"0.17.2-20180613124603":{"name":"@atomist/automation-client","version":"0.17.2-20180613124603","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0fd6817a01819a60bfe9d08025ab9169c3919b27","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.2-20180613124603","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5Ki9qCi7qI+NMRBr+XQpOU60t2RzMkecLYDzezu6m12q2UZbNwRroSUve0mJ2PIt5U6nbOXu3jV+ZsHQGJLL7Q==","shasum":"7f0465446e127ba5168ffbe86660afcad0e3d7ec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180613124603.tgz","fileCount":597,"unpackedSize":3272520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIRL+CRA9TVsSAnZWagAAd8YP/16ZJqisWaxzBCy5yPOX\nZiQccqubJEYL+tpklQIwP8YOeW8qNJ+qrqcyvjTujtJlEsK3k2jTiBflTQ78\ndSpRZ8/L+uGnQDKyAGoJYb0zcfbpXSzxLdSe3m7K4HWqE9CeYmXuLIP3QW3d\nt4xfonJgmpKigB1Nj35z/29DagifM5N55SRDRqnBl8aUcw5XgtCuJ9C+z5dN\nscLGCkIXYangUCpFtIp+/J+HYc4Eg0Yv7zFRrpBAnfzd7Bh6jpO0Ydt71pwk\nzhOpvayrjfPcLPtk52uDFywcMr7MwkFBwgH8kIOHOX/daZMa8MaeDat/3Bvm\nsEBSu5688DjuOGM053IYij5UFW8MJJV7EQjFcnVkgYDbIGZ/cju+A5G4r7Xh\n8OWpsmuY5ZtjT6btP3OASdboTt9H8uJvWVMaoMhPWqgKLrIGAv6QnuZhiB/4\nfxZRwCmpLF7NlfSxX5XFWzLWXFdp8yIzafqgASjEA3+DKukE5q60E+ZJw1j0\nV1KHCX3R44yjY5oIeLJhZ0rx4GcoDIEqg5v0NyKXNCyAFkjLj/ThMzsOsvfI\nNdHOWf4Hj/T6kPJYRfzsyHWWrJKotvAgJb5qAnx5I0FdRur1Pjf/j9giN+Oy\nJ5DeUfWTT+NIRjFLS6TBX9/6/4AX64eG2Sp/UWI3IXSEQWtJiRzSpJJddOgs\nJuVB\r\n=bT1i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4glucwUQW8fULTKccZ3CXj067+t8AHyzqdCnWix0iQgIhAPTHp2Hm/3EzcGTTOxEqoMUvJBvzpwwSjvOtEEZS7ggx"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180613124603_1528894196786_0.05629038917739404"},"_hasShrinkwrap":false},"0.17.2-20180613153815":{"name":"@atomist/automation-client","version":"0.17.2-20180613153815","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5baa2a1ac2cf268989edb40039596431fa3d2a32","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.2-20180613153815","_npmVersion":"6.1.0","_nodeVersion":"9.11.1","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UROGupqjGUUPiiTSPtDkiBYoeluX1vNOOY1yK9kaJfRLk4Zua/g6YBPP/7k+6uu1GIUuetvb7pb25le9E584Mw==","shasum":"0ece33b7d088829a2d9498af325e5d714af46f11","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2-20180613153815.tgz","fileCount":597,"unpackedSize":3272212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbITtJCRA9TVsSAnZWagAAs9cP/ibLWzA2lcVogtfyGJoH\ntqNHw4vUY1QTsTxF0AOk6VHpBopyrVsrWMBlQCXs71Gvt+ExDXtiz2cWw8ik\nrWuix1J0u3+A+P5vPvbophfQwpBGalc56NMRLAA1/v6eipgSpBeGtpHo/uSx\ntLvIxtfLDG0rnRBFm9Kv3TKQiKom57BmEumuKEJK6q6DIeRc1rPq/AKUexZM\nboQQuFcaEUHz7iYfjtYS2xymJzCmZLanDsd2uBqQdylL6UtoXIw+L9jTEHd0\nhJGg6Ba4Gqdo8dvB4C1EbmHNRLV3MIwfyHkTDgymacavKLQmJQtnAZ7NjcyA\nZQZ8TM9vzeNEgpU83cr4kA1HtqMSGWwR1LJkCYlGQtBvRYhGwTBSX6eA2/4w\nj486RBb2BfkgqnYIB+K1T1DYrYvYno6aL9ZcAZgiDQpA4D7VghyDiEbdPnqn\nIzMhcXMXFNKetjqQw259mg7C7LfU3AY0BqhdWwuXZ4kPPGbwL7OtAOOG6N11\na/1aQwOdTozwfp8jTU6ctCOFugCNLPHS+ozl2tsN2icaHNAxnwQLMFb1Ct7F\nh8Zxl38/iAJPXEz9s1Cw0U8+3rEEJEcB4pVTXcXjxm/V6qg725BtKiaNv3aF\nZcntaoDtSsQmepa8wVCAgi3IU1gJ68RgIS5Op5BgoMfYz4vghQdVSYulEbYh\nYIC0\r\n=dX+l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/2xH+WETgNXY/V5KOHhhmqcRkfInpf/N+Qzfy0KDlCAiBxI6ehZobDCl6MOwvdzs9J/xxVzj5Ov/2Lpwf8whcJwQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2-20180613153815_1528904520295_0.233143133382117"},"_hasShrinkwrap":false},"0.17.2":{"name":"@atomist/automation-client","version":"0.17.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5baa2a1ac2cf268989edb40039596431fa3d2a32","_id":"@atomist/automation-client@0.17.2","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Nea7ZPpcOXjKnmUYRKIf2RJLdt8ds9urQ9S/UWtZOf8MuACwaYlV8qhlYmY5Wkj/0aTIhJRnCybmN3nDOJGSQw==","shasum":"f02a6ca8751baf885c8927c4635cab2c50973d16","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.2.tgz","fileCount":597,"unpackedSize":3272197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJEzRCRA9TVsSAnZWagAAxS0QAJkfNKTYFQ3ngidAROEY\nyMlRFHzDP7RUyBll5jFTxzxZtrJJhkQMJlLwDyiiV/4tgyT2yK74GcISE4Hq\nlMaGSN5q4CgDkJtES0pCVzgL0fEmRFWNVXy+yh2GBuPROknTidqQwvHyZ3OL\noMPpXy/QgOW7cPcRpxNDKUPbehc20ycih5y4YTSeBf6arJAV2TrG6E8/K9Tc\ndFSfl4UGCtW0dluOTTXZ6T6sO8wYMyUreFley5QaFDzdIgyqq45X6LcO53NL\nm0z7eWKYTdwSLD0CKgZBBjmOj/zar8GYrZAEHvu/gOcRZ0KFS0VeNGHls27l\nCGwrsv8fGSf8xOjj9t0tOdQ2sc2tpiUgSQXNM3RQ1q3TGP2J4ZGfACdDdrbW\n/9N0/LDmD2MsUjbZaHoy3o3w4E9uTszEOw2/1kE0gCgzJm7v3KjCqB5hmWYA\nfi0hZPiMoaxnzrEGBgUPvUm5AEQgyZx/XCxI/tDr9VrepPdA8vVih6MQO0db\nSyFUb1+IYDTaAXbFqGWIXXKFQ0r+/yAsfr3mcNoj+edwMoR9RKDIRQjNrLNO\nWY1ql9dStV8eWSYsbjt299qJ31q19IeVnYhGHMTP7/0EaECwc3sBiqMLjS85\nJy2A6PrO8G409ROYZvEaO9b6PDCf+wNQYieso8Q19dmvJ5D4GhvUsU2jkpFh\n62TD\r\n=ylLB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAK2l73zqXWT2wgSDueWwQ9E/WJI0yz35HQbCQRByQB5AiBDsl7UuiFrdv6Z61vz3TF18C+HLjIVyew6lVE9CqI5fw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.2_1529105617565_0.6808402648463365"},"_hasShrinkwrap":false},"0.17.3-20180615233424":{"name":"@atomist/automation-client","version":"0.17.3-20180615233424","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"ddde2ce231ccec2399cd18dbf5c81db90d7ad0fc","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180615233424","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vdsOfQuQjrCz0+X8uGokqSck9klgV8kmSw2ly+89kMPZrEazLmfz1hcEg0OGprCbPRAm1VAuOcSFOE3hUR/qSQ==","shasum":"f4598b62ce7eed2a0d92d6c2d275837e3c42bb95","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180615233424.tgz","fileCount":597,"unpackedSize":3272212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJE3pCRA9TVsSAnZWagAAglUP/j5k261xOM4CUAjjso3p\nqZBPFoRC3fpN+wmRK7uv9sdxtQhsBKT/eE1dISgxBTscBEXTG6Sc0iXEN+P7\nOmGeC8J59a1hm6s5Qp6b72dODxO6v6A7SeLc/QNAfMcoyuo6rzO110OgZQ8X\nDZg/Qv8rTqmTV8r0j0hMpid/rzT6FOESGfHmtpBGgEZa+0ZHEjyxPMXmKupo\n48KM2KfQtmDzl3/98VyvJ1xBZi4YsjmZl0zq9l4WawyK7biF8wDLd6B5VR8m\nhOfR+92aJjsILrCweNMHxswI+C/FLGFvuhDuBq7ooXd1FFbOwVc9UX+0owy1\ncTUeXqTXwFHgQFoZMGpZTJ/Q8U8ebh7ispjj00ZGguPpDN4/xi4oKemB3rpI\nlvB54nHym3EYLkiOUrBjLCpJ3u22mahemedzaGYMeenR8wopYLlgetTaMtaq\nmuHodBtVIcW4g9fbu5QQCB+rd2DyCu2hrGtYWmAd57tUOHONDXfxTa6yrCgL\nxHmDerIKG8qebcSQudvLUZPA4y6+4F8qvVBVtT1NrlYpDrhKC0gZ8OD/9qad\nJ8EEBINT9YMj3Pt7w1+z5yUigrGjx0ig87M0CY9HipzhjCQMTGgNb2oogxvH\nMyN9PqIP/w+m7wyqcERaYlU+DoOIvyzZ4vy3IzdaU9w7jhNuShHkdoECUVhy\niKMh\r\n=PIXu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCldxAwJAWuSvQaV9tH+dTiu4roQp0iC2FqnHdqvajRYAIgTyB34lFizosXAd6mvfHZZ5HfyqMzzE+V1EWLcAu12Wc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180615233424_1529105896418_0.14443658148362926"},"_hasShrinkwrap":false},"0.17.3-20180618085114":{"name":"@atomist/automation-client","version":"0.17.3-20180618085114","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0c90cf54822d85e0d142220cbaa62f4ae1cb02b1","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180618085114","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vq2igut6ZLN8/dYntVt6t7i81omHoeV6vt9uzNH0lWAYexgUDnnwKJyIKKT5NdOilDRkJYaV5Z1f4/ePPu1aeQ==","shasum":"54d5f7b79e020c0200016a4a48f6304b575e42b3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180618085114.tgz","fileCount":598,"unpackedSize":3272507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ3NoCRA9TVsSAnZWagAACkMP/iudMcEgwg3powOovDhm\nr0oEMiyHLz2LlV2Z1kuhksutpOjafNqdTRjR7gqSDTH5sO9KhoB+PJpvXdad\n8gAz/WOaTnQxqhQKq4BhuYv2OfUvdyY5G2Yl1rv58uH7uHM1hK9T6U9GsmlC\nJvNLF+SgpTNpsfP3IosY5RrUrLt0LPE9myoqUq/h9r+/95J5cDjwMHtqiwQm\n2ehFE2gXbfYOthqw3XPWObEM/585DR0vV7sP+S7HWixgChMpg6K04qe0Yq/u\nXz8LW79GMH9ZoGgtuH6rmLPPf3jJOMB7Q8tyfaYhLQ3H2SbKBT7DNgAfHkau\njHVfpI6EY5U93lCiRQZwi8gInic2Lumb/DzcJew/uNKp2sdHctn7fURp4hCJ\nNQ86Z/aRQbkCTJor7b7anrKL7wXgELqcJ51yJqF23vQ1DQYzV5TfJWu2r3sP\nBBP1zQbJ1lVOHeK96zfYFY3ZJ7aVvMcN3Dx4LnnuyZgeYE8Lk/lRBeqMZdQY\nENiJ4+O46jLHnWJ4FSi+eRwSW0hzjWol+CC2zKQVGhLdWXFLNni1c5l4q0LY\nG4eUXNhRyHsg7c12OPeTSr8ULhpp3+W2qv72Fmgr80yxl9YAZodi4lcLkLje\nnOHoZcp6ox8F7IeVf/uWCddOV+T7Afx6gGp40XpV2fBMpa425joB1nJQOe1L\nQU0l\r\n=2XcN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUQDzfNDacFLcYhdHw6e8ovnfDN2CMkBLJqWnO1ItyMwIhAKmi7H7DxUJyx6kFc/HT2Nb/dxElNfnb1mA7gITFtC6G"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180618085114_1529312103902_0.23418455159762908"},"_hasShrinkwrap":false},"0.17.3-20180618091145":{"name":"@atomist/automation-client","version":"0.17.3-20180618091145","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"31fe897f2bfec3c512ac84a9ccaeb38c00d59fd1","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180618091145","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DK7Of+ArYYRILWph1PTwJbq9SlsoKK8hQt9rBtR94dhh4F0wIisY9LEVtyY+hO6rv2s9Ww2vq67/Qym5hqQomA==","shasum":"8ae523cb44e064395d158678a643be82b4f7b2de","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180618091145.tgz","fileCount":598,"unpackedSize":3333960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ3g0CRA9TVsSAnZWagAArKEP/i48FvyktwNiBfZmt++3\n8xaSv2eiEoO1L/mSIzEaM12u+BbXpIpqEFvmbGeFo/mSfbW3v0+d6gYzCceo\nMUDiUvIbbf7f47UDULCxao11fHfv0xngEaGK0Cllf1ZMuLBBDmJiC0L63k8z\n6jNT0tYuJBPmNtJhE7SXU06ixM6+vtstBWGzJbGZwtjfIVbmH0gHFxOAyZx1\nUKro9KyuBizmDYgjcJ/NGIsofUHPdIRKoz1O30YvfOoDL2isrSSlQZUFipPb\nr9HbUqajVV+hnZV62jhsIfTldTKsmgvJL2Z6qPzuOVO2RU2rOOwS6Y9rqODs\nrxT508VO2YVuxuzk4+5bf6z4ehxwPu2FN0Y8RjTfLPLJKnkvJ3yw56Tpv/Ix\nqNrxAToGM+E6g9eWbIDV4Rny8zWX7mGTTH3DUnEhF64Uu6m4YLOpAYfs24Ea\nKid3axEwbDLZJUYMiuOOEg1r0cuUBLuV0/ixE/rM5T/nqXlZ7Oeiplp8y/5P\nJbB14DL31fpVtdbH0MyM5MCltFz44S4XCWn/f6+b8sAASxlrmLZG0MJxTxRS\nKC+rH1f8iyD1KRpCqX0tuW/jPJ+xsOowVznFuNiQvf5QoBE/W+lvDojHCiiM\njsE02w2F8S3B+wy+K5xwdlk0QWtjiQz4va0Z1NZE2jZTg/tqqtPR3l6vsXEm\nmmg0\r\n=Z9rp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ8576aiA47sdI6VG0269awl4cP5aQsRq/ylSFns7bHgIgUfBFrv9N/CfEuHRbrGBVP/w0zGuV9NpOUikLWsMTzrw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180618091145_1529313332652_0.7349153670351292"},"_hasShrinkwrap":false},"0.17.3-20180618123137":{"name":"@atomist/automation-client","version":"0.17.3-20180618123137","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"878c172f4ec3380eafab966f32d10e048365112b","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180618123137","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TMhWQoCS+MZICZm8P9FgGSmz+/8qSfjMftZbCZCmDvrrVvFZI2k4u7m/2JmuLY5hHHLjNQ6akwIMcPin52xGmg==","shasum":"99b9a9d77ebf07a725a84d023f7c79f6f44020a4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180618123137.tgz","fileCount":598,"unpackedSize":3333960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ6cQCRA9TVsSAnZWagAAsQ4QAILNCLT3Bntp4zkukXnB\nJHRpgmFOslyORSXT24YNzaN+cMXbaQ/6s5kCiBu1URHc5XHlfZMNJ9sCksDz\nJzod6XlMC1kJZiEMOcJmomm0pjvusjCOJ/xUWxfUU/E6OLPfI7dJXMgMahIW\nWCLcNTbxe47wDZZHD1NErPUkL09EmI1rEO4iPbfzekOq0JWjxDRvrw9vds6h\nrQz4DNVSiYph70bJzS/MMGBJNSot+h4kNk06ZiqDvXNzoN2a3KoFRd1erQ4A\n5KLTyBEJAs8wvqvfZAq1yhaq3TlH6Qb3Z8y40KZqplxH78+j9D/dSzxuYvzJ\nK4FOoxYUiIoXVt/rhVjWuSJd14MlggOCpdJwIBmgJZV7F9TQByFgg5mvaaB+\n04PwofFtkFUhCbEawoDvD2+d1363qeF5+o+10pEykvnqDHrYZxPs1mKN1Snm\nmWD29clKsCP7RS6GgQF80cVU6fUz8Iws+Jk48o22O977nc2fwPzYhjFLGRUE\nkpzbuUguMjdkDd7d1K0w44B3J2AN9rcQF4tJoIGlLgUbKEemhi+0KSx+MZ2o\nSfR+tnn9N9lq8MJBWGoalylJwoeErFQJwwoyLk9dep4tMJSI9BUNlo80N3tn\nAFMLvfwcRESgW8rCJExTLwQNOloVz2zq3ZbsZoa3+7JngpUvo8LLrxpVDnZ9\nbeRL\r\n=psDv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXBVJaaUZY4MDNVXf7P3AK9iBKC8aRkh7WRvAdAyzZewIhANOaTyAgivWLh/bJx4rmhrrT5dP9e5vezxuvFl8qkE0j"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180618123137_1529325327520_0.2674774565967739"},"_hasShrinkwrap":false},"0.17.3-20180618132425":{"name":"@atomist/automation-client","version":"0.17.3-20180618132425","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"7c4814f60d1b229f1ea951cce08be8d8b7cb509a","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180618132425","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MrIGcvofPIN5ndRpHzW3du4cKbDxr0Zpam8aCwqsr4Q2RpI7V6qU2K99Z3+XtBJLgH9hA9xF0hsU6HlVMh5RIw==","shasum":"ca9f3bc484414b3a03818f38ee74b4db34c8fefc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180618132425.tgz","fileCount":598,"unpackedSize":3336258,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJ7OrCRA9TVsSAnZWagAApUwP/14uYJM2aoyF5hsm64Px\ntTC43qYpgvYOfNJAHruGbnk75ZJH4AFBLSFwTev4eod8GnOEqQqQSkhKjakP\nQ3OFT1ZBxUaYeyK68/MU7Sm3QLihIS0T8BkMJjI2rka6kP9qiCL2igdIJQwK\ncEz4RKHHYzFGJT/2/NyoC1LnoGiw7Exwji05zbNpoKSSpNiMvJw0PBGp8qg+\nKL4ifp/S30bA5fyoBM9rE0BngjglPX/XR3S+1ec92N33PFAAZyMFgjQRFoga\n+dZG5oaVqF9dHsEhnWniAbp8HipwM531Vttj7zg/j1MouViv78IL+oUGYLFM\nGkYoOLkKrlLAkpp+MH55vBro+iHt0UehYtm6FVOLEqXKmXXGZ6niTUg9Ky//\nQghKPpGNKnDHEHJY8tYRGddvgolt0z7wsN4uv4sQUfPJPo7pTzWTqsw7olm+\nPv8UVK6+MREVOYOyK4KvqpY+Hqtg7u5ubNLDMSLCmsl0FPOfbfR+cLBH03Ec\nIcPEnhfDpbjXd6EBk/YWV1VJar1lZrLHWQfzv0cRtu/b4ANa6R0+1z0KxVdP\nuKMDDNYGsxQVmmAnQcG6f6/QikJqQnq0s/HdWIG0DpQ/rmBormE6PASB9CUP\n+DyHF//g/LiIUr04HsLE0roy4HOgsdnHFNesKJzVFo7aVIXGEGbSgbiCH1eX\nYxfp\r\n=CLwe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKW5INWgL1TR/92owfWUODD6JzsjL55O7mae86uNHe/AiEA3WfgfqfNXsKy74Y1g54pvaFuhxI9MIYSsfce4TYbV7Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180618132425_1529328554919_0.3939400734624854"},"_hasShrinkwrap":false},"0.17.3-20180618234543":{"name":"@atomist/automation-client","version":"0.17.3-20180618234543","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6c6062e1583972b5280070bab8037bf0163da5d4","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180618234543","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-acsYzuIlbhSQeP5hhDLUFhOv9Ks6ytV2KkRcsH27zsCP8vsiSQPR4JtnnbDqZeXHNR1m0Q3DlW3en0Ga/uW+0w==","shasum":"d137c7b895af7062c944dbb1b9cf871f9210686f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180618234543.tgz","fileCount":598,"unpackedSize":3336158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKEVJCRA9TVsSAnZWagAAtIAP/jKfDkqqCtrNtGgVZAEs\nortgwsWjfcIe7GtetPTXq4CmWBwOwfS5iFRWzMQQTOi6Wbg/mkrKwGbD7Tvs\nyerE6uzolx6ftbfqRgvGoVrFgUgeSJf0Ny5Itb0VvdNxTHCx1RgeC8y4C8cJ\nRSDvzxwNwYb+h95CaDpTncovplr4fJBU9JP1emksbdi+SZA4JJlVVmgon4km\nsGWx90HkFQj9hsz+jKYPyqINdmB/mDE3RmWQguh3s/GHr/784+PVQnmaK9Em\n75kuxeqIfKg3xvaVcKiPiuLJz8CRV9Qg1c8p8FGHmiPgfpf4F40CrmqK5YKp\ngqflM9aCi5vkhStnj6mlIEXZ2/vAqP9V79TxyqCMV++6kJo8rMiMkU4vV+x+\naJRYEArMH1Vn41nYeseXKTDilbM9ezWoCSKOBuFKjbsIwkU2t6YeHYahr3eD\nEIzGmg7RPJs5P5F7AGLLd403YrvOZUqqRwj7c5Jy7HxiP6CXOiAaGYJgoZKk\nPUWyQQfVRYJYzpydIHlBf3iSw9O1+pzKz7qdWlSECCDQV4nzFxGKk/vnt2NH\nnj0mzgYuFJzsnRbNb33u94SzXtvgE4/Pbhwjff7U57MYPzq6ff5/AEZRtC6h\nBLYWF6DFvqr5dn1UGE5A7kWehoBiGSHPRhILO/5K1Svuy+lzK3D7K79ACFfc\nkW2b\r\n=Jwoc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFfHBbmJ02xDiS0sjo9zDCWfd9RI6OUFVmVJ8F0cDijAiEA8W/MERbJp07XwJk2o5IgfvgBghEUX3njnQQaRQOZZ/I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180618234543_1529365833238_0.38186993129560753"},"_hasShrinkwrap":false},"0.17.3-nortissej.bb-curl-or-axios.20180618234615":{"name":"@atomist/automation-client","version":"0.17.3-nortissej.bb-curl-or-axios.20180618234615","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0cf841195737c1f4d8fc4efefc8cc3c794a0f630","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-nortissej.bb-curl-or-axios.20180618234615","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vE2+6o4tB3vj7dVQraSEIoJYJlb7+wgL16N1b3lw904KJ0GhJCTaXL9nnQW/t9FzprxY7SRoKaSlPIKUEyGcag==","shasum":"123374f93d9b83c1932e10d95a3c1f9388241fab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-nortissej.bb-curl-or-axios.20180618234615.tgz","fileCount":601,"unpackedSize":3347836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKEVVCRA9TVsSAnZWagAAWicP/35NXTU0ppOpJ5Czhu7a\n5Q8iSgrBoX4xPz7wxNjPknkrCP0AJD6W/zJ345h/CwrFL9x7mZY5f/fOJKGH\n0kSwg/+87lq4Xav022bYmH8j4wB9M/8dzMdhbXA0aA29yJO56xvL36YSYOUH\n0kZVPTD/ehMqEVrFWbZeB8paW6v5+hwMeo4X4+8FYDfvNlcz8K4sOgqYa0Zb\n37vqE+A9bWO/HkbEbMuPAa+FDKdAwV9tUXotEWFQjenu62Amjuhzam0DZbs9\nw929VF38ESAhosaX9QFzClGKXf5echfA+2wyj68g/EWjO9Gqgou3ESkMIXtS\nxgkH+cVKMywXVZ0lyLDe+5Df8rqw4xOtIs9NjrLP4RjtVY6PQ3/EI1tqmYRI\ncCGygFLY9/kc4yRkWoCeYTqh7hlewAw5GtyNkv20n4vyi63edmkUmmQ++rzT\ndVOYp/VssDAwwSOCI1ldR/x6qQKe0/YrjwGosRtCRjXXCPYiNfYSDqfoeZjN\nW4lmOpMf1Xo6mvmd5fsUu6QI/h6vuXAFzKjly2DblwcsTTbp264LMbsNPQOE\nHDm2cbQarCuVa3yKRUUcDP49Yb3k/9kvOm5cM2Zw2ER0NwzC6O+z/Gkh/oQl\niHjWofYqsQJ/S+xdC6VmJaZ+7XyFLRlLzKXJ9ZELvuRiIqOLJ6d16Of3iIU8\nyPL6\r\n=9uxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIoYzj7NDTlgcph93H41UZVfFsrhDPzBxA+dut38A14QIhAKZ48pzME4s0BEE2v8PHnuFcAwnpQOSg3u46jQHkaP0+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-nortissej.bb-curl-or-axios.20180618234615_1529365844776_0.7342518364515205"},"_hasShrinkwrap":false},"0.17.3-20180619082958":{"name":"@atomist/automation-client","version":"0.17.3-20180619082958","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"1776b837a5333acb5104665fe9ac00bc1d85dc37","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180619082958","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TETzxwHh/pnXerguF4H7szW5mJiLnGIHC8vYahml/XhWVwpfiiYhxAO2htd7y0gOtAlL9AqDw0I47xhAEPrTlg==","shasum":"fefe7667a66671bc68c7d6caf72cb115a2bd8d86","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180619082958.tgz","fileCount":601,"unpackedSize":3347809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKL/+CRA9TVsSAnZWagAAUAsQAJ6uis6vM/drSyTUlB+k\nbs6RU24ofNKf8WusPVWWEaRcA0IiUBHMzat9N6HGCytk0yiZusMok4fmnJXK\n0/n6ZocrzxQyCv917m2GNVf24WRQlFAunTkgpc5wzjiM41d7F17cmqcScXS7\nQ296nuR42HYQ/cJ7Jj1MKzPrTeaq0neiZ2ogow6EeK6YuRw2cMZ2WEcCX5ht\nUJRU7Tz9L4izw10RvQ6alEZi2M3kd6MG1UNe58nqqDkShO4cR/rAxYe59upb\nHF2ikQeO96jqwfQPkh4ELa2Geh7Ozn3fmMJdXYpr3cCSriRDFS12uaOxvH9k\nIrfpt+AkqMlvVrHp+FVzTkbYPH8uEtfTUl2ByPsxnZdFDVr9yHTkIAG8ySDk\n5nnK/nuWIWt2sQx/58dF1KF++1L1b7iZHnSf3kPdsCUBqI3cBQ6+NQ8ZgtgF\nKpsBCQ26D16YptvZd2hUDiyFCUXNuHZakbnvkSrFbtpvnXW1UXjJ3snGvYK+\n2kDj7Gp9Frzgz7mLom7bOZNYrf3kpdWKShOxCThMPTGAhblSKNm1DHpA8y1C\nBn24KBVNcLF+aQolf6zR3nzNFvwnDtdVSvp87YagujW+mRr5FLgfc5BzYbfA\nRQ/SGye3QzYwJWDYM5AUPZndvYkOMeTAKvuO0KO7VdC13ZBVVOdfdkOVYXTu\n872n\r\n=YElU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsr19GpK5ZbtJl1+g96l6fCY9pczFzfl+tUEkg05q9oAIhAJMxHL2ni/PRJox6RiZinn9BU9kAq8dGxPQ7qMLZRwFY"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180619082958_1529397246439_0.9511893476391102"},"_hasShrinkwrap":false},"0.17.3-20180619092428":{"name":"@atomist/automation-client","version":"0.17.3-20180619092428","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"83278821ea4a17436bfa81203813d45b1653b230","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180619092428","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eb+H9koPb0YW20CvG70sFUnaOBjnPTxe1VdGVP3oqb6H/rjF461l35EiCgXRq17V+2htyKO9NYXUpTxWrakxfw==","shasum":"3f95eac286e98e6ac41cc46025a7eba73d4879d1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180619092428.tgz","fileCount":601,"unpackedSize":3347721,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKMzDCRA9TVsSAnZWagAAu7YP/2sHH7MzXu1kWcxZFPaq\n8xzFPu03h17lu3XsUJJAu/GXQuQW3fiJbykYhpsU+7kgO1A59htGVdld1Bbe\nakcMEg8e7wOJabBjPRSlpVfUwfNFrJyjFfv9w3EHdtHeC2VwYyuCgd2ACpzT\n+XM/KcyrJmIgenFtGZ+ygBpNbIwZcYR06B6zx5TLQpBIEdK7Ag0TtL4SUiqf\nOFVHvXsQHf8TVijxz70UfNHs371bHUBn/mPm4YE0ghz9GZ/UJFy4dmKvSkCG\nSFr8rkak9uW+6SZv0Zo1ZTmkZAWi2kFTCa0s06Sgv37fBq/uy/aVMqSk6lug\n/OhGd6dtbMWT4EYtQZ3RJlxR7lg+njT5ounSywXrLn7VGNEAlDRN2Xft7igV\n+gWRSR69J7H7czpuuEJ3Keez/8fPVI0fHoSBfb3HI8Db3LsSJOwGKaGp6/J9\ngViYeVKoaYPvTL0vBtj/0KsFy/SSsCXyxTFa6QkDOG9ywUx2jougp0YBxg8g\nIam1jJA8VcGT1rrT0fD4aB5tO1IL0K+YCvwLvQMi6TRmHuUnEmNXmhBszvbk\nGT84lKQ/fMhxCXC/5Ii5Edg+Fk5RMygFVqV/APbY8+TX0iAs38KkrPgKgqJ6\nukRF55s8/HKmL1pJ4GhqecwFX6QL4Xz7jxtk/YXruXGftj3SCVlWiFLRmqNM\ncLvQ\r\n=t5uz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCA0+L1HNiAsrunbB78BOMjQaSBhZV9Fw4JPeGx+CHcQIgV+En70R9I4AWiqnGavqfrb8jpeTh7/n5tIxEVlXVCmE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180619092428_1529400515544_0.11824342136138122"},"_hasShrinkwrap":false},"0.17.3-nortissej.pass-visibility.20180619201528":{"name":"@atomist/automation-client","version":"0.17.3-nortissej.pass-visibility.20180619201528","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"6b39da308451dd091e9e5f6050299bcee9a96b5f","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-nortissej.pass-visibility.20180619201528","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TUL9ZNHthFv/NpxS5jGdvx8sYOB5rnQl1n2PR9WFIVFEU7byg89n+4lf82jz7qs7AESWBHXgHkR4DfNyhjVO4Q==","shasum":"7d7d1d143813d55a8957c6ecc918ce85c9b43229","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-nortissej.pass-visibility.20180619201528.tgz","fileCount":598,"unpackedSize":3336560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKWVPCRA9TVsSAnZWagAA6SAQAIz+Z1V9P5F/w5gLMmzt\nTJ6cn2koAFTJI84GFU3T+LNbWSDhcFtj4TYTxDkMrPV22CmE/rilJlv8GSMN\ncYCl18g9VkNzSJgBsIrXp935ahVY3edl31aBcahlW72yTJu1Oe5mLMKchOt+\nih3iAb8hGwizCKiM+25q3GIo3lyhvkI/66N/fVpsmVpsn7M4T3hYYdmUVoxF\nUV41BCUiUHMUSgFxRM9wHDBVFLf2aQXdq6NvH+VsScwskzxHx6lT+ISrkICA\nxTXBZbfnOgCo5IWbJ3Sbvp7ovz57/KaRn4erSMcRsbVFeiUVORbGlgko916d\nIq6TF7ztUe/2cbiFn6+fMuNM+vvL8qX6+0Xsttmp3ftM+DrJhZz4Ma6G/eym\na3k57krRwy9XWynRndNdyCzCigVdRCSXE+oqVxdmjptD4R7edHvWz9gKX8YP\naRqbthUNjBqlJ2uhpc1B8/f8eorar6PWxO1rcnRDB9losdu97b2RDJrsEi/b\nxixYUYK6/zYZ06tjtGKbOZd+Y3cwyC9eaFZr0zRFDo7v0WVfl71zGIzc4wk6\n5WYJ7qkDrUZra1yI25czCyw7UoH226QB/ER28siJSuViCq3BPJyfj/xrY9PC\nVdHqhnBzExkeYWiqEH4EHGds3T4kC2CFZGWxwslnJIE7/TrsKL/ocJ+6Vnhi\nJQjd\r\n=zKNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC47x9GG/S44Mb1AKBn3GG48bDIsIXTWSNnmgmyMAn1jwIgbKMZL943RTpkMv9HAmppBjsnMFoGgga731LSY/3FT0U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-nortissej.pass-visibility.20180619201528_1529439566868_0.5408399649652822"},"_hasShrinkwrap":false},"0.17.3-20180619201819":{"name":"@atomist/automation-client","version":"0.17.3-20180619201819","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"d5ed65c8f53774084c7aad710c4c1d0e979a727c","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180619201819","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7zxKcdXIRQBOgZXwGC9L9CR2ObCQxPV7Bg2b5IHrx6R0ONkIUPkGcjP59fDHqTPHadV4KqTCXk8RQnBu6uWxYQ==","shasum":"b5839e5697c50c4a41e081130da6ab53afa56baa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180619201819.tgz","fileCount":601,"unpackedSize":3347739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKWYPCRA9TVsSAnZWagAAfacP/ikDyGWcV5ShroZTJ28d\nEABK07bPI28YesMBpNAYJyuXvTAI4kG7NvU1BpPredARCMeiZ8tZsr9sSSdW\nlYrlafxhhwLgv6fI0yLZ6klkbLLHZfWfwRh2qmwqMVWt6MHJT6kK1QYvNI0u\np0XbB/Z+k8oRko35k0uyfp5xwZtweb+ED2JNhIOYBJEIKgX4VKFhTvNW6BhR\nL5Wxu7eMl2KRMp4D/qoabb/j2yZWfIZotjmTdEuJOszAftBpttuJjmlTYcpm\nKTI9Sfx23b1x81Ow2p7TYAefnzYht3gXj9934Jd+rxdmPdzv1MT4rg/5mQNi\nHVWde2Xo2Ey6lCsyv1kjUTrzxM9rT9Wt8+47GhKFnb60gZQlGSOejHmWyz7y\ngmfQHN3e+VIOahm4gI4vjqOiGrPQ+jEsc/ZKYg7JoG/n0AVmI9hGUmC9aijq\n1jLZTgrJOblZemBs4ttoTE7a3CjsKFuQC/uR/qgZg8lDk30W45O7ZUPwlWf3\n4XiEDSukIF8tkbO8sjho2Xe+ZTOft+IR/DQ4wZFbc0/hT8EvjzjJx2ztOofu\nknoZ99jseICiAFpuecegsqs26ExZSRX2pzgy1Jg36bRNYHT/LZYQd9njATPL\nJZCEo46yr95ygISofrvuTpTsrLJaQl0oe33j2sukRaGf+XpRkcAcqC9ohdhJ\ni0t3\r\n=SytD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmtapHlCrGSvQbpeKLYBKhru2R4ATBdaH7PuVOUrn+vAiB32Z9S3iugyjMXFfK0tVdZPoQ23Tuk1HLqcm+tnett8w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180619201819_1529439759670_0.25144706519501536"},"_hasShrinkwrap":false},"0.17.3-20180619202126":{"name":"@atomist/automation-client","version":"0.17.3-20180619202126","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"27f61285853107518555fc1a34a11ec6136704e8","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.3-20180619202126","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oGb4vzRbSO5Tb2NLjvTPMUzBoSUJczOfbmWWAaUMyE2n4Sl3BhAZ+OL4xOVZljq8uh547zaRk3NqBOD4Iz8cJA==","shasum":"eae87beaa1d0ce910d0404eb8bf850c01176dbd2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3-20180619202126.tgz","fileCount":601,"unpackedSize":3348115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKWbBCRA9TVsSAnZWagAASjMQAILmsqEjlFG44wYG5WXy\n8RYPsey5QJZ7rPEKWswNQ8xiUgeKy/gZlIXxG74yf8Gt3YIXboIszLmwBc06\nGoaxFzGCTuY3uNtMIK90umP0P4t9WcbBtITffx5wE+LjZoe0OzntfGzbjw1j\neeKM6oavsJgw9IU8fEIvdNzIR6Qk2u4XOvbtZQ7oEMogEmCbvS0aCud+oLRc\nVmhF7MiVwQwvVueugsdVLbYS8mS8+VjXSNIJ+dgFp+J2ZhTdNTxeTg7Wd1fP\nSnLYF4eOWDUIiP2mEZhWSBfRmK18jmHGg0U+SNtjykjL9cRDrQjbz+bb6zyQ\nWINAS7nXDInTf1WDLgkLQfSe6EE9I8YrxnvhjREtXsNk/+yzBKN0ak72sCoZ\nbA7S23KJ8kRm7eRdLMD0Uamaqgr63s3CQ7V2sjVrQU7/CZZ69ldbgGkjYFC6\nLmwvIgkvQuUwEMvbibX7W8P0GB891tM+6vqy3IfpnCQ1+c9EReT90ggsQiK5\nTo1HqVBG7BoSuQysnjdEYcbPrnwfKrRCBHjq1SLXH+8Za1Bsa2bEgCgE9qvG\nOwnpOFT4Iccbtst11Ie8E9+Vgk8ypWJjOUIN6Y2JfYDJLMiMVVR4og4+qE70\nrScw0bzs4q67hx6Xyjm8IEEA7UGsWJ8UlpDyKVXYkIp3WGyJLMV1PK9wFA3C\ny13I\r\n=rPK4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB+73Olz9bNwBsqVSxX85HArMWfx5CZ+38gDc+dR8zt7AiEA2qfhwuhJExpk1Rb7/wyUHOoUCxJMaGS6f0qFCJYu1Y8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3-20180619202126_1529439937212_0.7542242781029198"},"_hasShrinkwrap":false},"0.17.3":{"name":"@atomist/automation-client","version":"0.17.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"27f61285853107518555fc1a34a11ec6136704e8","_id":"@atomist/automation-client@0.17.3","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XTMmVb2uXOXn1ehTvDdAmgR3REepVA8EZaQwGdXXeI9wfWZgbIR9e0tmd4DpYaszOlIZgQqN8QsAQ4ix6VKDqw==","shasum":"a205fa9a611a1913afd4f4cf6bd05ce6a40c2afc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.3.tgz","fileCount":601,"unpackedSize":3348100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKXkmCRA9TVsSAnZWagAA4cgQAIj3iGeGd6Mtmm9dPpQG\nyjnjk66Gff50dYCjvFxII5Sj3+kVnURdrfSAUvpccRuIsnqYqnK7qdobNhlY\nJvY/VP5G80Xkc4UDcfoDI7WhFRirS8vhIYWfsllJfuyQgQKGGLS1b78cjBd6\ne5ExPaAtGnBMuBVsu9LjuoqAggVLVgnLtCFo+3vx9nqjit9WF9ClCrLyrRSU\neZtltvBghQCqFJz/nlLO/SO4JMWq5izbp0mB2PJQEc6MGOYQOhYLpDLK5lLa\nOP3ERrd7Wq4MguV9NEnjR96oWFqnyUnDRVj1qArKtvumTQHHsnipSG1+du/+\nJ3Fj6S0qxfG/Jp5bXKOdFafqDfZfyWCWwQ6ZfmhsdmwCvPMVm4tGeKRWKHLQ\nS1Gin2KPtXAcEaxPqr6Ci8t2i/qLLyFFtxoqCMvhwoOPp3bw1M7AkzvgK91p\neSaU9xSSBYwSKHDf3Zt24dpVhwfevGjKP+jLND8gsZ4RtRqbJB8tRJ/r7cyE\nfBAdVbgXZYMfjuscszVHlo5kPmLVjaf8wgYL8rzSE085Iug5gRYr6Bliwbnf\nHQHd6mqrUwuul1FAEU8vfR/hIEImFPFgDrHXFoBARiM0jwn25q9nk83+4/K6\nRSH6TSIHpfbzr6JQ0cImTx5zcVCi3NwjHpjSpd96nY9k9dTCiE3N8jz2er71\naine\r\n=o5a6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2Nk45J7DQA8sfK6yKUmX8EralPcv2BR0RPivSn19MqwIhAL6P7CORiq7imtxl9rxFZiHkDLZxU5zcERb9C5A24R2i"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.3_1529444646216_0.2316549360876008"},"_hasShrinkwrap":false},"0.17.4-20180619214533":{"name":"@atomist/automation-client","version":"0.17.4-20180619214533","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"f012682c8ed65a82e41e4ef6724c0dfb4772422b","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180619214533","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fh7bRHs6PMbzZYqIt3CgP6PTe3VQ+SwGB+2mieaSdf/gjlkiyXpmQnk4ocWODfbGx/i40Gg2RU2JTuOvOkO1/Q==","shasum":"57b98872e8bcfafe1a50c320cb8d3cd375173f52","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180619214533.tgz","fileCount":601,"unpackedSize":3348115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKXqDCRA9TVsSAnZWagAAZVUP/1h6SalObATG7UhhIYoe\nj60CA8m2dDyOniqQPOPIrsUL6q4uzgCurOBVxoCk5wUxiFJ0YLjy1MQRrDaO\n2T5JHWVrCyvYYTcfhbH+vs1C7DHjnOpZmdWrlr0e2lps+Ddp1PGFJus/Q4BF\nezDOBgkyLYcuiOzkZ1UJLxiBkWrW2WNMLWHJruCTXNUVXEwGOvHS1xqL8zCu\nEjwlk+suI/BSfUD4O9r4lAn36iILTlVFob5Fi3fzTu8ywcENxV15eEtDxKGs\n9v4UGNPljir6+F8gFkFlzsRxD1dfTfObKWnt63b1/uVjVC0G2D/7sG+0vilP\nN/XO+DCIotKW1Rfk0gM+mydbXNoAu5miWFoKvkniI3uKpekA5APpTKxPDEHw\n12o/XAlRFZ2H2MwcL18sT6mFDj40uKzbAKLvmqrOUwj1Swp6uHSo4z4s8M+R\ngbOYPzAAJXpipEviEXTmaKhPlYgxk4Ew0ZQ6ZrETOtv8gQcaFe2Qww5HdN4R\nFvCxbcUF76cob9YtX2adK8YgdRKihgGWJ2/R6xzJ5OwFmq/TfPFa467Tuil0\ng30aDU5Y3UN/nkdwyIkgIR/cK+Jg/rvTPQMiziYOA/O9hQ5PsHX6VbAZ91SX\nHKH5eIABqrSaUv1tcOIqF+GDHxSwIttk1PGUwPBbD5rZYCl4HRa4HIMziJnO\noi4G\r\n=6lRc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXLJ6AdpGS0CRIVYErA/8/Q9G1QAF6ln5ZGGaPmTtk1AiEArN60h+6EqsDphIau3QoQeutn3QOJLbu/U8bClIWK318="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180619214533_1529444994961_0.9455985539152483"},"_hasShrinkwrap":false},"0.17.4-20180621144910":{"name":"@atomist/automation-client","version":"0.17.4-20180621144910","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"b94dd330964576007776c52b68f8919aeee70ab8","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180621144910","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sGhe7W1H+XanYLuiFQvfCMkF+chrK0hoeM8SFKMAOYlCPfeUxVKYQOBYFhs85gq9EhOpS0ESEF02GkxSdTVrZQ==","shasum":"fb046ae3ab664bd9a0d04b741563f653b2adc743","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180621144910.tgz","fileCount":601,"unpackedSize":3348920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbK7weCRA9TVsSAnZWagAARZkP/3iif+IhN9zGDnHDBllh\nYtfgAqO2SVQw1tGAobMj6UVR6LnQ2w4kDXa//PAyI6QXFbZ0dNBv9fu3kfgF\njdRH+2rClWxeAzgE592/dmonTd47TmNFFLm/g1KypodOxmpSkKHdQYdDRvpf\nr1eGg+CTa0oCh1a4hzELIOtcWyX2iBPI0vfTiAIfPb4OMLzgkNqFohaysjui\nTYdj/YQZdDrYOOM28nL7HD6tAzx+sbTujdcW2Ke6610e+ZBShvcgRzGhLaSb\nJmUuiDfvN1Z/nbPYOuZhlY7SPGC5DiuKI7y/uyYb67gXqQkEHVM6oRjRIPnx\nZ8iKDu4XgElpTUReEZykI+ePJS8AEkOE8kKYr2F5KPecvYtaBoM4UouTs9t0\nYyvagTFQXcM8zwo5r3wwMsWwD+AMWV+ZVpKVQ5VeFHK65amJiMk1ZRmDGaP9\n5PQOwVujMdPzohbsFA1ze4hMXNqct7uh45lzNXWsrRFzWUmzuqn/QWp75bY7\n5ThB0HjWiCSHuseJg0fE1AjzYkw1hJmpC3Q+FZe0ENqo6sfo87r0fNM6dkLc\nwb8841FxwVJcPmXWIn/RKBd4d+9681U8P9pBTf4pa3KsTkMhKrlFLz8PQ15J\nsx52D/fLTiGziBOA/ZIiQQngxcCfE9RybJqhL3RDhzm4SPPya3l1qxK18Fme\nWFKs\r\n=If5/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo6IGFt4y/YAuj6O5cZFnCdcAYdZpFFqqNjJXCzjCXRAiEAh9lNnJBjFC1Wr0Z03NKkXXC4jOIuxJVKTVlOXl+dtHg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180621144910_1529592861840_0.7545224913384077"},"_hasShrinkwrap":false},"0.17.4-20180626092108":{"name":"@atomist/automation-client","version":"0.17.4-20180626092108","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"8cdab4c8f31d82522b18f0cf4ce483c848671b65","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180626092108","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Aog8NuGLN9kJLMS+qKtHCsdVPhfoMTx35IPBqd5h6gpBa+T5EguJDNDhRmgVlAvXqN6RxpBrLLCI7zS8Jw+JWQ==","shasum":"912d532ae88da76eccb228a374470c5ba81c1e8c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180626092108.tgz","fileCount":601,"unpackedSize":3348966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMgZ1CRA9TVsSAnZWagAADB4P/ip8vIgm64c9KTZxKSXL\napPV3HBYmg75eynleAdmXlnSGj7vbsajpMpjYxIauLmJ4jogFFQJcObJ7QZU\nPJ+kxME8ZEUSYaBSGc+vPSBz41FxdbXIi0Pq7oxicJ06ILMq09Pn67ugCygf\nMVSwn+yw1Y1viQl4w2K3IabjtJdyj9342w+HCDV1v+ESPed6/W2Dnb0Hczl4\nzabs21gyj7pcSi2dpjrxWq+1idhsAuxClGvK28qRw4V9d1T8J7DMfBuZv9RV\n8Zcn/hbHb5KuJosRhnPvsHIfwR8/ABrhH4yYclUzSvU2h1NJZjWDm0Y80670\nmTQ6eKvu6/ohLcDqxD4ViGBJKWgv3I4J7DvRvhF/pCwelQqseCE40F3l3hXv\ndcCpgJMb3OW3qQInziTNAsl6KO2raFB2MldJn23VCDE63KMiD8wM6qwHtUsN\n5u5i0Y8arOTfDzXOxce94ladaRRkrfpfGDErC/dDzlY0Ely6OMqtClwzFlOr\nuUrYwLAQGyHOiTmZblHcp6gJXNtjrjFnTVYRlseRNm+zQe0UQ5Aw8c6uY4q9\nJfK4vpt6g+S1zptO/+qVEg7iG/R8bgLTzWhWSxTDLA+qU4QsveKtHERpXg4I\nYI/STkXxnmcbA/fvuVUbjVbfeOCDqEzhxj6MGZBtS7cZrh8PXbaTwl+2StQ1\nPHgr\r\n=tfip\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5y1rPl4yUL7KOTnrsIi906KKzlvgIgfauM+t8YLu0FAiEAt3EGw0W3TP1LQeitGR60nS9jrYOBZT2cdSdI/7Wf5NA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180626092108_1530005108887_0.862789432888744"},"_hasShrinkwrap":false},"0.17.4-20180628122721":{"name":"@atomist/automation-client","version":"0.17.4-20180628122721","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"899e360cee8ab301b413c19b595acb26f80a9aa9","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180628122721","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FYJ94uAjWkL3d6/dH+tAZrL/95BZrU9m8jvilBJDlVcGCl9EMLfEjdvIgqUz18yQkbf5B3xK02MdamKER3GlXA==","shasum":"5498a1efd2bb794d4e18ba2dadca057d42fed831","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180628122721.tgz","fileCount":601,"unpackedSize":3349214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNNWGCRA9TVsSAnZWagAAGRoP/2CIortywQaSEYANfr2S\nWmAl9lyF/bQHYPYrcdEcLTfMH+W4/cW/Q4v+xRTl7QQA+3mdvLIkfmCsKkka\nU6TEGYF9HL5nERwkNyLhtREQ2UFtcKhNbnisEL4pwsrJJuHDzpNIJZO152J5\nAVmIlDIexh8DCYLv2cW2wVZkkr8T6LhxCBvSka0Zxj9V7uUiwIiTdmJxwSU/\n8QunK8/bi4CD1RPLIY73Q3Ibij+g4VDzLJE+Clpt+0pg5G7oHW7bvMc+M9oP\nzTwV9srrgXlM68AY3OWbICNxZqa3XaLDIZHKOZF+G3x48ZGfckABRkLZqJxY\nZJZXMGeBKZkgurhL7YG84AQP3zSWOFp35nQ4ftLdODnIvosoRcVQIjPaY2+Z\nlIBSFTv6oYbcPqb4TheDwomlkf/WAea7oSSXUY7VHBQlnANiMBBtMtP1m1gT\nOXN+4eRaXP/uhrMaq6cogTb7z+fNMRE1rEmii6K78e318Ue/FLhX48vCrCb8\nGBRDKUtYY1GUX+4khidlbB/f0nzTy/Ow4P7rrwrO15w/1thn8EEGEZacAtbT\nddB0XfI5/dkFqcjrpKuEWK6NEsL1GKSGr9y72Q5LReK2rI9EzGyNxgy6iBLX\nXr35h3i1YLAB4BI872RXavtjAv1L6SsIUWmgEsF6QQUbfJcj8zeX1OIzhqrx\nX8fy\r\n=XmzV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1Uy5zM4sMRCJLJDIZepspAoA1ltsCUIcgZCwUFlPEOAiBzrpXq0853PgeBW0ls+xOUGlV8qEf0XRZ8RwQanGLtQQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180628122721_1530189181498_0.3517056605189026"},"_hasShrinkwrap":false},"0.17.4-20180628124808":{"name":"@atomist/automation-client","version":"0.17.4-20180628124808","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"899e360cee8ab301b413c19b595acb26f80a9aa9","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180628124808","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-kJiuYQVyDnYzWYOSbstliEUa7bAzU4CLM15lXnB6MWhcJCj2xmEcuNFxhMdoFbDvRZ9h9hmYA30pdQ3t3tAZOQ==","shasum":"69879b6bc83c8643ab05357fc0c88455a39e21b3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180628124808.tgz","fileCount":601,"unpackedSize":3349214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNNoHCRA9TVsSAnZWagAASIUQAJSdM1PBGkWIYIRNsfjr\nX5XGdAsKbDoIzS688eNBkHyX7dDOnKtyZdznsSDG4MV8k+P2NPzKPkMqWEcL\n0zFv0c/8kAI9AIU7jNE5vujWyO5bvwsnUV8ypbANIHEAkWPM2eVInv+VzxA9\nnnKXedceD17T9+3FygKnMLbiRE/B5XhZwZOSC1PGnRM0CcsT01p1uiDcXTwn\nllaUcjR7Iu/NP/1vQhlYGFPvVRnHUDRE7YSEdPQ5wwBwoD1wc8HRGIzS/TED\npdG+qfjIFn6rQPrjElNgZ4n5iCIAhKLPxn38gKyDHERpS0uke0Q8B3fjCjj2\nj15EjoW+owje5TTXzKH8VFXh8A7NHZNFTHr4ySWZcPeBsfSkmlfrAdS73aHq\nl/gqsFwu51mfDZX3P65/FJtw8rjlaL8cqaAcGDnjuOCbiKNBUpQYNn70DFJQ\nzMgTHbSTZbJDKrcOoBarzM0X7IyGbiXDfJZoDShPa1MxS1RRmEMeYon/PYuD\njBzfBD0rW2bCtXf6ZfJFju/MHZhzu4syPbaUlsBHscod4AQikWLvk9APMWG2\nKzSKp4YKoulTlQOqAX77theTvTw225UULIY2XvlXj+S6iU1YQxeAgyVu2VjL\nCfBDn8Eodqa4ILaYcynnKv6dDvmkhDgfY9h+6wGZPOpBzUpbgWKga4/oGsKR\nGmIy\r\n=XQG2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgJF1XWqVXOwe+Iy4Z0hjy43MxW+2Gwyxr6+CuN6Ey4wIgVkytfPnweXU8sLhVCVx6PMJhjZJ92Z1sEWV+jLQBa5M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180628124808_1530190343630_0.6483479856944325"},"_hasShrinkwrap":false},"0.17.4-20180628134316":{"name":"@atomist/automation-client","version":"0.17.4-20180628134316","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"5b35265e003a9f168ed01dde3388a4c1ac54f092","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180628134316","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7HnFdoSK/ToRhhA+j+5yXhbqJBUvRoaIsC3ERsoNwHW9igm3D7J2mFXhOybGH/xcUiOl64mpK/byaSTAsAppYQ==","shasum":"77cf9623a8985f0e61818ae6afdd62989c8a8deb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180628134316.tgz","fileCount":601,"unpackedSize":3349214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNOcCCRA9TVsSAnZWagAAMygP+gKtv4V+Woi1/lfiYJ4R\nry+nCjdD/KB6q1GxuNEF1nhY3BWyJZJNtBwuB9Ur2kYxmgFcAtyC/VPsgUyh\nStf1f93kfv/pnZ/PIFszU8XeSSG0dZVl7E4kd2YVDzWFJd+OzhN8k4mgIvXI\nRKcikQHWgGsO/tHmwl4Fl4MHPLJqm4iA0Pr+855nKOX3EqWIDrTRbOe4UTKZ\nwxknDp0N6Qq7at8ECXpkHnPXoEiqEyXzFtgrVeol6vkhNGW5fqBv6Xq6yAQZ\nkG6XdT5ZitLxkjrwFiMf/nGG8xAdgTdG3IiKf+pgtWVAaRMLY8USQtDUCD8f\nvmyAjyRRI806J6Xqtpf8PkSZn6VaPrwMZ/0UO4KA8a//XnGPaQEYdH2eL163\n1L4/dxsKMiP1EJZqdMmWNvgPSU/LRZSMHtynSdU6nVuZqnrh/EMMFjQDRmlk\nLsGZLU1oHnQsUAa1lnMTZuRwQ3e487+jQS0YCKRlw1fqmmKRA/YViAa5hOrW\nwtX89TuJRrT8D3WsFOsRF/KPtFSc7JV1fAyfrojKxSvtBIwjrwfUXP3HnVP4\n0PVNHEOLkZE5x6FDgbVweN8ESe+Fta39IJA9+ZOAQYRGOZ9moT/ToX7dD6uP\nDK2z59zFUMvUN7uKk3OJRDh65jzCWj+LSarT2SFoHEEbxwMM96lHSTW22a4W\nvYZL\r\n=NNPV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRCRwnLXfhPPlMWi3eOz2WXO57wt67r4EKUQREgLadhAIhAMdLwzhQiNDEaO4TJg2gmRRGgZ3efY/uPrTMuGaDcJaO"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180628134316_1530193665840_0.8052393613239461"},"_hasShrinkwrap":false},"0.17.4-functional-event.20180628192301":{"name":"@atomist/automation-client","version":"0.17.4-functional-event.20180628192301","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"73d3b7917af252cdf0b7da08f480da643081b931","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-functional-event.20180628192301","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8I/hc90LNqyaonUdVt1Z7rzDgDCr+cZfpPaZmRy3RctvaxWBya1GDXHfgxXSKlQ1nRZdCRKbF5kb2CqNbqASLQ==","shasum":"1f3deb822651905e397dd7a7562db74906edbdc6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-functional-event.20180628192301.tgz","fileCount":601,"unpackedSize":3354903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNTZZCRA9TVsSAnZWagAApBYQAIND64xrH6gjCzXVQ5g6\nuBeLaz+mq4n6uWlh2pPLRyPRx2mmePchzItNS85BAm2sMJqL/AJCEYEwYmCN\n/d4ig6VPG9zLBgpTQQEB+MURhgB7j0kNZb21ko/se0A7UlPD7HhiM6TQJ3rK\n8LktKNvGE1WVsoT/6bbP01/ACzIYVROZ4YNkai5BP7+wRmNtdGvaMB5Bj/jn\nGp+NePppAzTEruUY4DLaI66Pgc8Sc0r4eXkI0uoZbhXmQtdX+GltjRGl5NEf\n7JEfgk2pyIMHspjAw0SgO+dw4JtzmC+pY5h+rJXoDJPJIfpXf24KN5B+ofjU\n7QsP/VqFqkhbHcwURZhoAUE0oFvFNM0PH6aJVkjRN2+sHWj3QweSo8hRLx03\nCK+Wv/9AdQNQo7roGZKMm34a1EViZQvtA/nplPjBztUvQ+rEHL5Tt5W7Lczn\nIWnojI57du3ZhUfTRL63zJSumi1VBFQA0L4Yb+S/Z/t88JYMGEyVEF5khQ5l\nnXDi6L/cgmLF3YX0PKrQl1DO2IbPHNiRLjfVDTHvyQRY9fNzsRmdSQD3U9z0\nxjohh21aXykar0gBauLnKuIGHqvcIbnQfJiiGNM8mPLxNp6m0AbKhrgWKdZb\nyz2bMf8UwR01OVzwiTUMPBEx2GxK6y/Tovjm414Veeb+hXpZoOQvr1W6nymv\n368m\r\n=ppUe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPXG1Q5gV3AFaH8fj3+dbUEhVOqsSX4ZHMvaigI46CcAIgCgwxLyzpcqNUknSaAQjbcExrvh/NoPVQkJZdgRrX4MU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-functional-event.20180628192301_1530213977081_0.4458403227739416"},"_hasShrinkwrap":false},"0.17.4-20180628204109":{"name":"@atomist/automation-client","version":"0.17.4-20180628204109","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"2bace46634a95ec94e428498830301bf20e938f0","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180628204109","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yOtmpZ0vUkHwX+HEoKsasEzbR0WpSl1vbpkokBDyDTf3dnxR3vdJf77Z3/Ve2xRdTct807rQhlMfjqUlvvi8PA==","shasum":"d15e543095d98167e0e3b19a1ba7a0589ab76355","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180628204109.tgz","fileCount":601,"unpackedSize":3354886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNUiUCRA9TVsSAnZWagAAdvoP/0wx6JoTB4qOlCEn8AjQ\n9VJdtxpQaEqty7PtnSTmmU2QklcLjnChNyoKqTJX9d+6iVuKPHL4QOetGmGe\n2fIXrwoToXUwRBfjspef41wbL3exlPI5/ZQBixSNY0JddvRDDM0leWvRloBi\nmiVpf4dptubHyUAiwtgqxyEn1Nwr6MByV5Yh9ZjDlbOJe56mVBS5d1zh8Uif\nwF1zDBbdHXzuBkC+bOJDzmN+JVM6Izhv15sIpSQ8ufhjrk3KQBMK9P9TDA9I\n6k1hPZfKJ7jdmwCy1rNNKQj12XAq4jaCEDsRYFUeK7BvmHc5+z/blMTp76YW\nYFDNXaeFcydwNxKX0ZTlDREVaJbIoaNQhm9NxSYPvQ33zlnPv1wAXk8cKA/1\nqdl8mBs8KgtoCkQ08DCe+MC9WWH3WoxU8vFUe41rF0b/V+iIyz7dmXfT5WT/\nrlpL3Y8GxCm0clOQPs5GqM4Cd2brX19tWSRSZbDnL6qk9voPqiZPfBlKJAYa\nLjjnkGai7VradxzpmUqUMDuur+U1ghVu7iLGQOgYGw+sw8S9qy26I5uT101R\nMhDt7De70OQgTaOf7shQlr1CrVgLjCUSId3glJG5NqvPHK1TAT/001X0bfxD\nqEANd0rqqGEpq9CXG/Fp2ysJEXW/EOIi9DYUW8hGw4Sox4kTMFJwA5J9m24D\nznIe\r\n=4zNo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9LcqL0Yg/Zul06kZwBnsRu5txRrTGXcsoNPaN09C7dAiAQBeraNPiBi8kLSwV+dxDcuMnDvTVxIWcyleVdTw6Bog=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180628204109_1530218644310_0.06745436251823267"},"_hasShrinkwrap":false},"0.17.4-20180629192728":{"name":"@atomist/automation-client","version":"0.17.4-20180629192728","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"bed52d2761b1ef11767bc1f5f0affc65acaef3e4","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180629192728","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-q1FCviozxPkh+dE1k2tZF1+tN/VnqeJ9jaI0wQtwPL1nNFVtZX4PgEY5dnoRxI2v4slzD8nUgJ1x3gDDxDk1Ug==","shasum":"08326b46fdc04411e46db15730767c34ceae03aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180629192728.tgz","fileCount":601,"unpackedSize":3356068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNojTCRA9TVsSAnZWagAAwP0P/14gY/FVlyCTZmEM1+yw\n1T9Q5eDNvB3FeF8UR+ytgBsM3NKFwt+yU0fPmkOywAKypNlie5CM+N6Nm2Bs\nJDp6fZ/DFVyVzZma/G7EjR6V6h69C+XpfmtNyvtkKMo9N1RDauMg+CFLZmQ1\nWupMqmSc9E25OLCsCGuIZCNHe3IbihkB26n2Q0hunBSQmnQHGQ+yTEiM5BxT\nfeotZ/uhMmZHUi6CMlgt86sOSFZrAnKWx3wLLFc5N/6e3Afo9oeP2ahfGuNe\nymOVGmwFdoJxcVhZY36X7e8IdHTqFaZd4gVN02Y9tuGsUO9GZ35gcbrUB1Nl\nbhpXwvJmD4HR3/CqILXlaUbfKXckKSPiUOeF3rsxXUIaCteCJZ95pYFIO6Xt\n/pbJEYoS+HWVRF+Sku3rED/5hAqGJBm/oiLhJHZIkeezK7NUw4IwyrNmVysL\nN2U9FQhcnYgq+axfLK9rPL5Gxcrd0c2H40l6hOs2zelOA2ArtEDxjkMTlP2v\n61iwfGiaFzXfFHljeZ/F8zr+LWJy7dEbKl1B1bpp1GaHGeGlxXgvI+K9udrg\narUiExOKi2gr417YUEpSiIitgxVu1Zc0S53qFCZBdOjtsvWqj5y4+DWdpaki\nYFzMG78+WSBSsW2R9yYK9MdMzTJ9hHZzmNTKUaQCMD+dY76J+snIu+aNS7N3\n53RY\r\n=EElb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/R3a5W1BDBbUSK7qpaIub+35GFTwWtgk7/HpftOhVTAiEArGp17lOcE4cYZHRyGMX+Zhmn3GCP0Nsr17VBDWa9d44="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180629192728_1530300627145_0.6232242942504367"},"_hasShrinkwrap":false},"0.17.4-kube-cli.20180629230320":{"name":"@atomist/automation-client","version":"0.17.4-kube-cli.20180629230320","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"a2b88ccb51986571a7f2f6cf2230ec4e635b94b1","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-kube-cli.20180629230320","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/LyXVLDpZUrBisDj1SDhRZeg3MKZuQNaFF664ggZwjTL/Ek6P9kXNOJYOFheBrJsizQrM12pXUp4OY6LwrfXWw==","shasum":"73acffba417cfca260811573fa51b876aa0ba2d1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-kube-cli.20180629230320.tgz","fileCount":604,"unpackedSize":3364565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNrtpCRA9TVsSAnZWagAAkxoQAJ+eZkjW3pB1Wkk8hQ2R\n/JjdkUS7HG4uSFKndCkaMn8QVS3Ubh9pPCa7JrwaXX0GtVdewPeYQ/dyeZk2\nz47LurBJbT/+oQF92dr2Fz4vclhl0gjk1uZXAydiPh6GW/J7np2avNjWiTVo\nxOkLKPfRkUFrzVUlcP27xJB8ddV3eAnEx+rrz0pBX+erageKFiPx5hoEhKbI\npaqMCRDKjQ9ioqM0ymMNg2oBL5xjKipNxPkNw4S59T8uqSd07ENmknCOeMm7\nrJ1bz4XQwflIi2pAmzg3cJmukPn4kWjpIXnJ/OyS5q6TYUkr9sx7z/N+gX6u\nmacxVn+4teIrKGq6+fWGc5jKXYZvthFJ1I+4PhudCLAAfXTOc55jgDplR/iP\nCs16SvwFPgwmQuT1WxDltEUwXnfrsbTmAoOviphYT7Zfvj9yAtxt2CiZJBW8\n9idd+OWRT2D6ptHAF22qiN+GRkmTdg1ebB7XhR6j3r19w5nJVfz7bu35udhJ\n2/29oakDFXJv2uhwzPY3WYAS/vtykrGLY3qG/VMF5NlviEAIobUuztv39wuZ\nIeb0r15tdO54z+3pWVgFpx1toWHZuOWsoPyp9xwY2JrGLz5ziM0Mrd/xcJFW\n/SMH4ixOxQtvTvXNPQfrljFlILv/kuFneGeECOaw8SgUx/+bKBdNPAPEddAJ\nweuD\r\n=6G7X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo9K1IfFioga2f3DUmB6sB67JQa82CZDrc6yVYB6+5ZwIgH0Snyrug/keXq+hYmaKxs9SrLkWmMOcBzYaX/yt9S6M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-kube-cli.20180629230320_1530313577085_0.2049689907947605"},"_hasShrinkwrap":false},"0.17.4-20180629234329":{"name":"@atomist/automation-client","version":"0.17.4-20180629234329","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"0db562deb31405f3f2c2b4d8a10c60f6dc0e45bb","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.17.4-20180629234329","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-zyw9/Yb7UhpGSjImZx+VXnqf5AGds8lbOr5gmitZtbt5MfXuLObmm+d1EXO6sCgGDb3w/r13KSezMfqwd+pPsw==","shasum":"7f8ba75069462e57bb3842e3c32594d4b30acfdb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.17.4-20180629234329.tgz","fileCount":604,"unpackedSize":3364556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNsTbCRA9TVsSAnZWagAAyxsP/RUHH0OQmDfXo6+clQsU\nR2LtAFl4N1hQUbQWJPrpHC6iqHyjo6NAw9YSBAtBrq4MWKy5goWAlrPqO31G\nPixcp35d8eA8Z1M4Jia4hUn7SWqOOmog4LFTMrX/uxhzvef6d9oL5TogzTFV\ngfSo3uWAKy9+4UM5ITNt+gR5YR7G6P2mX6xnXWuuZSySoMh31z0/Znf40JTr\nrK22yoemiSIw61QyYLfDWtuq27FX3WfVaGURDvIZCOOZn1rIWD+4rVJkRB2C\nkBe2j+rRw5L4O3D/YjOoGhEQ4TYZJXOK+1h5ngfS7fI9rMs+PrhZ/F2j09+J\nOnK2W+JVbjdqLWguQgr94+CbVny55vvLph6VBJKnE/8TWLGdU1kMY4ji11NW\ntXYES7T3YbIgwxy2cZo0U1LrNh0ZpGWzq9uUVDtFQIxh6DI+4Q5lB0N4ZcTU\noWwuz+HoF+/HVGB7tNZa7TrDVhoNqacrjPEQ5IDPaO1rPf7xhtLook70NjVA\n7WNVDPVRayf6PotG4FASi4IZtwvbvRNqdjG+QBFWqTnF8pvMmEtuiGOV+3tY\nfTSWSUoQ5ibdACW2ziOQzJe7Tp+DYdzd+DNybQNUiVnuQVURKdo1g0w6Wfyc\nPl2/K5fJBv7N+DjPiSAxQOSGKjqCWf5jurpoeTVJ0U27P+6laLwq91Qo8gSu\n5zPP\r\n=JeE8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCagXXvHwm67bbdyOms7WtApHWN5Gz4I9c6tEBfPSBKcgIgZqpbmiGQ2cJEblYENnmow39J0WoOMfB+SSPYEHJFbVI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.17.4-20180629234329_1530315995088_0.6031213758302258"},"_hasShrinkwrap":false},"0.18.0-20180702115218":{"name":"@atomist/automation-client","version":"0.18.0-20180702115218","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.8.3","typescript-formatter":"^7.1.0"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"8.x.x","npm":"5.x.x"},"gitHead":"83327ba82f5b7cd4fe786f414e4eed2895a604e8","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180702115218","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Qbz5Yk86Hr3jBMTZkcSJf3+G5M0o7nhTDllWTXMOOXVJHyZGvYHCVLOVaCNR7hXytPvZGJmHJZS+CqdynwFSaA==","shasum":"3168cbaa41fb36b547cbd6e14d3e0e1bd17adb74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180702115218.tgz","fileCount":604,"unpackedSize":3361189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbOhLCCRA9TVsSAnZWagAAM+cP/AoN2mlmzyRSfHyQOC+c\nQ6wgRU6Ehd2kNfIBU9gXHElZju7TCjYbCKhHQvs4cdrKRxj+g/QIaKduUiiD\nmcPqQRYv0UeaL9nTw+SKqeN8rghiehrjo/Hg3hCpHaAzBJ7iJa7WXLWwTtJT\n3HKiiggzqf/+KNtRdxw/O5678f5ViJWCix8eQUKmZTQh3Ev0ISiN1z8WPmdI\nqS0caZlQn6HUKbu1bboOxsuNRsidtSNlfhArJG5lcSAOPst4Z4DHy52ZBLXN\nAU1YTYl1Z2pAyobcNJ2k5epZ6LWM5LRcPGnJkz4f4sYX5VVLnXYIhOcDQLcR\nINkA+yv3fW3adiPOTpTd2C1Szz7+bvl/y3WP5YdZfcg5jYHZvUTmNT8GW9TK\ncqIMNfyL52g8/8Jq/sszEL+BZblSAwRGq+grGnyH5JgYuBId5FLv7lnXsoi3\nIESp3E3HHd9RJpuKXUlGNU3HOoZho+ENkWM+yrcE9XUT5UXSiTmHGmQCQDyd\n0wxoUUD47feRhA5piWMD6ebvrHOWmXhftKEeMJmKVjKwgYG2eFHEiN9cLbsZ\nXzsEFFkQnoGXFzJ9lq2wEDjLBQCHVSMGLkgtIq3M5Pb/BLo88RppzgW2DWBs\ntpYan8bExN9F0PNGA4+t4RziUiKcAFa0RvY960XM6xQgEmqco6Y3+3IBPaJj\nfdU6\r\n=mX3u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk3EGTYLlsRTk+vN1YHDLzcepioKru+eVFwtUA++DG3QIgFzo08PkPu+3m/lpZPFdTwPijZpkl5QrgYPTuRCeemgI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180702115218_1530532546204_0.24446414293623042"},"_hasShrinkwrap":false},"0.18.0-20180702155841":{"name":"@atomist/automation-client","version":"0.18.0-20180702155841","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^4.1.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"6e4ca9d47b8035299a7dbc89ab851ee98f66d67f","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180702155841","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wI7rJwrNRPl7IOjOOW5C+j32WijgSHfieTOdfKStYo10EeVTQjWIIQdzpJe4t/UeUsDJdAgb8FSN/QtnNrjQ0w==","shasum":"845c484c7486526747598f5ba94a4d2d6d88e053","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180702155841.tgz","fileCount":797,"unpackedSize":3518259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbOkxpCRA9TVsSAnZWagAAEBwQAJBIa3GXfCm7tcpNdWZx\n6CoP2xSv4b3a9Vs0YL3CRYIOM4JcPMB0ltaONELnD4EgMe2nlKV7FwFE/smY\nBXbAMzouUOFW6bVqJ6JusGrD1C4EVD/LfTEIzK5l/46pHKg69FIsEML39cD+\n9UKpfkTuNr5x+I2oydRq1j0YeYUJrsRRd2lvX9eNdh5rrngwVp9rbE6S2WwW\nd7R7hi2S72XWMQNMgKcrX+FVolwsRW53fLaAgDpy1RkQnkBnIDHBu0drS12S\n9Vkz298yHSR7wqsYcyYLKTIeIKbLNSjcRZGsOYpCfUIfNYtQ0V9EVK2h3uOc\nm8vXKVvh/ZLBCL9fE5pVGCYzApOgCK6wn72bqd0yqXy0WmazZrUNZ0uycC+z\nGjfO2uKX20/fLWIwvyqMJte7gO8xoSoddnSQZu6rMGgFn84EKjlOSSfq0d3B\nmPnfw06NOpWxOMNEqMW6pytW0/xmwF4ASvoGXvZnN6EqJjNCEniTNB7rUY3d\nZ040p7652zFokK0jDwEij1XnG9CBJuinRG3ZFuDNgsnOPlMFyEccqOoAFH3Y\nNK2X4WR4cMkhYVzckLK/Mb0Gm22ABZKuc+UcWRfN93MO8Sv+14cgSYWsNAmZ\nDFrHHngf03R4Un7P5VJZKEMVBANS6H1LvwjBEQfzOnLwuT/xnH/Wwl+El3uw\nV6fz\r\n=Yt+F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrKAdDx1F7H/8Mse3z+UGIZhkx6JqSws3k6ibF3Z3mCAIgfXmerQDxV1iMlkQPGnbsmcx4PqfDxshP5efp3pfVB9Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180702155841_1530547305010_0.91999859295587"},"_hasShrinkwrap":false},"0.18.0-20180703131820":{"name":"@atomist/automation-client","version":"0.18.0-20180703131820","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e83a86fe2b2ce45607c5660aea3f1c367d704232","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180703131820","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-kCzPv7mAF5qIZxucMApLRxmbUYuTWhfNA/5AdV8zQ1cwwIKSR0TUhRqJDyu9UVpf+H65HyTeeI3ZFbR3H9nqhg==","shasum":"e6a8260e0a39568e98f9621c02b7499dec27a12d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180703131820.tgz","fileCount":797,"unpackedSize":3518868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbO3i7CRA9TVsSAnZWagAA1h0P/i8Zt+tVCWKAZCySX2xR\nkhCuRkXnxxqcBJUGB+WxWpCe11COQDcjEujOSigMBI7o6QDogtwPZs6VHNVX\nRT1uobFWyDeKK4XXeQ7bx5RbTfSlT6xxCVIDn5LdamuoMd7pihZSpW5JWcjg\nmeMw0SDNZwRL/RwVd/lO/5NElgRfTWerctkiB3uMEiyrghlCHKGII1vAfWVC\n7eIGkyRq+ZP2sK5CLHL/A3XQwSj6vgVLlctCC676TuSou0qb/Q7tN2kFSmQ9\nb7zl1ov+akzTAyYmis/4UB1FLKY4RZymhdbDEeNpZMr2kIvuDNZBepI5aDNU\nGor3RncGS3LOf34I9lpfV6RMPP+llNeUh5RXROZNFA87SxmdIshN70di77H/\nJQjRsjlWZNSR7gdEVV5tbCyUJIyY8BeZyH+sEkt3D7HFNeiJ6kyfgDj1tU6R\nh9hNgiTnD8NnSqb8os0YtTWmSKibBVcAJQ4Wuf978LVZGaym6GET2VL+yVAa\nhRJfl1m6zI3nL5gCBvNfHVvEwugx87Addm1Xx6P16/GwXZEnl3WmZy4ng0Ra\nHWzkRuqRoLec6DL55UAJvCBGr4qREJoLIawVQs7HYls0X7qb+8C0/QIibF4v\nqEy+yQsxlHvDzeksqp04pcLigxNmw4qI/5fXz/lpjk2d7lL1TL1u3HJfvwep\nnNC5\r\n=+RmT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoY/BdoiSYWqCM9bMLKCJ8OGPTAw7xAyRuFQvB3LRnHwIhAISyoyxPizZYjBlfUW5ohnGEc7vZbFQDqWehH6lH6MOW"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180703131820_1530624187401_0.12601696671367035"},"_hasShrinkwrap":false},"0.18.0-20180703134737":{"name":"@atomist/automation-client","version":"0.18.0-20180703134737","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e0a91df1999708d40391c320502aaf82d655e8fd","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180703134737","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LXrsXFui5VbAVg8hs/f/bIPi+wJrw9uLhNpZVTRGjGQ+s9jQwOxE+6XAFZqedk+5rbUtfn8cHzkoXGF4seU52A==","shasum":"8f54de868de46060f499cc61161e84f166611579","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180703134737.tgz","fileCount":797,"unpackedSize":3519019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbO3+lCRA9TVsSAnZWagAA1usP/3uqt6Ot2LicrAxK4liG\nVMV1VZgIpGh6Y5CJmpeZYl9/LfpsXpZxw4yw+wLYG/7hXaeuTS5RvHxvgYQ3\neBvHUacda1TChzz3VOtcEIYxRlircuEa2xH2vcaST1btKMl3o3JfxTcVtABW\noEGqeXw1FiJZs9yCrFJ4tbk4A1Ptei02Cs6dCyNJ8MzpTGi+YTeFXp0q94Dq\nmDIuvV1o4gYAexSeaWwyKTvdzTgm2pzDWg5Pui6qUWcxpi7LzY0vSJQ0vh6/\nYbVeHfsVXXc8JjpEojaCHLXZdhNUEIIawbgOJhItrMNzrWCoDCv5d5ALwGKJ\nLcMKBGfobSFBp/5/HMVqfE6YXQZr9J2THkWUNBh9fyHE7zNmtaFdBoCpiXsE\nBrJwOYntNlXLVzO5QdzABsz2ih67fpA+BF/GwQj34mqlNCKYCdGL8SSW4j5K\n4bcbjb9NyerG1VmuXpJmuTjpGP3VauhpgEBodPqvIPKNrc247h/VYs7flmbo\nq8n1fg1MIJSJXHYLaBzEhRAeYbpFxPh52KXDLiXW5Y2YOVRRizOIea+OSMLK\nnVSYxRA9sQND4YIPDLB2Iti4IbcI/ZzQV8l11k8FLilsfUZvsYm5otu5OMdC\nEUijCGnO/LVv8rKBzJyuKxZqR4aE4SpLJFWYk8rzSsvWYu+VTHXa0BJVDC89\ndKd9\r\n=KqXZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMZM4493eJTOlVfL5zaZlRP6OeOZWuzR/HFOSrFpQe0gIgVFH9gbFlr42RLW3cqqkqUpHI5y4Eq6gZMBE0e9+nIaY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180703134737_1530625957195_0.9693280312288179"},"_hasShrinkwrap":false},"0.18.0-20180703135350":{"name":"@atomist/automation-client","version":"0.18.0-20180703135350","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"c6579237b6e95ede87ae98e87af6b12fd49f7abc","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180703135350","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MgCWtn7GW1rjIjuLh6gBUCjnAIeeHN20gRuB5ev4Ar3/PVtd3MStE/8BenvVmJFw2P1tpHI7TPrGTVqHww1bVw==","shasum":"1b30330a2970a6cce9891861d86467f61119e0b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180703135350.tgz","fileCount":797,"unpackedSize":3519269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbO4EMCRA9TVsSAnZWagAALWwP+wfg2E7JjdhyJlqNBGwD\nw5dlw9sg6tOZXNNWUDA2kQX7yOY4ixwM+wtahdD8XI1B8spG5XcGzCpN4gMR\npO41yJ8v0cFBVsANgP+7sGGZefD809GjwnIVteUsOp4C2+Re93bYY8aeMm1g\nutqqCFk4ntu1QuLQ4E8DipTiwaEBN7ayiwadsLoW3JUFJyh/iSQsJxUVT80T\nUv4BGJaUnBKiwNIUTzjEJihQzcpHfxRRWiJf/qKn7xs94UBkMcaNONTFeP9Z\n9uMLzA60Y+SxtVXbtSBjJGQBjCNcVvPQkcwqE//A5VimL6Ldcpo5aWzzYhF/\nflESm/XUxDyNkEQ4rzmtmnXylBR6oYQLeKUZz9yUZnKGth+OKtpU3tJOjv1w\nhD57LYsEmk7fo9JeuQX70HYwycoo+YWnCfJnGK1xM4JiiOWd8cLYe58WAzwF\nCx5gWGGxLOPQGnnQUbJ75Q87PJkOJRWyHvpaFSAmRYZNNMwfUkmiK81mhOfk\nJt4p6MZceIqnjTJVKp6UZ88HyeC7GoA/Y2XrST777yBv7ai80U+mzuFnM44T\nos00ak6G58i1Z2w191DRM+1AzsprPzw9dGKEo1iapVRWUD+Gr35H0t7/yAr3\nmXBfXhv+eJ+ypQl2y/MQybbp3ljklyKqvJkfZJBvxZu9PpUvzUaqAzPwHSnQ\nhyy5\r\n=ompf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0zCfZSdwaMEDiPgiecvRkKsk7k3H/HiSFI8Z8cPeI6wIgNpnpvmmnVst9Xhmw29fpbkar6v5VixpbGdL79ZLsYas="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180703135350_1530626316693_0.2585578262891488"},"_hasShrinkwrap":false},"0.18.0-20180704102519":{"name":"@atomist/automation-client","version":"0.18.0-20180704102519","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"a4423c55f9de3df73dac80440bd4b739a2d3a9e5","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180704102519","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fKnDh+UkT83qkxgJWsRm5/VRPRwM/ARcyaH8wUvmTTqMmGRXW6vJzyvZTwTs9cSuCfHbplYdMdO8Qysvi2n8BQ==","shasum":"f3a1f96306ce7322e5f506eddf63decc4d869af8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180704102519.tgz","fileCount":797,"unpackedSize":3519672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPKG2CRA9TVsSAnZWagAAfngQAI7sTblGX5D6Wt/gw0Q2\n+nvmhpC8sXto4vpBDMjZFdlVEszRXRtzbNkAYa5LDSNgqaBWTrOMI5EpaGbc\nuKG/pSWWAdNMONJrswVpD0l3cI7XiR3qUqnXiiwpoD/IZcoDQFJsoYQZIz1x\nYmRedHLNTWPjU67lqzJJqus6XMtnzxL2bxie0lKMMbtZsdcFQnoU3258V10h\n1LPWyMLen7xcz6Vxn0F3+S2ddLTzDY5eaa9Yseaak9GgXCr1fTzJmHcmg/qN\noSnbY9NcO1OYoF59DjRB/W97x5N8PqaF4788YI88Klqhhlqt+fD4GroOvL9d\nXfpwzGlhcKharfdn8lEpAHQpYSlVT3muV/eA9Lp1k9pitkchwgFTRYLpGZUy\nSmhfgKPQrzX52Mxk3EKOhibaVnYs3p4ufQ6vzX/akHz6uyOI8J9J2iazI++b\nQFbMm1nSUockZH5XLBfEXPoBq1bKJJcT50KA6r+qaTjH/XPFdlz9uNlEvz7W\n8Tezb+wYkmjRf6RdKLpcXyD2r2PA2Kl9McKG2PHQKdeqxuLWaHjDPPsvqYFO\nXlyo+UyDsoL5yI9embLqSLiXG1WPXk74b3OqvVwrBrYoZOUHa7W498jQ/wml\nMwWSVXhZ63motPNvQEDdDR99m68grlW4kaNzU2vTqLwhP9aibAyN7VixMwaj\nwvUw\r\n=6xjB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6dvbG2WEmYaSqtue1cAIkBqu+W03jZXFaGCdgRT2hFAiBpwTBn6Hk09qEh0e4klQ7DNuSiW/XoSYycpDzd9PXzAA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180704102519_1530700214648_0.6110548773227653"},"_hasShrinkwrap":false},"0.18.0-nortissej.consistent-anyprojecteditor.20180705000729":{"name":"@atomist/automation-client","version":"0.18.0-nortissej.consistent-anyprojecteditor.20180705000729","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"dbab59bc1a44ef312037124c04a8c1947fcefdff","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-nortissej.consistent-anyprojecteditor.20180705000729","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Ytuq2qMZ5+4MMrhrfzyfwqM71q3ZiVvo0Jy74iyvkG3NHq7cdjahTnh99r8CZREH3ne/5kbq263wbaY8sOUHwA==","shasum":"f175f83670260e75cb5ad534fb33cf90964271d4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-nortissej.consistent-anyprojecteditor.20180705000729.tgz","fileCount":797,"unpackedSize":3519716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPWJcCRA9TVsSAnZWagAA4/YQAIRKnv7UHoT3JMZla7v7\nbTf/zlCUnYj8Kitju8YWRQ7BeX6cQMGQRHm3rBd2uI3yr7qBtIVyiqrIqI6k\nUNosZX8xscKvrU2N7do05kKVPhp0w+hboLcPcbNvyk3JYlLbP9pMyLlMzbwy\npKAt1xuKQ7+IWhfMlUi2EW7IkhQzfgyEVADECeR0tg2B9i9114VbJI0hUqOo\nl6iFjRM5gGjCO3ZEZG7b22fxnw+8aEGWsbTqt7eHG3Z3Om1+4E3kLlofhfva\n5Q8raI9L32a9S7xeDsgEh1i8x6z5EVn4kH3mJWDvY7YUsLNv7vzPqn0C1nZS\nLsUWfEcNtTFTv0Vd1SYjud6Ti4AC9my0WLK243EjEHdMktFswbLHtV/njrMJ\nbscHe9SuP7Q9I7xlVDwElpBat1VeHWmmjoOMCnkmAZq0mYRWuWC1M4ayL2Zp\n/i8CWaW7JthYRGSCbgj644BuE9nfQodstUeRcUZcqdzGtpC5zjq1wHSoKam9\n0VWJtwLF4+vppebgOt7PYiIl6tXeOQFTOvUunu3KKKlK4376RzkoX7/md1xD\nu3ud+TPdZTxulLSHZOgMDCYipixoLKyOU0bWh0k24IptSjhe8pBihOwwqEnZ\nQF0RXGDr3XdwHJKBthMeXhlYJvGtVa99NX1QVbTMPU6seWbmmzMx/U6nTOia\nZnjZ\r\n=rCkb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxvRwDVDyDCnyB+0a3ZtTJZCEOGQ8PmGLwzuEqkNf38AiB5spEnMSj7sScU9eXOZ2/ZgAMjnvnbdZwJBrFsO7VW6A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-nortissej.consistent-anyprojecteditor.20180705000729_1530749532020_0.9786830002327105"},"_hasShrinkwrap":false},"0.18.0-20180705132448":{"name":"@atomist/automation-client","version":"0.18.0-20180705132448","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"a9e57a4c963ccdc2f79d845e529814c576603974","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180705132448","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RkP/DiY8+ELfYK/s9Z9Vwaa6EYoIaOf51HKWbVW4Lk+zk5oCj6EQ15TBvnRsOFeVngz+QRAvMhJ4jDIAiejP3Q==","shasum":"1622e11b8dbc105c7fe46a696273995204fd16d3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180705132448.tgz","fileCount":797,"unpackedSize":3520239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPh1tCRA9TVsSAnZWagAAHN0P/0DDcNhZroGSvs95x+Rj\nIEslu/Krq5Rpp5q+KQx0lJib3SzeaJkd1Dt3Pxijl4k6GEHjGnA9rdYMXY54\nvMsGdUm9p+TC8FVx6d5YZLLQDNjCTyiFoOqUNwHcHXpYirpa23s2c3HTrp0J\ns0sYrk9+sG2iZ6HkodIl9EQzJp9cUmM/dc+OyLTvseblT8dYywLzFWxkC2yf\nYLlTF1BR2C8N/aBP1xOY8Y06lHzS3xOFxyUHUo1cz/G36Cq0Ai/OiioFE/zV\nkzHGEbEHn3doDHzNvbBn51MRdVq9fZZMxnmd+edAaxUdu7DEpH/jOoxHcqN+\n957XmOJ5S7JXCyYgoOjVkkeo6ji9P7hoGglp5uhgjxEyWpfmBWKUM6hJ1OWT\ngdReq/WLaIMa/FLyxTzMGns7pWCA6xUpPWLIp+KSdaFVSWjChBknCU5Q5Lmq\nksWpETDKfwecHMrQvc6NgBeFDjRKHOH1V9WsxOinMYK8w2vmPwc4QFtAp5pH\nRUkMTsUDewL22prDrQrcsXxrUTwcqfOr9CiNxoLzDTdQFMnY6eMMychuwfeA\nRvuKJ/Mm9TMSDZWGWbK2AFEzN9DHtCO8lUbSRDleZz/ACzgpZ/5DGOASrQjN\npoFqBj0BoxxoFCwjbglFGwBNUwkMh1Vz+yPykvTTjpgtH9Wo7YIF6YjakbV1\nDQkx\r\n=kAwm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4NLA3QHDlq1n85jqr9PsABRYbqaXisgmkpUQUxi+gdAiEAklCn/8Rr/6dpaHnNdlm5C4jo1jq3SFCHmHzSdemk4KM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180705132448_1530797421490_0.3476577246324333"},"_hasShrinkwrap":false},"0.18.0-20180705162739":{"name":"@atomist/automation-client","version":"0.18.0-20180705162739","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"07945665c9234c7522e8c196f9116551ce3814d7","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180705162739","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-895WmaIHvR5ZaqztHkoHOhlyafeQGywt7zz28S1GrnDdk93IAG/WD4Femdc5x4Wfkf1CLFC3LjK3sRG38cGYpw==","shasum":"0f247ce2e1da4991de206e90021c3f08aff46a50","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180705162739.tgz","fileCount":797,"unpackedSize":3520256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPkgaCRA9TVsSAnZWagAAPG0QAIHBbzcvRjVh2u4O5gOV\nuZihUlj/RFD1JUEF5ZBp9t0dWXO/CntL2eAfchJIRC6ABHVMiQ3BuBtujta3\n2/xNL6ZA9eZJI8G0+4kxz9oXNXp4EAAKUhp0iID0hWA1w7Mx0eih/DicgHmK\nv4f8JxihkgATOkv5+/b/Vx7GTO+451PBse7qT4hwG03J6vk9tnHfLE2bXJZa\ndvZGKTH/W8XfA9h+JdbSb2oRMed5lN5yS2fFFeOxxSnIOqXuzqsVH828Eni7\nzYFgOEmpdDJMm4gTXcAdI+9SrXweSUPwpYAONQkcft3nR0l3r/RBCI4pZ08R\nTWI/1fKkMiKjMPbb4F70x6uo2YQO9sj91oDb3gPKN92HUyKe3XmI3J4950CC\nIzzo8b3RVBaIdUx0To91lKSTGnhjacXVQNu5zLiPyNqXHRQIqOzjKrCPNHI8\nwyGu5wUk98lM1+Vdp9F6ZSIJtLd8OcI7Fj1SWjDkEs0HdXauz4TvhBkQTuWW\nlwy/zPTBlaSxjYhRwoZ1WTFeKvj9um4YaP0eSWQZF+kx5iuQNPqXFeB3ICpX\nUs9va4V71aAZan109N3liIVJFlMjbb1DpnIuj3wluYWT8xRlr13rH9mFZBJx\nMjZ8EAFGERZzvDxLZajZ+d2X+0KmhTlGDLalI8Gcu0mcFfP5Ctbp6wmWWpJ1\nW5Ir\r\n=LANM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmS+WXPv4pfAOugcb2CPw1OneHmcZ89K5UlBpAorlt7wIgD2FyCTjyaANOnSZkT++Bek8Xy+nnJc6O1O6t+7KykSI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180705162739_1530808346822_0.7719283635759446"},"_hasShrinkwrap":false},"0.18.0-deprecate-cli-315.20180706210841":{"name":"@atomist/automation-client","version":"0.18.0-deprecate-cli-315.20180706210841","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"6f04bd1737c20cb815222c0f1a855ae99174522b","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-deprecate-cli-315.20180706210841","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XXm1FV0KhKM1gZ0YSPLIMkIfuFuYLtumJWOje9XDAQdMml+wKQ9kmA/jUwNy4Tl40rKUc4XqvrZW86MeFjmJTw==","shasum":"c7a3ed740e6dce5da236a76d32a8e6d1e4b9cfc3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-deprecate-cli-315.20180706210841.tgz","fileCount":796,"unpackedSize":3520622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbP9tjCRA9TVsSAnZWagAArXIQAJwYpZWijXrdpEqhxsPh\nsLO3EDcfTAANMBiUPHhn7d2TJAF/IDY+oEHkgi/8fCT/f0PdRvRqZCRdMwED\nm55BkTHGjg5IuywuV8JWeUfn+ZPDZYazRYKkZ9oi4qpozP2YI20K7Wp/6tFM\niHj9ry8c4q6Kj8Rx3l6LbhlrqJIFTgwYb3atLRIpnXc+Yp6slsLaHqt0ekTL\nfsissDfnlpg9CWsMai9P3zZTTKAB/NBnDc9FSWPUgfHuFNRasxDB9RNft7xB\nCCdmSfGP5ZJc3fNL+JkchVlw7W+gs4sSQBWPZrtnrUCif/+P6VK80JJlIKye\nEhCiYrRNIc4BJjIpRfijH7zGEADclDXllstgUz+blHYlY9N/DiDsEPfetEMK\nlixQwAg06Y1lkaMc9iu4wy80zeitAN5VJuW7fzwn7xUspcEhqucbmoGVo0kt\nCLacbZ5lseTzpVJDNVnAXpSrFbKhbIQXd6FY1SA8N4QuCYeXt0ymHK8+UTUm\nVC6i2e9J69jQcwsACFrw1Yr9MLntERBmV0omKB1uGQyITZ8xkGI36m85rl3q\n56hGLck45s2BBvgAFr8RX8iu/8zGcE59J0OaxD1FHReAwU2Oa0P8G+n7r1wh\ndWm53sCDgnA/sXAVi45t3zpXDpHdqS8t/qAkGwXn+G3ZwL48Y3CT8sFmURLu\nMLB7\r\n=/YUE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC84y3L0WPueroXlpMlVzUEZfl1qGYegkgTerfvbXE9YwIga4NdaYtKKrTVJxRk1llSr1CfYCVlQItZVynQhOzLang="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-deprecate-cli-315.20180706210841_1530911586877_0.4497713694653316"},"_hasShrinkwrap":false},"0.18.0-20180707234509":{"name":"@atomist/automation-client","version":"0.18.0-20180707234509","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"5b56ef149ae8bd55bdbc666f4caf6e7a712a871f","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180707234509","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZQTzIfmcvnnCMO7kRZThXtFjeJeHnNqX1t+U1ALa7cW/kx761RKt4f8RnfylIIW0LL+sweW2v2/gnpfUM3Xlpw==","shasum":"94ca46347d21ee2d55311d2a2b76248d2d23c04b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180707234509.tgz","fileCount":796,"unpackedSize":3520275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQVGFCRA9TVsSAnZWagAAa+cP/j2QFJfFMvHqF981Syxp\np0xiYUt5jvAtYBti8xwifhhvtFkRUcZ++BVHmhMXlmbrpUagjaJLq+/YasCk\nNpE905aRsiFd/3xkoh5YPlWP84fK8oLlY88tb+E1sxo7sACx29J1X5P4WWA+\nCB0U/DqbtZXn5L4HfT/XdYGKzpicvQirwcKWtzo0AlGcTcBqbSSveM7n+3HG\n4Fd3sW5APUemHDfqTooSbE7Xx36EHT+RGhfrv+IOYa1em3zpue/BQmJsvdHg\n9Qe/kxkqR+zNxvPa3Xm4ctaGnQuLcqm6xRTM1hSc6JFsZtw/ltEmS43uyopP\nE3X1nFEpuSlrAbl6aTK/JPJh508c+s4g6KY6I4eV5emk/S9yoLkIfK2vGprg\nYKqqXINrn1v9Ic+SK5c7hYCIb0+4hIGffqkcs7eQ2f1h91/GaNZZwp48Y8R0\nr5338ZmzRynUTnlY6h4FfhgvnINyO1tGEFXUjISsuVWZl1l++1XGn0EwYINL\nxfexwsmx5tbQKm7CwQScR9NEN8XGMRmmNsA2Gt4LgD7LZSiu8c5GztrZmPNl\n+GWqfzU/ZGhpjVy1cV+deiqRYpG8zoqKe8/TK05E38MMMlIHuUBn7BFtxqdZ\nPj+cfhVn61g/Tmog+eO5YiDPAgmVWsKzteFqTlMJOholUxT2gbTBSq8wnw2J\npbzu\r\n=CSIU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/OGM38RToyImf98Q4ygyItHlSlJ8vt505TSyd1Vti9AIhAIHyhrJCRW1+csdWvs8ClPVGFlQqZ345JZQGamqcHRmg"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180707234509_1531007365399_0.3914460823708439"},"_hasShrinkwrap":false},"0.18.0-20180709015914":{"name":"@atomist/automation-client","version":"0.18.0-20180709015914","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"7402ac27c39c1de555a5f9e7394bd68b8ef85742","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180709015914","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-r6KRE9meKRvmeow/72pI2le+5hJU463xT3q88O/kdYfr4sPS5NfjmXmqshzDOsEOenqt4yrwqbVDByrzVY1Xvg==","shasum":"b37eda80e0a0a184f5b7cd33f9d18ad82afb24e6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180709015914.tgz","fileCount":796,"unpackedSize":3520366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQsJ/CRA9TVsSAnZWagAAruMP/3PS2a8YnsRc+81kQqJI\nDxN4dxokMkZ6nPF6oAjHLV6V27BZV+FWSJwzrcIiOjeTnV5prRX8551oMFyE\n10urbU3yeJ8XUnO9GPKDzhL9BMRaX+7rdYYXsRiu+FOXZIywnz2sV7iygIKi\ntdI+xNfEepxADDJSnDLFxU7wKuWgxdNSx1kQ1hf8kJGuHuH+T+PYS7WmpEJS\n52HIa0PGsVWJHudvIXDefZX233QtL9CiOWEBeWA2cv2vgnaa3hazjMKrqWnU\njBq4uuo2Tzd17gyom05hV6GuHglYmlBmXFY8YWB7jirq9Hso0uyQidrq3d/i\nTI//FOGeqlxznj/E08QkKknm3Yh6A1JCd/s3zMuyy+Sy4bQmQGtHjijVaPT0\nPFLcfSbO3ISqNR0vQ2QBiIRnIZOibCguueBEP1mXlPUlKkVA20aYXntNn73r\nbBn7tsJfn4OHnuiZfztunbwgTO6C1MdKUqpnrsQJ9dk92iAo6NzWmJMzB3ae\nRd+6NGaaFWe6Dqx+Cz32FtZItShVHVd8Xugcm/RFu0rSQ3OhCbcc4gFeaPGL\nuVlD29xupepkfF1OEW8HvYCPZj+GhDWTJtdVBdHKtaEVEgRbbdh9+Qly0IQc\npO/gIe2AcrpvcfqzzePrrJ61JvuP1unTFvseFBLigcwBisVimcfJ7E08J3be\nQvBa\r\n=FoBZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE7Sl5gqm5381CkdHeM8vi9kkdSyy2QNcxwEi2wIeTlgIhAL/yUmXAlQ2P24KPcn6PRTCHpnCoiOoiZAWI6hiw1djR"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180709015914_1531101823307_0.7631208259770259"},"_hasShrinkwrap":false},"0.18.0-20180709045820":{"name":"@atomist/automation-client","version":"0.18.0-20180709045820","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"082754439761a3a0ec9b54f5190bf1d57bc59946","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180709045820","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/2TwjLonfpx/xbyXIwAToxPiY3JLmxsLvhPK0QeTCpWrsq7PPqH3PhqU4izl5+7ZYMPSDGg7pEdbgJoIhRIadg==","shasum":"719d442795b2c0ae2fffa4d21e43e8e7d1648ec2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180709045820.tgz","fileCount":796,"unpackedSize":3520912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQuxdCRA9TVsSAnZWagAA5poP/jyrb1zZgy3MY1FfoBYW\nSXloS9BxcZGmqYiTWGwHgGdWtkSzEV6lJjlbo9H+cksUNoEA+C7WNlF0xWEV\nokslatww4F6C9T/wVU8tDqwguhQBvkaRk934WRYggAFd2/y6qXlUYpXGQ9qs\ntC/GcV20L6SwilLIcIFwtkgPjn2xJOZHcDDVBtxRrF/6fGH7E4yqpbV3Cit+\n+IxaQ+k4HRW5Rgq2hGRPVMLlt4VEPPA2UPgUNjenKaGCN4IqBCEI+sZ72F9A\n6tXym4XMK+Xyl6iIq/DAysYkAftONtkAmOgCxDBeimYsSh4IuuLSyLBQhz3V\nfgpX7dtNACkJW1Q0AsgaZjn3Xx0c62DpTSw/9j5NJled4+dudGb7w2puehpc\nOXOu+VbiV7RQUKQQ4RdzhMwz5hYPrHOHJqlL+RKgjz3cWe7lp0QVCkLuZY7b\nD212VPMYV0npmwsFWLymlg3vi1L8eTEQU5vdvWka9kvCMUuxERTlzZ439htB\nxXJQ76S7H7WCG6M3IPWdR1mu5wQgMnxkJeV54H1BVb++G2mX52j7zOtHHhln\n7WZEOhYLqvBOnLZIUz4NjeXTPDeBb339dvK8ruAxvkd7EaUvAFUcopB9dzRs\nqqfa17Ef+5ceGVyiPV1OrCWPE4xMzaNG2r/bBWVZalj1nqdyqIO9VjkMNQDb\nBnRT\r\n=dGPn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUvoS1quQXXKZBduNEL/C5iHf5rL9z2dIP6UexpisdOAIgXRIkzL0o6BpShFwyLEQOVFLgvTmaXi+zOgQg9hR/oEU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180709045820_1531112541751_0.6128752202920791"},"_hasShrinkwrap":false},"0.18.0-20180709103453":{"name":"@atomist/automation-client","version":"0.18.0-20180709103453","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","config":"^1.29.4","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/config":"0.0.34","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"c9f96a35511d87e40bf6b67f9f8154449d1224da","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180709103453","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-r7/mqTahf+3RqZ+3JEdCv1ezgTKX+lxayP0NMn/o7H4TeUDrnpYFXllS/dzwgVs9VrfJ0qMNbD6OOrOR/cYsXA==","shasum":"7e2d81b614cae43ac6d6785ab0f6e4208687bb06","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180709103453.tgz","fileCount":796,"unpackedSize":3521725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQzrmCRA9TVsSAnZWagAAEUwP/0mNWqUWXG4oGNRRUAzZ\nJb0NlU7WR63VuOWPZnWqAqReicWNaoQixMl4tZYeyPxqTM9/ACnFv6rVPS3L\nSbxPKAzNDquc2wACaG59Vw8MQnSMHgGnelhSmWG7aiLWOrqm3IW5waGn0vb0\nHnXhGtjODDZ5+iF/0MYY4F1mAMoyX3yo5BSFWeN1GoiYcJR8jWUC2UJd8u7y\n0pa3lCwHEurPfZCqkoV+jzjajQptMbcbvEqMi/xHtyWYLh7YZDjMuiZmURjV\nE/aZJU5kOunxbuZol8wS10vy0P1ycwBv0MdwFvWB3E2bmoe7SDjBsCie8V/1\nyvswwB6O3atPay1j7AQ46R6ovrqi5o6QWK8DDaCElz5lkb/jnKyAcSQZdNGs\n5i7hgWPoyaRAzRUq9pk7cTbmjaNDc6bECbjY38Mj80LmhL6fHS6TL8/soNk/\nI5d0ugDNyS4z6O7ks5+AdkydxvwMILiWuSmN8Tibe/7kJJF2NSRwo2GrqZpV\neaSfr+GYf2DbwR5a7tBayOofYEslg2HkvdOIHaXUBu0aEkaGyp36xcLHDLmL\nG9l4JsjR6VMey9Mk8RauZNcvUcU6VG6VW3pCtufshS+8h2er11Sf4kbGjmud\nDUuOGhaSG0n80a88Q/tGc3turDzdATaPdYs1xBu1uAnG2YNSNplPXwaQlx+v\n6wIM\r\n=2rm3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCK12fjzjMSilpk1/z5vgvOaNAsTmboSGpVICBY6I1N2AIgQBpiOIKYZxofHi/1HE0vxwvmpW8J7YPuGVJAr/1N6fA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180709103453_1531132646058_0.9080164895531833"},"_hasShrinkwrap":false},"0.18.0-20180710091719":{"name":"@atomist/automation-client","version":"0.18.0-20180710091719","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e4d880a8f90ea853ee4f040d48f5fa4a8ccadbae","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180710091719","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-B2+wMDuzsYHzT7WtqgKe8zl4EDmnfCFJnptG/XL6Pp/nlo56JUCNu35YRt+wdveJJS5TVpjTEupIZkG+VmduPA==","shasum":"39fb0130d0092861d8df952ddf838fd78b9f8069","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180710091719.tgz","fileCount":800,"unpackedSize":3522367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRHqwCRA9TVsSAnZWagAAc+4P/R273OtzRu80f7zq7GHM\nSTkMCHBwETtmC0C5X9e9AMLzd47kmHUZqDpiJZPqvO4PjQ4NYgX7GJnAzbdh\nw7h/kBylPD5QwUP/Zs40Tw5L+mSLEDB6ZmEtKONeyr1Tmll/ac2rTmDP8Uxo\n+JFpdKxbBeYSDFN/zYpyvG2OtNRH6gRhntdRYRzfcyc+OHwWKr6PJbgdhpbF\nwfcesrrexCb8PYHKNU+ZNPoDyok9MB/cOPu6cqhFU8yZwYkWM6yjeVOzmYl5\nTgqqWK90gWe2FkfuIRh41KJ4iViNtPdvrW+cSl/KlyV16VvD2j6toJuJJluO\nq6m4mMU9LUzsvJ58CD6/+BYYQncDsEGyZZGI58N5Yv2+K57+FYDwPgDCDX88\nIYyj8BCsIA+bQvkcFokOGeyGVXn3OUNFWbcq9bhjCjdVt3vl7La+8u9c4tNx\n3VnnTSmmv6It4eHvbD7/AVzhQRaI9B4AnVVCMLBmejbKMRpQG7zQy04ebsfg\nLMJuS1lwUwmIEPjdzcXqhSbdlUm6yWo9sPWuXwn9CAC+H4y3gjOhjgbL7+qi\nMizvU8+JebcXIwPuZBuzeq22kbLk1G+srBEfkZj1EYGeKuw8++EYKGerdzZ2\nJcTMY25vXYCoYvl1u7ZnXuC+j1vvW7BIuBnV8EMGz67TH9FFWS87nSH9hRiH\nfnCB\r\n=2wbY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWL5FjB4gycjljmwprZWOSzoqYm8JCxRtS+ktcZsrBRAiBJlHur6FKjFvcK+LkxjM3hXFENXBZR1a6YQoQNInrQrg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180710091719_1531214512732_0.8923814968375683"},"_hasShrinkwrap":false},"0.18.0-20180710131258":{"name":"@atomist/automation-client","version":"0.18.0-20180710131258","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"a35f0db0aa68c3b419cdc1d5115a8ede1fa6cec0","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180710131258","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-36cRxl9CjNXnYQeyGsokA1Rumj0eCxX/13qT7Yu9+4+5MaY0Pwz5QrIRnaUhGhW2boVvC2tAvzTrmIv+JdsmxQ==","shasum":"e477323d9756b08e476087e2f04cad73df5368e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180710131258.tgz","fileCount":800,"unpackedSize":3522489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRLHiCRA9TVsSAnZWagAAb6UP/RiYcUHfU+E54yYDZaFe\nuSYaeqzgfTgdTRJYp+aFYOgz5X+/q/yL6ZNw/1hPVRSsZF0ySHW3nIG2gg2F\nC6zi4TjEYrk8e+Y6Rc/QdjDrCp9vyB6hSh4f8YN9OQ/dVOvSa3TXmWnoLIHp\nAYanXCJthkmNReGTOg6P+J4R1yH0a12KzO7uBBC1hGm1QZoZBy38kP5cyO2m\nI3HwvdMF0M0fyOO1QeDiV3UrVgF6caAlzQbiPY5e9XPEYWvtv5hDFNPAVMKm\nWf6fL3FXn0xYvm1BamHIo670eK5b6p55vGTOiaIiFbDJVlHYzAj14ez7x0Jj\nzfQL1knqmEO+LgHtRwbYgIvBIuC9ljCiJZSp7nFUAXwvm6QqaLf8piEZQh/i\nb9PS8ehw0erhYMtiglounfWwsBEItjFlevXOLTGZ9pSKDselCE991vD/Sl7q\nQurd1KKOyxN5Y4MVuXfs41+UTq/Uj3CkfH8QpLYI+KWlDZ28fy6jxKtIG23N\nTyss6SWo4dHVisoK4f0A8fC7iob5ZLSyMBRxRdkt1rYXUQSu/zIr+T5rOK/U\nkgcIqsiAbD8SQp9dRu1QmVr9JejtU+II0vzEZcF1WZDV66/OCjNVgnySER92\nPkbKz0J6XAgVP5BBJDM3z9ozGYlSlB4BpxLPiJlDRS7Ui4YLLqdvQBXYZSTL\n30DB\r\n=QYbK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBR1TmMtOTc3vohg+uPm11vdb6B+x2e/l0ZHd7FP8pEuAiA1v4CH2RZZYQLozGxJzjFYWcDzYsB+S3Dl38NINu4LaA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180710131258_1531228642599_0.96481644313301"},"_hasShrinkwrap":false},"0.18.0-20180711143021":{"name":"@atomist/automation-client","version":"0.18.0-20180711143021","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"348aff48d5f89eec284c13127544954b4c5434a8","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180711143021","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hTplVCYb7a1T90WrGaOWIt0Mll4XS9gKXwCrSQ6hf6LGvzXe3/i7BeefxkFs9ysHJ4/+gHVerKWyWvkssvvosw==","shasum":"7b3eb57282a8243547ae6171a17f08dda26780e0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180711143021.tgz","fileCount":800,"unpackedSize":3522943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRhWkCRA9TVsSAnZWagAA85kP/jg+VKiDBRGd0iSY/dFX\nZQ9umoHMJXNdmlydHxLyBYOGPW4omCl2YkW2vIWkFs6H7BDMveKmwz/BjYgt\n6p3gHrUUf1DUwUPHwCsMilE4Ckp96ihN+T/LdB+1pTaR9pdE2lxJUP8PdIFK\nAagVy9lMWKkPvKMDkpqXZnhmFDTayqsxThMYVV2jQNAzeTDz1GVvWdnmfB1M\nMVppPRu5RWymS7O1N4qlgOgmGq18YErbgY8rFfoclLtX2CdHxx74vxflAXeE\n67+Pnb6tY8VmMEretC7w1v+SiFWkr7+e3yFeQgcgeS1TR1+BfQVI0jrJGOnc\n7u36skiEnZGtmuE/p5wlCPDLlGBsLo99Ip407YhwXeSL3WaGo40FQIgF0FSi\nNjXPip8bXVYa8/uYiZc16J1voFYringuln+MetIF+ZydKjDtTeyzR5BE18OT\nGECJ+r+5hLSaMRavvz0Bfil0z6zkSh9sZxC0/rpLRTfj+EpMNklxGzUc12M6\nYdLrFiUzLvgzdO9uEkUrUXCuUp8IobcJ+wEi1Em0i+oukpCBN9nE4DYIBXG/\nfnXZg28WW04GhdP0ffTUy1nDEdQbIJZh5irHR2TBaVgg+4KcW+JOokCuvups\n6e/t7ozoGJLflRxBcQUlVlvR2FUVy9MHm8J8SyYGAvv5/QW7IRgj3tXwMDGZ\nH876\r\n=IZaN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWNk9SD1oJsTqds904ud1vExImWEIMQfoPnvXZVXMPWQIhAIrMo6H1q+P6dYkLYlG5HNTAwL2MKd0hO8XnqDtHMAw8"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180711143021_1531319716253_0.7850573808716208"},"_hasShrinkwrap":false},"0.18.0-20180711143049":{"name":"@atomist/automation-client","version":"0.18.0-20180711143049","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"4205763eeb1bb1ca83afe9e4a5ab2c091938e8b7","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180711143049","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dCL36WlRTd8HvVmTSAcBasHSnhIF8fJ9pOcD/H2LouOysYT3F34o1irzju3zS3ZPPqp/SFymG1x3BvHfa8YPYw==","shasum":"4af94dfa76ca753c9228573a82e470b2013b7ada","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180711143049.tgz","fileCount":800,"unpackedSize":3523077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRhW7CRA9TVsSAnZWagAAWMoP/0xCp8ydgjd0XgsPWmvj\nvzdmvUjCa+d2WvrjU/uYbhgiz2S+THv44CYdWQftp77xOTMsz+roAdhnIAmU\nvfzLoOZPvfkRboqyQdTgHNdBrwe2qkCeTATMXKaVdTXLVy4naXE8oI5NprGN\nv+TjFp3J9wacZZYsHdZXJb/Ir79SRvwmIG/E7hTMSHiZxZGIIfeSltm3VhuB\nYeCMYPZD+8U4RdmqKf+AE6N0g9Lxf+BV7w3Imvt+fl1GvrcXrOj3uZ1jZzp8\n873giPIn47N8Nld1gEjA8eATp751GinD1ek0Q8ogB5itJYAlzHpqd+QTgkyr\n3XNXNNKWGw4ln9VDBjFCAeMWs+DEFtrbxNyQCNuOTbMNxsxsVrVkb7j6hMHz\nRQXmpTfkJKjwC1xrcb/VkHS+vhdAmWs2HMUaok/ostpdlXQdBZeCPRFh/hjV\nPUe4rBGG81cdN+l8TrL3ZKnEJYi4r4ITY6/TPlRflOMluSavHH/EKR8igTZ/\nNrkYcglveHt3FxCwPkqD3QjCwUj0Wn60fZWFSbIfXzZCpSeWCPJZxqVOdBoo\nBkO90srzuNfClMKtUEjCnrYWEQs4iNJCi5b1SC9j8+0Q8+PQcFeUiId1haV8\nF0zhn/eGd7FigUpPGptTtogVG9L7u58Ro78lg7Xaxfi/1xXz7liYRy7H7wd4\nURoo\r\n=Z5TU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGtirFx/yrku6IvM+6KMFt4BRvE7rXJgdxTHCcc6l6PYAiAbg3MstKdpFAVS5NHyspRlVO8PpN36DH+sg1223Fwh/g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180711143049_1531319739663_0.864393624770524"},"_hasShrinkwrap":false},"0.18.0-hide-flushable.20180711230533":{"name":"@atomist/automation-client","version":"0.18.0-hide-flushable.20180711230533","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"65399dde09315d346c11610406b9f4a56437c798","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-hide-flushable.20180711230533","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-iOj35bdMveW4uceQHGSAeykGyFwNrXdVKZCiDfuOZkCXqf1qdrtz8x/0JTFrJcsjg0z6AaK4XNqjLC9O5Au1Sw==","shasum":"e22367a56dafd78cfc56c27a1c757a93f4215b96","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-hide-flushable.20180711230533.tgz","fileCount":800,"unpackedSize":3522609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRo5ICRA9TVsSAnZWagAAAUIQAJ6IRR5rEOqwBwtS3xHO\nTvf45OtmOLl+6B9AOIRdKJacj395aCMvQMGotkFmvg6eVu/aTP0Q2KgmU6XK\nr9azIhaNCH04ZYbLABzb1Z1jXWHgcFvHIJkomk768w/c9M1YQSuj84ItMRf1\n0vUYDatzdt17oiG9kdvWpwhm6d00kPsGhkVwbfMCUjxKiRnN6KIAf0E/RskU\nvHXzOCdW+z32/6eO1EDru5Re3KJ30Czhr3iPisSbGA73r5r7gs59XQ4HPH6I\neUT+ilnA8sH4QszI4A7/C63DDzWJgIdLnb7CCwEXdo67Wddn/QTrXQ5z3vV7\nrMd7dNWETAwB8aa9tyW61kNCGmYRSPktLEpzmkBgZQZmlIT/tvi7otO0z5h8\n/Bv5aa4BB3X3QP5ZcB7jn8FQXyTot1RFDcfMrC9VTAEub8FgtjOHs1eDlS8H\nbegnQeCvS5jGsvYxiTP9M570UVTc9ZuAu5nrf9w834W8w3vFeM7GOLobZCbT\niTfL/YOc12c2b1azb7VgM5Le+gxDwuSmu1SxsHJN45OS1jMdX+j+Fvg7CMjZ\n7tt8ikjZFzIqg2nsKoU7Ox0nkbtsDagrYn3kot7TyAiiayFTjbLO7o+kc/ct\nLZK9CdjgXPAMT90c0tfnWDNvIcrhZ08iH6WSmTf4rGcWTwyHabjlCAnvU826\nnLwB\r\n=azPb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNzcqt4NfzLrDG6+jDAiOmj77/6CPhaz/E4dzgE6vfmAIhAOAKPfqmSKhQyYtvqZq+7zdfHHvZe6bYWq/qAU0YNVZf"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-hide-flushable.20180711230533_1531350600061_0.42504402161375343"},"_hasShrinkwrap":false},"0.18.0-20180712045047":{"name":"@atomist/automation-client","version":"0.18.0-20180712045047","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"213c44fe0c6b5ee6b063a46b281c6631e344f495","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180712045047","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7q0JB4qsXZrqX2J90TYRRR6uTRq8KMPo3iXH7xoMZK3aFLAqUUBu+LtZWxJCPs9FQ5F+3h+US9d3hbHNVjvb4g==","shasum":"b6312212231505fe54f230afcbc59444a68eba4e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180712045047.tgz","fileCount":800,"unpackedSize":3523712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRt8xCRA9TVsSAnZWagAAEXcQAI9r35p8sx/EhGeFYtPY\nQ0IF8uoCuRL285NqqJFhjLJfFVX9EFPmW0EWajF4E0Cwq7AlCalaZM0LO9MT\nSmamEpnrpvQSWkE7EIqxd6Byy8GHXALuOTdlzRDJh1ZWA+lMIbDO+UO47aYu\nbO3wOGrmPpm3gico0GizKzleTSL0o4qIGsy5db0et9VXia4JeOJpXsuWeg5M\noe0KqUNM3HG10ZWzW+/cuCh2CZzQCWTTuehfe6jRaTjQfOvNjYI4k5Gu3bB6\ndnAU+r4gc8ZXWvtXo14Jp/Rc0ecrDVbr1iL/psS1u2FcxlQEbMaAisOTNiG0\naPJrrFRhDH3m88pB2vjn1B7+gTmGKBZgtuDBAZ39mShnQEcnyXoOcI37s0y/\nRFCB2cROqY3RsH0pUaVWfQqlRH8cdDNNsR/Wm3T7DzfozDeHtxuZkFpeNeao\nbMuqUT90Ufnc32a3/mxKuterH1SCxakcngg/NBPs3zCBUcKQUJBnW0kPVJbY\nX2Q4YHFzya504w0GOEvx+qM909Dcu1qRAAeUcouPj7Setq1mCrohQojIDLy1\nEvyJ+bL+cSk+3pV/kDyGMwbgl2iB0dLtyFjW3hFJrJUjoFYfVtXts6v2rk2S\nd1pDDF1f0vy8BTsgterG62m1qnBAV3Bd8rf80er3MH7j0dk/gMNTNRpINCIW\nZhU9\r\n=xFPu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEI20M8dPTeNcdcupGEaDeSUIPGuOpiqe3ptcKmONYUuAiEA2CvVGUS1EFTFBK3pDTmf3wgq5DR6Q+l93mKxMfKwVsU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180712045047_1531371313583_0.3470495675141829"},"_hasShrinkwrap":false},"0.18.0-20180712071634":{"name":"@atomist/automation-client","version":"0.18.0-20180712071634","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9c85c51a6cc72efea7ae5809d52c9bdc2330a9d9","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180712071634","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2Jrra3SeXsB4URV48XoCvto5Y0tFylRU64dE6al6lMqYCszy/0JchM60499hxX3/dfJdAeeOqwp6SqMNZQP6UQ==","shasum":"8a24a526eff0423a8c4b36818a19ab75fbc1f857","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180712071634.tgz","fileCount":800,"unpackedSize":3523229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRwFzCRA9TVsSAnZWagAA1mwP/3GZgB9UbHkfb6m1Lduf\naKghyuG3MRsG+hSf9uTo1VS/xCXZW7loaMocHvj34SeePq6DYh2axH87o/gq\n3Lus9vjvYes4yQ9icFt7KeUB1wy2jBnGK7HPbhPBrdzzKmT0+1H0SutzJvds\nIugGCPom83/An4Lip1YuGMpmrLoPVVfm92qjo5Xz4E6kYff8WcQDa2SNFdhC\n0HHkkYBmwk1dk88+PD/WCNJZhcyjAKbilmAKDWH8xuwvNe/+UI+DKAwY0/mK\nLchuVQoEWW5UegqxReD7GPkVZZBognstakq+1GJ/Rm6M5LCFwhby8QAaUCNJ\nGVZXeF0nLfCPVYjU/RvP1VByiRrgeM5P26WkS9fVuFNUTK6dvrVSZqKZpve7\nUYIkKoHmm3bMgwmykUM2BrMzdEKBV1odOEB/r6T/sRjeoICHKbCmgvWg22pf\nok1EUq5JhQkwts9d4jbZgP2ZjyQ5Qn0YHfzLHqTYJsRhuKakinqqfcweyDQD\ncAOEcHXURd4uH6V+mzSw+NnMO0Pzs66TNuEhriduomDRjLE45v5SZSZhMV0B\ncZXwMNdJ/ppSBlF129K3KLrucyfb12QMzYrM1ZGOW5apWZlCtL/iTfF44a+B\nUkchydiH50F0ksC/uhIOY3il8JmITPuZAVj16ZiVltL6ZOBPkhqJyp6S9BGv\nD+qm\r\n=CBFZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDepR9IYUp8BHxCxJCWO8Rp19Yad92TBQsDBvFSze0zaQIgTLHVtUkUDWDRj/cb46uOX5LYbqQoKS3yXNypN+4C+QI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180712071634_1531380083709_0.42955315795536464"},"_hasShrinkwrap":false},"0.18.0-20180713043042":{"name":"@atomist/automation-client","version":"0.18.0-20180713043042","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e5128486faeb648c31ea50e2aaefe7d26ffc40fb","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180713043042","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GGiWB6omvSaF9CEMX0AsfNcHdzd99YABVomLnO6or/yVAX+DkGVLIHx/Hs5go/QodWf0Zu/oZIoHecIN7NkOCA==","shasum":"14a5fdd8bb6faf0d2d225f22a2b93890e917cfcb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180713043042.tgz","fileCount":800,"unpackedSize":3529807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSCwDCRA9TVsSAnZWagAAwgEP/01SILgRF8oY6emqJd2J\noBIXE2zUiKQ7JaI4JHFaEVvm11FnhI0EG2jSxxY30P1iqK7PL+KFpFED2OIR\nUV53fSJED2iC9Z8iFyo9nK8pQ+j2gxH5NLYewX2ra2lslwJMYu5TxAaTE3QY\njkZR3dw94h//2KclJPJ4KB9zOFxu1/W8m6G2XCgBuOj6h+lbF5ffrW2MTLoe\nMTskXqRNpclkZlmzy+dmnrA97DNYUxpLcS+wdAASv3+YP6iHCxMmDxW+DzHs\ndsbljskq5Pgagsm6GZ1pdAe2f+HY8MKKwxv7ynadX3nEKl6cS1vi9G56/Sy8\nWQNOMeytIPL/Qo2iy9L1RBsJZ1jHbsdihdksgU53seyVFom8kLvRHPZ71Nf+\n1frBKXpvJza67S+oDUOch9YLDQh85dnvOvUvwOL/ffqvkKpAknU2NxUZDxVH\nM9euYKX4mEEqZp/ng7yfXN3JctBmIQYtDEvUKysZaIAy0+Ho8Xsan0PRK9f1\ndPOYwFBQ6gLQb+i4zsf3Nd1JE/pJ4i+63Wx/n66fuK+zU7MB7w/JWyfAGYg/\nKebMGX65MYXAW6Us62YS1dWXSZl8GgC/rvALyoBbaCF2LOx503T5h0ZenCsG\ndvXmN60sj/2gELNPzzeiuBjuH6tlVF1j+urBireY65exbkWpLnmKCgnsWLEM\nqePp\r\n=ziDM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFziiXgaVtQWmEoYeONf2RxStoyUfL+leHRFDC4CinhAiBDXZ9YPhHp/YOMxzkESappppAN14ccYYea2ldo4MoDuw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180713043042_1531456515100_0.05571689234082844"},"_hasShrinkwrap":false},"0.18.0-20180713091022":{"name":"@atomist/automation-client","version":"0.18.0-20180713091022","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"a2b3cd1c44b62dfcebf39f9b55d7eb6c0d77a240","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180713091022","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JG8mpZ4lMWtyK+NC0RUJkheYz2GfwxxOpOtYpuL0W/g4jBHz3eGbsHyLo6BCvnc7RtYA13upsNTU0XPmjfYnIg==","shasum":"84fb157e5ab99b332ca85c876d6c6a3e92f29d99","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180713091022.tgz","fileCount":800,"unpackedSize":3530282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSG2aCRA9TVsSAnZWagAAfzIP/RQzLwSrGpefsF4QXSs3\n4MMcQiOerwYjD+CFxCLPiUTuoq32YSbNiH2vsUKVDt03LtpoqXzt3nvRHGwk\nOyr+RDC9X3MGuZxTwvSAbX+QCJ3/CXxvyiRYnGJh33zxe5Kydshv5znEwTDt\nvDxWYp0BLMVGlSj4Gl0CDpV0c+pW+Wd8SYmF/ga19VFk5FyQcXUozpQ94O90\nqCOhPlT45i4ZM+5eO+d4ljZoFJRa4UU0sbppWh8NrTkqx34alzS4fS+R+L87\nHSxHj+x+0uQNVwqpPzB8JU5bpUjMi62eNhJI1Qs6bnSKVR3THkg3gMNEeKar\nNjLSkcfmLHBhoL99HeFlv7lhkOvx58D1sCt9OOXS8TBQ8AptgXujpZCCfhiE\nGmkT+hmn0EzKXCiYIfkxmw/2/uSBBGZ22vN5Lwt2eR2fwxefstf6pLUSbRra\nRVgDr/kM/NQbqLJB+jcNmiaQ+8RdKQ8p9iRyLgd9EQbZVr19KNXVxA90AWCY\nP5gAKug8UcxFkwWQFhfHjY7WkbdeVtsdSeLBeCiUhXrLlLB4YvVtIYiWasg3\nda1jopcU4jA3qbnWwKfb5HzjGtgyutJKMolcqJIP1oumynGBUeGldsMbCkzC\n7cWNxxTnAvGx/LnuX41J5S8PMhmV756LWO+3jKc8cz3VkZ2rMmTUg8hF92jM\n/XPW\r\n=Gt1l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy8XEdhy49GzMonPNcMjL1YAwmMHq7r8qXOcLhZ6blCQIgHL5q5SH824JG30S6FhElNLvi9vWioSTgI8LvOVmmiZs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180713091022_1531473306056_0.6473096375095833"},"_hasShrinkwrap":false},"0.18.0-20180713094517":{"name":"@atomist/automation-client","version":"0.18.0-20180713094517","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"437bca155cbf811f175f91b02a279c674e2477c3","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180713094517","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9ceReGs1SKzSFPCTZ8dZZ5XJTpKf6NMdRGah6EJfNK9T5gaqgfHG7PzN3l0wffD5vkroOKIvN7rPeXKvIsHfwA==","shasum":"2ec5e5edf139fe2a62175caa36fc15541912e3b5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180713094517.tgz","fileCount":800,"unpackedSize":3529993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSHXuCRA9TVsSAnZWagAAvJQP+wfqFq5NSYHJS9CkmzfO\n5Z0VDqwdCIsIqZ1uE8EV5ln6fX2yYMq8J+kxqpVi+wZywhCsY9ivWapPQrVP\nor5KWEmDJK20QdpdZ5uB/VkgC4gAJNVaJq9kN8yH8yo/JBC7i96nDdZ7URVn\njgsTbb0Vd8gpNxBnTioYWjGKi4RXhWDPdYkiZPKcLcAyarNE92x4/v12BaUv\nkB3lldtetJltn/mrKugMJUeqdiNLcHyiFf/WUfT060567sE0k7bb7B52MHnA\nYtCPEhTINoTTJtKpkU8VZjtflWOTwvCBgzy+KvkrLkkDhCaR/d5Rp+GndRj0\n77LyvTxqma3RSpdXIh9tbcPM9UO1KdgsCaVejLRddlDYoIcWgoZhtlHUHQn8\nQdxNsqZAJHPEkMCJ8XiJTEMjlQ3JVhvib60AWJKYE4lDZ+iPpKbAWPrMjp9u\nirKQsIFaZRvHggt1rcnhmHC/cnhbhKpbtA/zRaoG6CFHlGRPKkjOlRRGBabi\ncowUsT0pldn9zZOGNS9vPtH6fDQiBqElrJesTj5L/Fqi3E9HgyU+ZwGRIEfB\nsW1pey4+eWblf+nmU0lwOZhMsKH7XYacqo8b6ez3hhZ1pCWMza+Roa/lzDWU\nk4zxsjdlpEmkgQ3dGL4Wf8GKvUHAmWzyC1IxTAbM2/hAfLBZbST7XlWNmkiX\nNpdg\r\n=m+WQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJrSUJvjQKaRzVTQJWRwymCYqH9HmrQr2hINRexIvHgQIgVm1qkpzCaCOHSlCX4whPKpwTdLVorHz+3VAZh8YJbGo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180713094517_1531475437869_0.8368620013000949"},"_hasShrinkwrap":false},"0.18.0-20180715093005":{"name":"@atomist/automation-client","version":"0.18.0-20180715093005","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"46cd2f9f5b4e9aa472214c1fc7f83d7eeea2e417","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180715093005","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nDqOGczUrrchWusAP7E6PgXEVbHsN71Q+Z/QJu2+Y/C7r9dcRUl4OY4P/5sd1cgiT9s6qoqvPAp5SQ+yKn0N8Q==","shasum":"49d0d9d60e650ff5809970689b70117ec0166202","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180715093005.tgz","fileCount":800,"unpackedSize":3530114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSxUhCRA9TVsSAnZWagAAIBYP/1PKPfbsBilxgWbG6Dgd\n1pK4Asd7l3rGTQOrcVHu1tgbnX8HABmtBuCOY4K8t3e5ED+JQnLddI0WkPPN\nOdz4urgEvaDHoX0HO+seSmv1VlV0rAVTBH9rxoXN83JgiUFuojSbnPCDf/yC\nCHwJk3zU5obabjmclHMSuqEhhzOoulWfd+CTd333Pp3TstEDfCBcUyOcBRM7\nz9x3Wic8dhHbrSwnOhxpPg+VhtFT8biQDpP6iabdc0Kj13IlMEdpeqzV6Ln6\nArFU8eOhhYcZhBFC/RUrEu9VikAWnAP3UMxZSEFEuMKLhs8Tnf3DA4yiOpd3\nZmb1/KaxWGHXzuXCaxtIKE0L2/0B9e3SJsMrQQ0EHxqLiGNcnBkRbYEjyxev\nS4DIwB4ugn9gvps5zcR57gpw9smSfzwmhc5DrWzlIv5bH7zfGsFZqwfL0MvI\nryfyaHKOYvk4YimOsRywhCs8S6pldZ7nu5AOOdnOUGg1V/uJTaZB5mB7i/0N\nzdzO3gJmRMPV8a/jckkOrQkYPEURgcOJ6pTmX3Oo4/GTKbMZSzJ7NaaBID6/\nUu5MTy/Of+2p6imsAReLCNZ/1QxD6BHFVFb81SDYKY8nY9idHbu7HOvUdkyB\ndJDlfIgt1KywM3jVRlemh1l1a4fohzc5mC/ZaAVrVMPlQtUpjqCPabzjgYeA\nxoCx\r\n=mJCs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4RL4LAWpJKVJk8qrDLLF7ZPmbtMGDRmbRvCDH7viyLwIgYXzUkA/lGx6O8ZVk8JA9H0EI6P79NeGECZNleGX69Wg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180715093005_1531647264866_0.181801377409343"},"_hasShrinkwrap":false},"0.18.0-20180715093009":{"name":"@atomist/automation-client","version":"0.18.0-20180715093009","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"46cd2f9f5b4e9aa472214c1fc7f83d7eeea2e417","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180715093009","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NoYoF3itNWIwI3VXC14PBOhW5QSAi5pvdIw5gEG3vvMk2h0LJoniRFsCMYT9N56aIDlP3uM/nsD6sduAH/5BIg==","shasum":"5d786bc20b9a6394971943a7112bceaeafbca6be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180715093009.tgz","fileCount":800,"unpackedSize":3530114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSxU+CRA9TVsSAnZWagAAgVwQAJuMWi6TzqucV0pGPrrc\nEHGkfSZLyNLf71qOCAaOl62/AbldAK+fPUDdIRVQONY708/CSTTrNFmgiQLg\nFihtsnMbXqmwIry7kDvRXTVdQgt2ntX6mitxsQAQyLfuQNFH90pKb8VQi1hR\nnE9FD8ERCoF9qjtbaZdw1cft1dGpyfh4SZ+1Rj+j7johApOrFchfZnwZPENH\nYSBp1WYtNUxdRuTx1JReTxe/dYd3fCHSO+9tQQzqc10YME1rAzWma1MlzXwo\nVi4iOkBKorFrUL7uiNTO/EEvpUKs71N1ljO2CQh/fqYApTrM96e6TXhnL/z/\nOc/togXHvW9p45auN/8mFC0Akxh8hNRKqOWoGpfopC2CplQ/66XhSrNZP8EO\nRDu7NeCY5uiNRMKhZlm53rpkXX1wVF6YuRWEsrGThdImt15nFXDZujzkPSMX\nUdNfWUhkuJqkA7NAkii+XtBdtMnWYL/MHSXr80jh57NtJaDI8S/Ov7Fm6BLX\nErg9K91xHH12UBDhVfLRV4DJN/tanPXN+mBsGVPq8sXqREc4RwbJqU7P4HJd\nLDdAw/zpO5PojeLsGiiYP3ioE0geJI0AxC6cilt6bi9vrzybVUoJozol1ik5\n/z06N0kk3eThhAJuKCYGdOnlatUQdDRkQHnbL+rzvTJS99UszicTbZsMl7Ih\ntwmh\r\n=gL3t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5pwPDIWLgRIZHOTDkUXN5/cDnN2cta4CWL6t9g7MbkQIhALosuXLayn2bICaUV48Isf2KGT1sUYJ8pphaOGUE/73K"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180715093009_1531647293701_0.8087180842579869"},"_hasShrinkwrap":false},"0.18.0-20180719235547":{"name":"@atomist/automation-client","version":"0.18.0-20180719235547","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"7c78d8bc7bba23b0064c4f94ba12d5b6185e378c","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180719235547","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-im3A4jR1euHySIEprhTu5M/XD2zNVlLdUUIM49dT8fyA05K+r6/8UBOrdV7SJqCDLzrhgrG2jKGON9AzlnBWXQ==","shasum":"4bd7f6ef2b653e9c45e2ec2b72035a0ba75d8611","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180719235547.tgz","fileCount":801,"unpackedSize":3530301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUSYjCRA9TVsSAnZWagAAd3wP/1KsDqyJZ+KBvtbGls2p\n+h/vTfJujMDSLckakBlI3+zKbem7rsTu6h/0M8VtY0v/G/S3T1DCqz9XJYpw\nekoSTv2GPWHBXbk8BqsVrnQNiFQnaiUdqO5gAO4GRFL1zieusLUnFB+MJwE3\nI/rbV/KQMiILDMBhMnT8ZSM8ikokkZJrOASmVvPBz+3pt2X/7xsIUhKT+F3w\nn3JFJ+gee49lter756bZZef97Xk5l2XedEqP4d+Ge5cxN2kMpatm1VJWO9ZB\nqP9vlKORoF7ebnTQD2ZBJH+xZS0nU0ei9NntagSqIGUXVwY994PgPSMOSQKW\nz3JVAD9x5QLdi90Z3yCJh127iEpkY+wcnyAZbDWiCud6SGRbhjsW9IQesU/P\njAspYlqvXzU4NQMj02/kiJnjQisrS22YiA15V6TV4oPTE0Sf/FAe9er0b4Gf\n88f9bGYYg9gOAEy4/D0k5yGKAwIhJu3qswIyNUVM686E5vvebmgoyuGubAwU\nPClWdam98i7FQ/twGzESpgBZq69oP4gb/zkKf3zZHTepFjh/CV09m7DwOvSx\nZjLEGpIcybpj7ryyIQ9uiiF/JsLTk7CihLr5o6twDAwr3CTDh48upy/t61Aq\nr8TgNyMXtoLmpX0XYd4BJ7ikUByVnsJSjoIfRtyWU/pXwT1wBW9efL7dibJk\nliDW\r\n=o4Jj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGy9lWnFJ6Mhg7jJz6hkhOPT96WsR9rfGplmeFTVqSiVAiB+FAiCwP8rArUpdFW3Htm7OqXI9FdMfhrpOpvv/u+vLQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180719235547_1532044834544_0.6344910818991489"},"_hasShrinkwrap":false},"0.18.0-config-open.20180720003922":{"name":"@atomist/automation-client","version":"0.18.0-config-open.20180720003922","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"22cee7c29319749460fef766bb8b113d23a40632","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-config-open.20180720003922","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BRU3+uIX1m8hZnp6bcwjtrwX9eZBvfdm1SJTP2ilD4Gvka7RFMFLbgC0cSvrYokLI46SCDurq+h1ZyOfZ7qSfw==","shasum":"5e0a7996ac77af8a9f44e09426acaed56661adf0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-config-open.20180720003922.tgz","fileCount":801,"unpackedSize":3529730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUTBBCRA9TVsSAnZWagAAvHMP/07u/5xol6qQdSphXLyc\nqFvJtmgYBjxI2L1xmfIxG/Ulp2wlHPTF97Na/slDr3yoXuTU0/oJCdPZSzz9\nsmuhkLeq+iewb+9XmkbXyvr3nf9/xuhcjvgLXZTGXUJFh6wlPHfg28fPRqIy\naqPC3LOhiZ40IW7H2WLI70Alx4Q901qcuHktjZUPNLqZuiEVHmWTvUgnEH0s\n7A+6QzqQQaEy0PGltHuLwtE9i+7Y/PqorpkzbqRJ9MzrHXoox2oMB7pOHpVb\nVYhQ/MdDQzSEvI9FwWosUDuOD3hb/SUQw1SfEQP6HD2eRnn36j81ZAc1hNeM\n7ts7lO0ASZfyY46D+c1UwU/RXHF6qzy0BzWIn8O4vHGTGebsfiJYdgW62zIg\nZbAIsXKvv1XcIEWw/W+e7sjlQBPnBt7CibwhaEIhG99CFl1uaab4lIoViCxl\ne/81Rdaa502ovY4rky8OeFImsaH4m6qv6aTle3qwCSJKZnipC81NdxAEI03/\nELScDjXYLsO7DfyvDNgcMY7/iYUqLDIA8vvEFld9boMTLloRFE+PS4xMx+Gw\nM4Ze9fwTvys3xkan4z6zJAsmOP+OoFv2E68lsrthsAQ374ESkEBIS/w8gSl3\n1FHw5NB2edDXuGywgKiDLBultvVzG93SkLBv9BwKa7eoY7u7yAfg2hvBxkF/\ncBt+\r\n=Tcbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8m4N3aJpMJIxz1GDL4lEdrZml8NJGpdJsszlMdDcWvwIhAI7GzpyHBgtSH9zJNxxvLUmobQ6buiquXDhmKC1xrda1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-config-open.20180720003922_1532047425266_0.8535154963963187"},"_hasShrinkwrap":false},"0.18.0-config-open.20180720020435":{"name":"@atomist/automation-client","version":"0.18.0-config-open.20180720020435","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"2fea00820fd1c453120b78635173c29482520c60","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-config-open.20180720020435","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2Vm4KxMysRJbfkduhiJmWX0XWjqHLle/76jfHVsl3N6LM5ZYPiop/fL8RL8K6fIm9byi8u/JeaEfEq9Uil5zDA==","shasum":"b6cb2a24d50012447edb4415d3a35d00f374f81b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-config-open.20180720020435.tgz","fileCount":801,"unpackedSize":3529865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUURICRA9TVsSAnZWagAAi0gP/joAQVPBM9S6vTqMuzKb\nRutHqMqcuu/zpXcRdnrKr99XVq7yGq51kug0XZdj/4bQKHQxXQmd//cl7tia\nzXq/pla8Ff1vKMsKg+Pu6Gq+XMY9KSrfkmGV8ZvTdmSTmsXLB2kKtznotaq9\nDjZG//vYYTBDKIk3bNcqigxedOAI3hnAIQCDLU88chNQjY8VN8Ysof52bFrr\nlceWlkH0zL6Js+kYp4IZWrm2pqzf+/KsenGlqnuZmPUHqBFYYC2d/t3/Abxa\nyXtIAlhn+4jex5eh0c2IVd5F/tLx+EwCfzGN1MCdOypGeF8Zl8Agxa1KblG3\nN8CeUmLmmd+we1jVx88e7+XZS055b7BokcInAuB/qiumysneqptVS+ARVwgv\n2utnkloOcCjnqVDebsBGFALM5bMSttf3kmq9bajBSWnoLdtKk6yQXiAQJ/IO\nTkydaxF/7Tr2U8VsZp4iKpIOdepIRhfyrRahXyAX48JmX/D4DiEaiyujTpiH\nnniNmc2r61mOh5i4BNu6PKUL8HmWLyekL1Jug4wpQ6xKetFhi8fUCOvzLHHn\nJoyWnBFjfnKiU0q6AbcKL5odsdnv6n4OhVEdD36/cNfTiFEpysnoib9vL8QW\nWjyIuS4WzYq7df6HncK2gKTWIJW1j7G9kXBbloWx96lEayRIB4AJ11HeBq/f\nhQJD\r\n=o1Ji\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9fgwGH73yf9t2DCqRn7U0RkAf4mz0djAvC5yyj/WouAiEAzRHq4R9N/qxNaADKmQESQPBqDnIpbatU2p7xrGmwvWU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-config-open.20180720020435_1532052552671_0.2125074112646217"},"_hasShrinkwrap":false},"0.18.0-config-open.20180720025641":{"name":"@atomist/automation-client","version":"0.18.0-config-open.20180720025641","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"504e6c3c82c1fa6020ee82d0d876b64691aa4a82","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-config-open.20180720025641","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-r7dExVAkRXEQH37XV/jkhEkYQqcUj1gr6idmpUPfiBOnIyqYRi4xgeVyp2iC0ueIEKZDP2qdSwQYoXvCPddlmw==","shasum":"b5615d912cf11a5301a3a4168411538e48472630","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-config-open.20180720025641.tgz","fileCount":801,"unpackedSize":3530583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUVB6CRA9TVsSAnZWagAArAAQAJ0yqTuKkO+c/Ycixa2F\npudD0Nc/zoRrNLEzPajITdePGbpcqCNiIRhqSa4bCcb40b+/Bd1uDRI3h8Xd\nlu3SRWDEM+w05x9jhJjq38dGKkM2nPon6VxYJEAAXpKMir0w6Y4h21RMgSjE\n1AW0mC2BFakwS/XGEY+9eQgklizAjiIOg9uySYcf0QUwavRrB48Xr+2dgoQX\ntH/Ta5BhRq3RRx/03Sz1CPX4b8DY5hv2cVtZg+d+eZ+T8qugXvFYL4FHWMPJ\nZKqk8wXoj9wJC8daCW7e5KlOJHl16zu30YJHDV2hxZtPDL1Cm/51SE8xmxrG\n6Xbs2AEg4XLupjKOQE0x0t+eZx3In9GAcGV2ni4wwp4Z9k+GoGgf0C9W0UiC\nVyNSvNCIDHJ7B5wkQdLpSoXTXvmpMYBdyKOWhHG7K3RBho6mr7FARUuVWERW\n44zm5DTuqXrc+d2awDPQnAL+fmrlenJ8JuiJHhECSwLn91pOdqHmEtS8R7Uc\nOOeVB3/ve2CncE2fW6dQAVGnnSbTbaGIAuQm4kWE852esFazOuj8KA55iDD4\n93qiY3otOagF6W65vQ9pRIdNtPSnEyUAJX7e4fBOJSW6WakG/Id3lOJAm9Wx\ntzQHcfnVxhn4dEeuw0J3YLaFrf3dnOrRPKvp7KRinttyDahp2iohQOoOHgBp\nQZ/2\r\n=7Trz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4ljXKiZ26Xn+G3kZIs3OJgylbNJZtbZcweNTU1GkMOgIgbNqIU5UF0VumM4W0YTUCE3+JifwLdmGMxFmFA7JaOWc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-config-open.20180720025641_1532055674166_0.11807757914749994"},"_hasShrinkwrap":false},"0.18.0-20180720105353":{"name":"@atomist/automation-client","version":"0.18.0-20180720105353","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9ba877ee4b4d3f2b836f94e07cce60d1ff2350f6","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180720105353","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TM7/eRir/ESuPbEn6yZeSLHSXaSUoTpVFpicZIVpSkNe10MTGotXAAQCwOQoU3HYqWv1+Lk1m8ZfL9PmqgXcOw==","shasum":"2d2d950460b77874a593cee2d3cbcacba0b2d7ef","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180720105353.tgz","fileCount":801,"unpackedSize":3530713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUcCLCRA9TVsSAnZWagAAh9kP/iDYrU75nvlfxUbP+16G\nWrPXIKP4jafyN2ANsHxjb3Y5bLrw48llU2gyF8VgJTlfnu50nDMKP5TMTVee\nRdG6ZmJWFpnSnXGUE5r4UhMPlf1R3AEqMdtD6tUYnEK7wcuuFcrEi+ysZNQ0\nm+0Z3yryfMIYVnEPz6KsFp2aHyebYYFtnqpU+OqSZA3tHW8MCjXQ8kkNWRhw\neNIO+I7bQmp7c/rcO5stwymav0qrkn11NCm45KwvkIlyoSGgTPKxhiHfBQhI\n7YKAHdwLFBnsHtQJrVuMWBqCVt8DmR2XlpnA2A0qEwNdaDydFE603dLlRrrY\nZCTJWHo4GSjNO84YlPYsofPqUXA1INBY33IachyRdDX2i/61jTB2cmMcp12S\n2kyrx5VTRh5sXOC2NLKow7W51BM0LeZuRXBSMKu7fbihRLpZJ0O+EVXxi7BB\nKyE0ciikPm2jZQArK9o2D65qBv0nAN75b/rqLtXigf8+ZWAbd1kOGwu8dNyx\nIkuNSEM3v/XtevSb0pLJjIOvfD/6rOfCXyj2gis7VP29uLvd7weOoeNo6qdd\nEabtOrkxA2XPHsEovPzwRVDsVXmwNHxiWhzYfP7kKfV45GKH/uKtDTnWN0Z+\nOcoJV44OchryoiruVfYcrYQwJlaNuvGfWZz9PJF7gOYU134EfhnJ4e5NudaF\nxwG+\r\n=ddRv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJh6E67Kusur2COQvqBre5e7OKq67H2Vx2mq5fZrRPSgIgcHiavRO7XdaljxFnMVx4oNDBR/ieIZvq+KXGJ9NWbgI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180720105353_1532084362988_0.9611303578895245"},"_hasShrinkwrap":false},"0.18.0-20180720110724":{"name":"@atomist/automation-client","version":"0.18.0-20180720110724","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"b23cee9986691fc73bac072ec5b6ebfae7d83e39","readme":"# @atomist/automation-client\n\n[![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180720110724","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZBz9p+TZ6KhTpaAk81UtfXaUlXm6VsrgyOO6UbfEqK1L3fhiGUOI/wAFJGjdDilC4kqS2huUpdh5gHmEuQ1h6g==","shasum":"561b84efaa190923686996856e4a2803eaa4422f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180720110724.tgz","fileCount":801,"unpackedSize":3530827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUcN4CRA9TVsSAnZWagAAwm8P/Rbum49C+Ig8fOV+5kRb\nG7WKVYJOEdkUI4wCJ6cPukZJCG4PT3mz2JoLAKxiIFmF4dPT9UButpwMp+Ac\nj2wK7U37PE9UMUe2eXVeXaV2BK/inNX4hS0ojPivE37f5EVCRjwA7TNqdqwp\nKiYRezdFvsG9qUJzUwpJ3jFAKhuTmOmGzXzxqKJqlazm0DV/fTr8Sz1IWDn5\nsN2xSvWJ0eruek2HizzazsZMzxiuO5pcuSuZTby1qQzEstbCzhpRIYvKnsl4\n9KG42gd7JSNXOTX2befTeHRl9/4XnqDtTJMsF0xHp1eLNqkOiV0dd8BtRYXd\n472Vp3mGjIJC+F0Kq3EG2qoDsac0DD6VS/94PGt3CkMkKWg9dXhrkYhGL6hE\njJ0eJX/VbHxBu23GMW7wcXRAwbV2gzHrpvjFQMDJtWPGaUByTWakJQrfekpF\n8tOGlGPv0m7zvP/HQgdonYeR4Tjw4f+zUB4N8lF8JlNb96BeBMlUKRO4NMyK\nLANtYxANmVrd8eB3IKZQme1wKGieWHQcZeTiSy6tWMNg6/zIfvT0oi0dDHrl\n/uj4fPzR2fnVEkjPOswzanIwu71TMyNnkoVWp8Mqz1IEVdXSJABypygOoWvq\n/UhQ9t2EjHqoixmDnEm54W9bfKpnugYj07K10aCWOHvRbs4jM0QfkMGQgssg\nQvHn\r\n=+jZ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFC1RQmcWnb9AYdYy51L/WIVqgX1VSLGXvFRKkhw2gAwIgXN14cbsundOQAXZBUb1/8BHwIPlsdxotBBlKUGDKItQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180720110724_1532085112674_0.7664235305831932"},"_hasShrinkwrap":false},"0.18.0-20180722063228":{"name":"@atomist/automation-client","version":"0.18.0-20180722063228","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"de7267f45b0ef7e1a4d2fc25b57a84e2b499a85b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180722063228","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wtCpRaYcBIfJQrxWr35VvM47zzvM117F/2/Ra2Ki1nsqVEvG1za7HoMHF6/KrfoPAgPvVI5l84KR1HJZMnVFig==","shasum":"6e0a03ae7f8746daba4258f7acbdca94ba1b9835","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180722063228.tgz","fileCount":801,"unpackedSize":3531037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVCYhCRA9TVsSAnZWagAAnlkQAIYiMPy+fO4IY432BX6y\nGFocJrlAmEd9o3Uql7JvMhNXXHZhUK7uqR0sPAYkPwwtKKLScchzpuuvVaDf\nKyX0QdZCUni+sRNZj+DBYKqyQXZ+UPRjqa3y+bABJWlmZr6yAiziaOFUKPQv\n7Tl/nKL75LmqB2urDpSmwEWl0ovJGKpjWmIosPQ5g+4rPZhYrfdYIq/WETOW\nh4MYQVUq74t8p+LQn8W/XgpR7NRqFJgNMPDpQY0ujj7X7/Moq5ToxlObIXTN\n6NHwFCbHt6WR6ppijHzo86Ecm6Y8ptP0arLGLflObRxE5hjzwi6R8EtciCOe\nk6eQlD59f34e5VBBJ/NCrP8+MUH+M/70Yv8QJrQUUPzCHXkjdJoWgK1YqmHe\nCEq9N1w/0axImmRqXiwPVyjxo9kR6IRdaQZMzZjJV9fz4oLg99KgBxtBu3Ru\n9vvAxSIDWlctEC8VBQsu5h3rQmINEOsQoUnkzEhZYsKR68tU/6lsBCjECvhf\nKwbBPcmnkZ1dtKKfnHDpP6VR3rxRD8P7W4CuvGGDOIhsM3UFm5G9F7zwO/jN\no5kTWwqmX4SwVIUvQxzFqp4BHxm2r1jn2ictXpHQvcvIL2HLKzbfiCdZjImZ\nwiKyJiJZUkgvhc6R7Yv4X77MEji7H4ZUwROros/c4H6cns4/45tUgjjfNNR3\nI7hI\r\n=TQdo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkvS9Jll6Gu/7arC5rNlO4w+xz3K4YB+K5luOwKtXqTgIhAIJIFKDz36CvEeql93UIjg6vp2cr7dZ9jmdeVn/Heq2I"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180722063228_1532241441702_0.13937031198231886"},"_hasShrinkwrap":false},"0.18.0-20180723054539":{"name":"@atomist/automation-client","version":"0.18.0-20180723054539","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"2153cfd15f9276c8d0eb857095c7bed39b650baf","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180723054539","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bvJHCpYZQNpqw0yBHPtYamiyUfMipS0OXh67BfReloVgYLHvls+UDAb4c8lXqOdMdn+F3rEUg0Dndts+8/LOQQ==","shasum":"c42cf356e63b1fec59c8ade929d0a760f219a428","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180723054539.tgz","fileCount":801,"unpackedSize":3534129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVWyhCRA9TVsSAnZWagAARGcP/iIbWRQxZjw/VFkmexDz\nAERL+a/GEIMZiRQd+F9fsvPEvgFTsRh83+foV2TlEo2DTQ4VmLtK2ge2NuWz\nn7OcnD6qSUCiHsNXiE4ePxRwon8ayxJHIirXflOQkDDKFuwtz37Cu9i+w/iK\nBCf+xMLvLVYQdzwK3sonBi6aP2amJ7llW7v1yp2OZrqFs2p7braLcsQN7NSF\nJVolt/86GeGvXGjyABIjYbiG/yQirwPRdDwYjU8cZBJiVTg282yXs8W2QS31\n5GKs+HaddAtuv0xB3V96iV45wFHcOPdrr4/t4k6eTXnsTgZ7ODyX/7DHezis\ntUYGQj6nTirK6nhe8qLsqtdczggONIyaGUokj6n1d2qzm3bbMt1HeOnUPa/E\nJG2RlexUlqlPF0BuZBx0qwwyrBcwx495au4/+qUcmeZHo2AFL//4T4ghkaYM\nBC3icuGsOH+LBpGmoB1aKm/fGYHENzp6rC5SclCuOn4ooXsD4hs8fraL4Ep4\nyeltRDRoRh4Z8VpgJ0L+VRXq72yDzELNk+gFha1HsSVtAZ+LS2hn4/p+ymtL\nhVxmICBFQJKouGnaJ1Z36ZO7fgvnI5SnnwAsd8UcwlYG/G0FPr0FhOIR9WMS\nRnO9/dE1pp44Od1YPuGh+upIsbjYStGAYNDorPTBJSifcVoqhvcTDa8ryAgM\nHiM5\r\n=0h+0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFNzl2ah6Zr0G98YVQY+CHYBByaK7va3GZ3qQ1nCEaJOAiBE4SggjCmWYwSiTmJOStQvdb4XEfNKH5i9BhVx7uPGYA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180723054539_1532325025198_0.7953852957065606"},"_hasShrinkwrap":false},"0.18.0-20180723135411":{"name":"@atomist/automation-client","version":"0.18.0-20180723135411","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"09426860d8fa02831ff4146fe34bb1237bffe6a4","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180723135411","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EJBKT5ihj/OR2KeqIg21/gMpF3wQOFNoIwlEtN43g9/xo0kw40UsSYx2X3KFwAdUz7lQlx9T0L2Sn05GaEJO/Q==","shasum":"e1717f054365a91dda6c7ddc33029b0697f1e895","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180723135411.tgz","fileCount":801,"unpackedSize":3534411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVd82CRA9TVsSAnZWagAAyRgP/0NzkYQ/S2DlD2+64XkT\nS0u5UW44gZNA+nFR9j+12PxpnT2aTB8UIxXqiFiRfqJ5kO/LJ4+rvu7xTpJ7\nup4ezxx5QNxX0I4BQLfO/pL6aj25Ve6Fk71MDB52gdEygoNT6MpTRMWIO+uV\nyvsyM171zREbu8kWH3q6lsj02hAfarHqIdqj2CFX/EHRYJ3oVJE/GbondueD\nxr07G/rFi682dzk59j4AusIgxhgUDkWe9wNXPU32rES47oSnsvlQuHDXbiPD\nuQT94jhP1WTcD2rSjwn7KRjcWsedH9A8TrzIG5dx1yti1l0GgM4bszBarx1V\n9Av8zSN+Vm156kkSMrFA/E1ohGPJ49rPIO7wrvPhnlGYB0FYEaAXeDWeXV5B\nk2ClNB3sxxOR9ZUTsWzjbakZzgKGd7bQjkymfoShbLRpeOctBLezZXWYm3/u\nnQCl8SjlxqUga9kVjWnLtIa4TRFyO/QYl5GS3i38eRbTWP/ienTOzncB+aCb\nIrqaIxFjWEuuOG+JS9zGE4RhQj0ritDUt33/GKctNeMzJH08A62zxksq+tGp\nMcBWehYMJ2O2Fcp8kjgkKL8Tb6EGfuXWUvQO+UpLdXHRuGyhpVrbFTthO2zJ\nO29Fmf50+IqQ9uXGpDo+PE5xCsRf5+kMHmXTNyXcY9XeGiqqqyCt2Mcx4+Ds\n/NYp\r\n=2de4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDz5xhKdnZDJzIJBx848ktRcvaM4sHinbzAiSAp7VN7/AiEAuF7apljUeQRlOCoG8BJIQd5f2CpJ+J2RgpNfQSsIeAg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180723135411_1532354358282_0.7671714044568827"},"_hasShrinkwrap":false},"0.18.0-http-factory.20180723230601":{"name":"@atomist/automation-client","version":"0.18.0-http-factory.20180723230601","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash-js":"^1.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"f5d494acf4d2442e516419e5d3f7fcb10ecf0ccd","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-http-factory.20180723230601","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Wq9Ddw4rJBFTwFMSbMO1B1NgAHls3hynYWVCl13Nui4lf+JhyUkcer98I9VAO0iQHOgpNmLopozSJsce1eaBbA==","shasum":"0ca89941f8363d5328ca3561d9d75ce00e0b15b1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-http-factory.20180723230601.tgz","fileCount":813,"unpackedSize":3549233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVmCCCRA9TVsSAnZWagAAe94P/3MxCcdnWTXpx74D3wkJ\npklSnAU+nBPjvqqVPTuWfNANv112/rCwm5RrrJV3EvKtxRXf6c/zrMiYDf1V\nbNy8LKMhNm7AdENNJygK7QfNzFwU1OVYHyiVXDnfk91gtJ3bM+Ewt/Gh1nYC\nmS/C91eqL3xUwJlSwwEycBm+GPD4V3oyYk1RtdXeqmOEV4smWD9EVM9uPx34\nZmsVeVDCjOs8F4deBHdrPv1EQTjmB6oKX4oLhTyNARqE2+xXyBtJ/+ohn16o\nDE5W0F4VinDeGkUdKk02d/zkyIjtehB01OvDKM+keSKUBiuL/zT5Prm81lNV\nIfc1iUEZl9Fuzbp3EXxum1FlB4dhpFugY89Bc/xL4dUyIvrMsJm5kHLFJdCW\n0mIRu8Jv5wujmDY8CMrgYo3pnrwf575E+Ki8uEztj5MaxeMviMXDM9kg+D+H\np1jaqae77tauC7oDMf7Rn/u57C2kuk91kc1HT3ofkPZcAAuEWWpjAyvDq5gl\ncCsif9aigHjSIjRZWzu29NoU8yCYkaHa5Uih8m2gb0Z733NNAkrphO5vn9pk\na0PaSCPekb/EQJPx/f7aeAA5fCsUbirqPuM2tZKlR6EJa3o9HLF5mzTCWqw+\nc8pR1vGmzC78bXl+BZo59xgPhgrNB1t3PXqjG7IuWCXFGMjkeLhUZ8SoXpln\nmaJ9\r\n=Wv3U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdzoVSKm4P6Z39hyRA3nwp/qEDDZ2AbwcWKlCCyN8RYAiEAjbtX2SMkAVXLYz7YffhMN9oV+BjLjfv42lmqVGbBPAk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-http-factory.20180723230601_1532387458476_0.1611716512656156"},"_hasShrinkwrap":false},"0.18.0-20180724045318":{"name":"@atomist/automation-client","version":"0.18.0-20180724045318","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"48fbf4dd1afbd4030f831e02860b1501ad740cfb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724045318","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RwnANYVmo6A2PUjok8Gr59JpC5j/MkbxLcCRrsvpChYOH1EYkZAb9EkpR4i506wItcKHYnXMnNVtLNvOZeplGA==","shasum":"1274cc97f37fb0c59237748c34198c484e1b565a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724045318.tgz","fileCount":801,"unpackedSize":3534064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVrHkCRA9TVsSAnZWagAAEckQAIjF+xa345aVN1c5BN9H\n0DNlMNWp0vfOOT5/459p2EpjVzRlKTyzZZSn5g6Gl95pW2gD9SpDxvj6mcbd\nEBh+tbMh01xs6SgcOUVGxxYBae6c+3vvnKAJzeSJUCt3MhA1Ir1O9ls2esYv\nbF+W9mFhuPYqU11kZvVzUYkhQKWbv/I2yU5SjO4l0ZnD/tAan08bjq8VYlvX\nkEfw2Su+quZlrjTVk1dXW5FJbxEgLnmo+v1jw8BnQsrJZqordDGuJ3lAZZaZ\nrkKfv0WSPjSV/6zv3J2KCcDYge9IGcq1FjLKkvvhVl8D5OhomtklkqU5oINx\nhIc+k1ghZWdmGG89sVdgKc3GZIiCBRaAUFDGj58KEO1cyQ0M8PDUdpMIJyOu\n7XFtY8TQCnb1i2m+oYJBlNt1SYdc5r160atVLXekDF67Aln66Vmb8ER/vqYx\n4bmZcc2V3NIm6BsJ65gc1Ye8xojx8kYti315BqNn2eeHSJb3Im+hinlE0plb\ng1g02Rj/Vrjn8BaiiGfZV1CzaACAMEqOxmm5hfrbWurJGd1KoXgVvs8VpD6P\nlFD+98WQ/4WvPm7AZsG/0G4fUOfpypXzvx56L59gsizxkbjGhmVn+alhlxUP\nPonPRuiQeeESmFS7bAKWfcrf9B1YmwXR81xnf+hNN2ePZR2qkTvOenrUPK2u\nEeLe\r\n=jsKD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEVh9Z/e09H7Cq3q+ZoVWUr142pMlLvxg6dGDGU/trQpAiBTdyyntC7NfjL3rN0VmWtNDt1oE9dabcaYPPKPYxuEiA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724045318_1532408292200_0.7128015153195348"},"_hasShrinkwrap":false},"0.18.0-20180724053014":{"name":"@atomist/automation-client","version":"0.18.0-20180724053014","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"61aa5828f735e4c6387f9fda730dee4af70d684b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724053014","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uVYyy8VlI+1mN1QTn0b00ETNvbkJcbOHfcJLBTOw021FPcfQIIJXciUKJsi80nX+wqyonej8aj1w71S1i9h/Wg==","shasum":"7e3e889fd6750bf6972d0990d65a513a814917b5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724053014.tgz","fileCount":801,"unpackedSize":3534448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVrqCCRA9TVsSAnZWagAADRQQAJ5pOct6sgZuDvUcsqAD\n26RaMrrlcFSQ3fxDV/FOBiLwL4kv5Efsjp1fL8+i8vCJLj3Ebrb+GwCO2NK7\n2NNgqVTrziaHT+Zsh54qeRygymzC4iNI3DaBOGlgKj+janbPeW5mvqJgLOOC\nir0Sh6Eaw4hQ9kEg2LS2yo8tWlvs0vSQT6P2MziF2ey1JG+enPK3dRP82H1S\nv1O9XwdKuhrEiq6KqkzYF5y4TCZFO3O/NWEn1x2UE6S79jq3ef7soG1urKC5\nUI4wCG8bPGuj5vAugqggSIlSwyJOAWzk6DoKEvOMPAdtL+dKFxAfe5+zSRik\nKVtt0N519yX6EtLzR+CSm63AJtpCfuJco/PvnQwr0v9T+04W8x2DayVy40zx\nN092ksvj8AqSfrPt3Ch9zOOkAAs6Zn4GDKTRu9Jfl1tK36qJPdCReNI8r6fY\n9AAzUYNO7G//F8T0RLHGEYRxFRKqGUKSNYBArZovj6delFtagTVRlf4EfLkm\nP0ROT5QeT8pj9anYmmBzW0Awk+7a1Vh7Vj1fPOrBBRwl9MdN3XLjwv+ZbMBH\nCUkZe5gPXkvmFkegCJ0URF5UHhZYS+B5TpTaYEn9UKXgS79QmQkd8oC5Q0Pc\ng9gd1NvjGSEXiXrjzB7KPA649V3WKa34pizXJFpRXT/hJZKF/rEtAAPJrmXX\n6MLh\r\n=VrWl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTfgQAp5B1hFyu8rSqwDtgF124cDktYFlePwaFLkStCAiEA4695StbMff9AumKIgnmD19UXB9dWSMeXXJLcPxUAmXE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724053014_1532410498725_0.26260515044652233"},"_hasShrinkwrap":false},"0.18.0-20180724064421":{"name":"@atomist/automation-client","version":"0.18.0-20180724064421","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"52ed791863b60856c821ea6aba1f29bc6b039142","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724064421","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XdvCjtzl9KPD12W6R3oJjUGlAWEGVATpMoEEK2K846hrTiLYmDCTa5Dt9yIjN+MXFwXfJRvJXwopEJYaovczrQ==","shasum":"1bbd7f4ff772d158c74da3c2b55c09847179b5ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724064421.tgz","fileCount":813,"unpackedSize":3549257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVsvrCRA9TVsSAnZWagAAfw8P/0m4/wrxVaKnKYWn0wvH\nF28NIwWO6qUeTdL6oHojXAZNzSionrP4JXmuhQWQh2mO+AJtysezHq0cLU8x\n0SC7jpfbgDzQYxTbZz8kn7XZOgMOVcZzOvhdUCBbFpgmeWl0rlOoolNfmreR\nZkNf0iE0OU6gwwzOh1zN3+TVEjTYW+EraLvoDwTI4r1od/FhpX2T6sBLfI3p\nh7GJAYMYkxlYLgvBtYWBLKMmg3Yq9TjHZc3j7QVADhsqEJknMcAjAIjMm0N5\n9jMaI2o74DDSdjjeSrnqoSNvrWgyr2X0mEezXlenrD/aCXpVYbN+/exlXvDO\nxBasUQMxs8S428csYXDKH/iIM0Amyfpcmg2AXlE6n0ycHBR+XQ6G4VewpZ44\nhN6hayUhFvkAmh2qBHUxpxMVCdjy6CMdssG8MBxz1lRoByBafoe8Iaw8FLwy\nbSlDYZXuziYqOG9IG8LtYZnfI8dXWIYAr5zXE4HkGv3PYdFzOfCzH1UDRoms\nJ5EotGCiwiwmY+5wy+5GoVlCfanWzRzCUR+mlBYGYfeo7quB7STdII310e3q\nVBP84+TSjknOePxrkOLaXA15OmqKsAO3jezBeXNyU8klfEadT7BZMO9aNXVn\nYYzdJGrgSDVFli+KrVDe5ekmVGjgMWukmVmXpt1gbT3m9JH7I6FC7jS5n9F4\nTY6Y\r\n=+BPs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzMH35PMdtgp9AS5wdAQDwgdoVCx9EX+H8MXq/d7zInAiBy3D97FnwZsJSuelEd3j5REqom95QenmQY3sGN3mfZMQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724064421_1532414955234_0.8042766957574494"},"_hasShrinkwrap":false},"0.18.0-20180724133126":{"name":"@atomist/automation-client","version":"0.18.0-20180724133126","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"601af73da85e2170b19339f7f134d6afc0842bbd","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724133126","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-N9HaYsVvWzfEHuHOR4kqTCm/DYD7Udp1wTcdlNTlvAv25qYlFRal9PIb9xnMqU45HEJwoLb379SpgYg7uwJU5g==","shasum":"1afd48c492f5147fc8edabbd4311db691d40fac8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724133126.tgz","fileCount":813,"unpackedSize":3549161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVytVCRA9TVsSAnZWagAA6PYQAIxx59+te8eLM6YIDIxD\nJ+zVJMZVy7PHiTqqC3K1EpQul6wyhYVli3x9T8tUn41TQnjJX6+NUU3u5qSn\nSnR2O8hws8VZqzVfKBoLtBHNN3dYEu/IxQU0tbZCaR/is4OLePlgvPX1X8JI\nUye3+1c4OO1EsV3cw4AGY5VRi2mXuMDmFxbAGMMUyGilyPwjhXHod0dHfJIT\njM0zHhvoLQEYO5Gj092W50R7Z60FSXQFk1q3IZgWvdJVH0AqIF3hK1tQQJeV\nH91+isiYCyZF1XkBGlTDRh8YUeHQ71TbPb4d8cbIXzeo2EOgZa6b4Epy3O7C\noVaQ6A/CGlTmn2L9TPXc8xwq7xycZJnsEjGvBnG6DnsPKOG4VtP+3OKLAWE0\n8Uhad8v0oTs424AGBm8+YRDV9EkWhKdnJfXfmXqSLqx/3WzrTvCmG2w7u56D\naOt12gJIjsSbgYUfVnJGBzqmvHtftH2W631FHpr46c1mwhEd/Kkd5TeixMie\nPbWTwyCjeIfsDnkfWGc4pt8mbANdKNCBAw/+7ZlGc8Kv7GDyv7Vmt0aQ0Y6J\nwNni0q1oE8ME+3TkB8weWutKGaVJucU8UsKnm+HvwRxuuFw/ydlmlU61u3xA\nNPx/2Vp8jBcOtTePrsfQXGPgNwYXlRnmsRLShXD6rXWQX4+SfkIEpKmsIylh\n27pF\r\n=JyMs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDU8a81keqaW4amoKDv8fGXmvGDUl4S5AvZOkN4PFilNwIhAPpGPAGzBz8RXXbteoXHJN1fCkXwcAskMn+KvjvKWM4s"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724133126_1532439381346_0.7192373125360085"},"_hasShrinkwrap":false},"0.18.0-nortissej.no-private-class-fields.20180724185125":{"name":"@atomist/automation-client","version":"0.18.0-nortissej.no-private-class-fields.20180724185125","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e1b285ea5e7828785ed97de958584825e2bae8b6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-nortissej.no-private-class-fields.20180724185125","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LbCkyh/bCJ6PGG9UwMHDT9IhGKa6atQCleJXu7t2DXEof1QGxHXupMykpQN5SIkrpmGwFhuztsgsfqDlLAXbFg==","shasum":"46ac577a568c72571182ff825e249f43076ea14f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-nortissej.no-private-class-fields.20180724185125.tgz","fileCount":813,"unpackedSize":3549860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV3YuCRA9TVsSAnZWagAAzkAP/3o9yQFiwVuYark9eIQ2\nqnAdzL9jP58lcwxK3UzlHXOJ9ohn1UaypXLVFanLL5a8zfEeTMVA/RCocyzV\nwztkuYdAZdfO76Y4e7QJci85TPwoFeMFecPC6gyfCY7Gu2GNA1LsvuCrBK27\nPJz3ycsS+u8svcFRvXZyTsY+2LzW30vKebMNYcGejZnfe7L37zcyqyLDASIr\nye52ZzPYs+cYNtj6d/2Tti22wbiRNxJiwB7CfpHUPQG/ff55WRzgnlYS/kaX\nzSQS6CeJqH/l2+G+Zn9iM2A12RgRwX2vnsckWPKSfvUFgLVCMn/oLzKjFpzm\npYfOQNWIS+D5kmvphRntawURWErhckm2yjCQvREIkolQWjYDRldbTZ5TMRkH\nT5yu+EyYS7NCQiG5Xg778aALte/f73PejnOKrhQ7e4tD8RegtNLRApRYgFPh\n+DTF6bZO9MmjgvIccv3CPVp48eHSYiEfMIRG9y6ChlwyxnRoe5bAeHvvf8iJ\neFhg0s5M2YUcQLB3b4WCMEH89Yi3p+K4GkYUsc8HKTKDYqszKSyVC3nztW5k\nD0dBUEZXkb13TFi5CcWmS9bYW3MCz2yH5+YoTt97ZvaAphCjYpuDKFfo6S1v\neW7+eXEUHhjZ7l5O8oWg1KKmxgB8Yn64cSIwtvDgjlzUrQXypnuhLO5X4WQX\nRqs2\r\n=PQXQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEznmRj3sQgbURtQceu7Mdq4OfSyevfDri+cDH4TxhZDAiEA9kA9h/1xPsHZQI0EyYJORlRm1OVM0v75kdYzQ4YqQ5w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-nortissej.no-private-class-fields.20180724185125_1532458542462_0.7099308630504089"},"_hasShrinkwrap":false},"0.18.0-20180724191657":{"name":"@atomist/automation-client","version":"0.18.0-20180724191657","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"c2903573811dd2ccebe413fc84340ff1fa7d1b11","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724191657","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fq7CGG/1R1sLXVb6erK/+MYQ5LkXr455ONnX6yoOexErALyK4lE+JstZrQvqgYc4xt4zc0jS3oHFp+KPQH+hxA==","shasum":"26b81a1e028bdf9cca82ca04c7a230a8fb6e686f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724191657.tgz","fileCount":813,"unpackedSize":3550049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV3xBCRA9TVsSAnZWagAAm8UQAIkijkcmnTBAztR+B0O9\nANw4krBu6X6IYnMdNNbz0Eu9dSCR8Mv9/A+7usNGOAVuMf9CHGvCjlieQCPr\nuZB5iEnLN2mGfnYp7ur2C9sMlDTZPxyZQ8IGf3EWfDBHHr+aMNBdKQ5JaA4U\nclO+ZSNrVybCVwQAP6kNEOK5V/7PLH2YeXjfwm9Cf2hltImTCKpMWT5uHb6W\nhycIkhIQ3vG1Blz5Hk9xLkDXbx3MoKfn0IR4/qFhEbckyn2SnQ15PDSV954L\nQ3XhS27mmyv3W8iM1tUsmUc0oYPupUl8RdEKpBd2YYHBagvLqXLhxJnrYpbu\nOEXAt8uR6vKBm+vF1nKz6O47f/29h7A1+j5xOPE7ffQswqsVitIaV/2geRxL\ntc28oSSwdnAAb7IgbW0sGzCIU9W+XJ3BFhp7DwYFRrRuLUaOnzd0yLCn8CJ9\nYD40QGEN5nBClj8BZPRAi9xsrhLGTyGGoXBjMgLlMS/yPKneDAFzMCGruyg5\nMrlF3Yu/S2qRs9edIqrrrh8FzeJ/xWv69+0OXhHPEFpevsC27xv1qhvzUeTq\nYCPQdAy0xoEKY3JxBCS/e/5JTbsqs2ASwscfHSPhGchhqPXMXuDoaE7zCb5/\nIRsjgCpUswIPWkauMOV6v3afIfC6yTjk/pe3brhVIrVw+pP+lfKartj0+spV\n+E7Y\r\n=runi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBr3xo9QtjJmXx3MpQGzmyYAInWDkUhjYmgS9cVpLh8tAiEApGjyNQ5LstPyIGMvbfQ8V8w6evZhYdOtG4FyGl61pJk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724191657_1532460097482_0.6127155043460266"},"_hasShrinkwrap":false},"0.18.0-nortissej.no-private-class-fields.20180724194419":{"name":"@atomist/automation-client","version":"0.18.0-nortissej.no-private-class-fields.20180724194419","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"bf2daa87d69b37ba4ebf8896571b9c137e482aed","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-nortissej.no-private-class-fields.20180724194419","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sAwrQl4WRcy/C8apNzIlhmDKQuaHdJpYoJ8arWTa8B7q8ayuNEY+6YQw+LbbAGFsFbIcXy94GNVTjzThIkCQtA==","shasum":"ec32356c63b3c7ba805e9b7220ddb7d52306612c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-nortissej.no-private-class-fields.20180724194419.tgz","fileCount":813,"unpackedSize":3549898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV4LDCRA9TVsSAnZWagAARoEQAIbM9g1tbBFI6rlxwmgL\nxDYjody/t0ZUTQGrTKptT7TqysDCQmP5GFzFO8okBcUS9dFyETjxgWQbflIt\nRcUCVFypxIhFyTgP4VNMtN6ghJbWLsF7+VbJJgj2x08v68wk/UsnudTPYSrL\nj5p1I3Rx8BllRCTgM6Cxvamwsqsqfv9ZKNDjH0z1vabFS+za8wO7ZVmHC4fK\nXNKZgoUBto2iHFMgnbQuc5LimPu5eaRggkAhDKM0LdImy113DwgSvH0NIdcp\nI03gDVPjPqzubQt3ECUAjoT4Rea16IdunKXdvdXJ2vKhSbknsnBD731z4TGD\neaSHA5DHkthDcRensTS//SNKuqrPav2hzj2p3oFYXvJ//pas+bDHcgPOtSYk\nBZ5S0t+wsyAUjppx2OqKunz0u2Ij3Lhtokyz+9Xg2XmpppOGZ4GWcpZ7b9Hm\ngbXnJgF5LfLK5Ar9dalPwWFIAZL/R+mZhXP0uBNrhnH6xuIca9BMl0uKBKet\nwOWgeOjQfPRR7G5RUGZrp2b+I6RcatJ05C3eJ4q1XjZHvKvNOAjNMEcEoFTx\nViFgW42weLy+Rbi+UVftG/ttLarXjycivSjQIpHhdfHu/RQ3RepglgLrII5g\nH7/Dy1Pd7CFyd+Caxx0zKTokYRVmM4NEsO1aC8igYKXbUQ1Oe6wjqbu0UhnA\nqDXV\r\n=fM1/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATPLdCom6UQyggsgEyYVdQu1ZJXRj2vuyydfMAH+hlLAiAZY9poC9fgNemGMmtT28J9Z813oOiclZ5S9GPeyrbIGg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-nortissej.no-private-class-fields.20180724194419_1532461762994_0.8052250963043397"},"_hasShrinkwrap":false},"0.18.0-20180724200455":{"name":"@atomist/automation-client","version":"0.18.0-20180724200455","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"7a40a859f0dcad433451b6c08bd5f2bc6b10cf93","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724200455","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KnRKTghn2fNhVVo3PfjdgxyegS9Yj9+KfVNJzfsR9MwEnxZ+SALVIjARo9kn7f3VXtllDkftCyLfH5GjicMmdg==","shasum":"c33e78be79f8ee79c5bac2aa3f22510594ab3c91","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724200455.tgz","fileCount":813,"unpackedSize":3550752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV4eZCRA9TVsSAnZWagAACcIP/3M6nNPnK82eYdD2DSAz\nXhwMf0g6V1nRkW78ALW4bk59/KWDZil7NS0E+gG/CMbuInX7JaGfef6nAzF2\n6MztZhNBi2R/GDtniE58g3XKrKHv6CJBuT43lh100+4ABalPrZiwSjCYvWfW\nylQnJhWcmArkD+YAovvt+JmPxleWe2FQu21TVHRyrYwAG2GEUYTA2kNc//en\nXMgC4fJuBJQEGs/vkLJL1TBDt02RjGEGSPOv/hJJrdUbo1cc3xbiTtNeTUaC\n+Wr39t+LoxPjhKWf34C73j2ZfD/kHxat2vPiyzB+TNr42XKZ7dS5OT6aFzag\nw8UoMDctz7Qbq7S6lM9af2+lRrRPMi8pW/okKcOSLneKG80+XPxDXsKf2V5y\ncS4cWemamfjCq/oraDSmahIqHv6uVNXm7tTf3mx8e285XyI4U1+CqTLih6YI\n0PpQpMRvEKGZmETlQK8vk69AmlWGJVzEDaLAcSpeX4RDeeJo0bp53hVDgyd2\nLM6TTIDTyxzkS0GoDNNdesFyzGAZHKf61hlLmiPPqqLCJvKK/IwLesAKm1b+\nldZpZeHBQt2AL4MXZKCFBLH79vsiJSbgH+CMYxv6wRp/A2Mul+nNggqpln6N\n8xVMdF4u7Si3IHFVCiYlbF+TNDLxneIRx/LGnRq1OWb7/ZY3V/Y0qxfv3yKB\namBM\r\n=q/UP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChFnTBNGffAes7vFyDXZuPEwO0SoZgMtnPBmnUbG0AnQIhAL7uj56DR+q2NWtOwpYYsCHdvof4QxXvzjxelAfR+TOR"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724200455_1532463001437_0.3452572834077292"},"_hasShrinkwrap":false},"0.18.0-20180724234011":{"name":"@atomist/automation-client","version":"0.18.0-20180724234011","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"79b9ba8680cd9714778e79afc1f07aa569ff105c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180724234011","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-I6gf+67DO9ay9QHiFvdqjhfBuEO0JcDI8JPDWkm3Typlmy00m9CwKJnZs+pIIPQKsuuuUhvGusxX3BO/25C/vg==","shasum":"9681358ce66c4f64b973fb4572eeb8f278f7fbf1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180724234011.tgz","fileCount":809,"unpackedSize":3540908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbV7oZCRA9TVsSAnZWagAAuEIP+QDw9TuIH0cbSSb5GWYW\n9T0zCKapMy7l/MeHpPU+o/uJqBqIROMU6aZIhGTo87QvIknD5oD1fHMhN/fO\n6e+xxu13My710wZikP8IRG+EzREWoMIn1qAuHePbMacMXqmCraXICXa1fKpi\nfzXKI61PCKaL7Zwd83bgUuqdkj0DU7dLBPW2PbuLty98xZKzwBxBfxNVdlkn\nrqf+azeryiTtacNdC4rbO9k6k7TYkWn+9juLBxSoJ3Z2sw/Mf0udWOUGRywa\n887cY8JNj+NejCZceitcHDeFgBPdFEnvx/vv1mUrUdPFC4B9tOgdJTRYhNut\nV6qJF/Ya/2T6xTrZPZK22lkVXB2VKJVE4pfOBXSeVY59rU1ZDScyaN2PFBDg\nJlJUhK0/dE7mTvTCVkUjnTFz8NqCDPTkGz011um3t/hBsysqV3MswfPbyDw0\nnGBuW3f8wVH0Ck93P6AixXLuBlaK/8IazW/r4bto//KO/HTRYqEjxhBLw8q1\nesoPCzMN7RySnTa6MWhHYcfyaaTQCmFL7s/GUQ8ZNixeDPefPaobtJQ6ucdV\nCO4IOO9zl9ak5H2oRsYIRdKIgsZSvLvcfpUJSTQfmp4e55xkhOMxw/oizNn4\nJ9/xWKYZ6yCzsdqSwjrgtMTuOcRipCw8zZiLWS0kU0Wcx2kjj/Gq58vZN1h2\nH6wP\r\n=TtsW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCHHI9KACH4rAD57Mzl+xupyARLR120m6DFRHET8j0RQIhANNwyQy7PbG3ft5CeDhtIE46IrpWvf1vTyU9cEX0/as4"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180724234011_1532475929396_0.6139009985712685"},"_hasShrinkwrap":false},"0.18.0-20180725121542":{"name":"@atomist/automation-client","version":"0.18.0-20180725121542","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"305114f6ace783cb52f857abde3ec1801521fa5d","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180725121542","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eIts6C5K7jr6oaejUVH4g91EjKwivXYjggk4WjjVkl48aYuk7+THsZ3uFVfOYwDGLGUD5uiKsZsz56UePSciSg==","shasum":"3eaf3d31fa81fa0bfb6249f11f120c4691f9b5b7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180725121542.tgz","fileCount":809,"unpackedSize":3540976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWGsKCRA9TVsSAnZWagAAlzQP/3BwKUr7T6xTTyngx+tP\nGM0LfmjUxNkWjSn5bU1zPtJCAwD6wkURidZwtnrFI93siIjAECw3BamZHnRw\n3HN/x8eCGABcq/bCPeILpIHfPPzNu9tUP+CfW/mWP6rXbAESMV42ZXykDU9S\nY77sHXcIleRs1uePhtlHiW9I4xDNoGxa0oi6lVWE6Onb/mLz1s7vPM/Lq/DR\npQ2wCsxkO0G1heaICYuHfLxG1xVY91c45Is6V5We7yg3jlaz+f4ZFXf+nfY3\n4HZY7Tf4CEPxJCUPZ8jm67loj0pSQB9hI0KToqNrAS7S806dFekXEICimlU4\n5dEu7kVZfuZmLAxvRMoUT/TAjR1s2JgtiaxlKcvl+7137vcjuoOPsARSqV7Z\n/H0eTCgkcR8qZhZVS61rHqfZrHVxCyKXzbLNcAmmWGDci7aRupSjcK6n8PJQ\nFLNGBHaq5mA1hxhFY91One8rw4I5UXH7UQnuaiL9MYC8mxP+Sp7k2Bn1HN4J\njXF1UMIWKKz6fYS5X01QUhPPj6w8Y+Lbewl6MqEmWc4yZC1HPzrFWeIrT3nj\nX0reuJo3gt9qK3toe0/8fDH+1dQZowDTNzVmXibRH4wBMo5Kn32QTtsV3sH2\n7oGLhee8qdJ/EajdsSVd8B88tr+AlgfXbWzuYIi4FhMqJAZelWQyOGoweSqb\nGwFG\r\n=V6nX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqtd+XMPuMSaxhLCAe3xOlqeHZPHTZHXbFP4vDK8RUdAiEAkRlQIpv8Fcu/AcNPY1uRsPh3Pb9A2kBRxJ0AsqcyvE4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180725121542_1532521226231_0.4348040762350873"},"_hasShrinkwrap":false},"0.18.0-20180725160322":{"name":"@atomist/automation-client","version":"0.18.0-20180725160322","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"efc1a099f14f0e5106dd815fad6a1c48da9ea31b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180725160322","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rj7figRrOzByFhtdbSFxG1K8RONDK9XcXFEyPzqAIYXaMMBu6zUZ6yEdrr+g6xxygbpo/2nwsk9pOoQLAuTMRg==","shasum":"deca5711682e39696c43671c6bab9e398cc17170","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180725160322.tgz","fileCount":809,"unpackedSize":3541221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWKCCCRA9TVsSAnZWagAACPMP/jXVbzT5QHyZdypKpcJ+\nny/9dlVWPR7sNmqMP5kcGgDeC9p4kkUqW1lFt6hZ4h3Mdj+2FFNp3Irc1yza\ndD90YzHBeillbPTVJjKVSGrzWi38vwoijt6CDIRvceQrH9ih9j0exSIUTfr2\n2o12SdndQhAw22Qf4KKzm/BHA6uzRx6ZEmNZCPUUUcl6TIzI89Q7/qL5n8y8\nSGYPgdH9Y976BRFu8kwATvDxBOLR3yN6A/yGa52kfnV+YibV0lTtNLYRClu0\nM8YBNzHNJyYeat5BtyXs8J82sJYugqSQsXV6egAwf+GMq6WqvyCWBtAJJxBT\n3n7Mr7JvIGn+W06Mzg/2Cg1+rW4riKgyKdb5j0TPyPwTo6h2P7H6bqaspCwk\nfPk4qlmyEzI/jxSybiY53b2hZCzbpZ32B1Sbe1PFz5FrTPFWwbh4I5Lx77vA\n2vXpXLQ0RedWvVKTkuubQ6qxfu/uC10NXYYpGRorQn02e5PFGL36bDUtFMjq\nWwGgIy3YtRfOWuAyKrV/QixFaaaHVFO41kqwT3Ab7XDWluJLt+ViJU1dhBMK\n7oF+FNSnvjF14RFYDHOXNZu132cz28mE0QQ3eT1+8znGzRL38OckSF4+JJ0F\nTjDLKR8d/+c9NDBv7ughTsOWA2GOTiVpwuSJ/AlMX7pOH/CMb6eerLLGzrhw\nZ4dV\r\n=rpoV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXP9u+o+CUDhveZJei6zLSWhey8Sx+prr+KBUFhxIwSAiEA8XBsEgKbGzHWHLt6Sxd7KWMNuQogoE1SlWAnW0vVqm4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180725160322_1532534914176_0.7023561149350637"},"_hasShrinkwrap":false},"0.18.0-20180725160538":{"name":"@atomist/automation-client","version":"0.18.0-20180725160538","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"52bc66dda24ee0dc647d01568172707e61b9e063","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180725160538","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-47pZJnhLOTbKLUxv3FX+ssz9c4xBpiQdx8ufXRpHH3TOrlfjK41jyCRY15LjuBUMnb6EeH4qw+f9FqkvnPuigg==","shasum":"d5258af8297c6b8537f4b599e47eb302edc62406","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180725160538.tgz","fileCount":809,"unpackedSize":3541802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWKEdCRA9TVsSAnZWagAA0YEP/A2Nd9gZsyvhHsv4SXQp\nStFVqF7c4iTQyzbbVWf9sRtP3F9sRoNMgA7ZdX7B1nFv9ZiqwiMeXvQw4dnL\n0g5fC4TLqObynKwPtpsdew2+8NsXWD7vnFpqK+ltxIQBxvqvFx7ibGU+xb5Y\nvST9X694dO026XDkQ9Jj+Su5ghcErEUp58f0obj3hy7pba2m3MdVN3fm03tK\nTBtpjn2owSuKdIbsFUBAQa0Q64BgCJ5OEc6YtnSaTLL/9xlYyJnCFh8boi9P\nkNYhETHNf+5z6fmekAqNc+t67jC0KslVFD6fP89KhfH2d4IxrORFVyo6gLxk\nWXSTQppIaPTTknFbF/dhLDvq3flmdeXUOIJbpwK2nkM+vDzkV25qq2kcijk+\nmYeXoFTpFZ6mRYYVRglzZ0syE6XA/5bn88lqT1tTb3ojuUko7Ni81Im6QkLI\ndIk7V7qVJOx0rYl5+MA/hg3JGg33Bi2h1oZ70Gn7z8wXWYj8syScKQYodOHA\nlzQPS5lJ6YMmQEpG2F7YpcavhVdPDqcK8XfICdipMM5Dn6js7fyBy81rIiF6\nfHNLhNBZtk5vprrGghgxCEWDnKFNcQ68PQS5ezT5Kn0LDSJhCYkczRXCurzs\n6acMWsN+L6Rr86oACXTh1s/2ZR11eVacuSQ9m4mblcpfgOspF4M5I416gp7L\n4PfC\r\n=i1P+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLPdGWN68ViAgOnuN82RynRgHu1pmn8iYBosm/CIaTJAiB8ym4zqtnybOVU/rUHzIR8j3dVZRYqBzHZ1JOh0F4J2Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180725160538_1532535068767_0.6449523776257404"},"_hasShrinkwrap":false},"0.18.0-nortissej.fewer-private-fields.20180725183107":{"name":"@atomist/automation-client","version":"0.18.0-nortissej.fewer-private-fields.20180725183107","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"84424292190384f245bd1e70fa477d0fb5292c18","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-nortissej.fewer-private-fields.20180725183107","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ckUsir+Pg2CH81zM2uKJmPbCmlkZfgKhGsW/nZhe6GxStovgxCAgpbk2HqbdJx85OsCp8a2rq5RMGaZMm6LUHA==","shasum":"0760dafd2903dae7ead184e3b2a5ff3dd577449d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-nortissej.fewer-private-fields.20180725183107.tgz","fileCount":809,"unpackedSize":3542720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWMMQCRA9TVsSAnZWagAAZZwP/iGwt3vAuKtLgzpfIfaj\nMdwl82Owg2hSo/CeXXyR6As+ounS/UwqB3lLzFa2kCkzWANsCC2xc/YrowQx\nLJ9bt9R0k9x9QQphixwGgHcSFMQNJpXZ+Il+JBmAspCtxzwH5zL8WZAk6W9C\n40Y9VKKf0Bp4Z42i2tWz+BhmQV4CNYl91Dztc7nwep+8Un+9teh9y6axIqF0\nsYoQ3fon0wCT8ex51AWAa2K8NS3XeGe1s+lgQTFUmeCTlgeHZpKrtzyyExwF\nyemwCAl2QY2kA2CptJ7wu3dI2yknW3wHhUDRnnG+ljDsvtsG9/cwgMNb+1kL\n2x5AXd8WVY/6vnVhvneYuhxuzUbmH2fOAOvQS+GWnJuogFEtwCm4p1GVLBv2\nT2pGgQZL4qYUaWXMLo6EAnj2bBLJIoNGWhd5pXNzPeXl7qi+64r8UWV/+/iK\nQhoR7u2D1xFcvs0zlElp0pJvB3Dp4/KlaB45U6GuMriCQCdw5Q0LPuMMahNU\n4PqUVc9XRt1xlPsqNV09hnSiubMxpRWQb9n4+QZJua41gE2+4bud0nD3OOt1\n1q5ELCSOaNQ60yghclH+rBGw9SqLbQikopDS83WPdZcFqlVwGMoBBRDvTyZE\n/ITq+JPVhLKIq7sP/9R+4sDWDPNLEf51moJ5sXEca6yyQR8y45XwQhIGSGOA\nR4Yf\r\n=cg0I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1nrE3uosrUiFFkZMU7FIoqNcCRWbGyB4sELJyZ1rTmAIgVdhgnI6U78Z+S344Y0N12gyi2K/JU+BeMyH02881aZk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-nortissej.fewer-private-fields.20180725183107_1532543760226_0.9832967992522239"},"_hasShrinkwrap":false},"0.18.0-20180725183614":{"name":"@atomist/automation-client","version":"0.18.0-20180725183614","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"3e11bdfe3c7ef32320e6e0f2e88e9289a46ea76e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180725183614","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XwFuqtdmXgvOu3Ty7AiKJTv5lmbeGA/jTX7DL2eMiAS7jg0sxTendq8P5Dxc1L9djx5ihxs56r+S9snpyKkg7g==","shasum":"2cb22fd4206dc9cdabc19d2c793d7d608937a01e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180725183614.tgz","fileCount":809,"unpackedSize":3542689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWMRdCRA9TVsSAnZWagAAJaAP/2FZQF6SZUXtrBH55sp7\nJDg9O3bq+md+c7tHwevGHjQVjWA4XbQWpFDheb8Fa2C3pqfInqzQ1vbZK/lj\n1iqOANB+vWt1a+LOm9oRjqAgaLMiOngDJQVR4k3RLDrT+ZKG0uOL0401zMfj\nL+WO/id/R5l3YQ+7Pv6n+FXqumQEymvQiVqfYkqq7zb1YvO0v+RjRyTAm+n7\nJWszDoHumFajVrJBtNbyxIoxXwaYl0OS4Modywej7HNWWc7w0J1akE6Exqc+\nXNS3f1Y+CcGmpR/iM+2tvc8PxZJ2rg7GeNgqWZOplxTPral4caQyLZtzjbhV\nqaFrlNpW6K801jeeGfuF7sRh/+NLgBV+UL8vNcgofdBP4c1st3WURuaQ2wrV\nUN2PAD2uiHsOmZ0yaAr/7T/qwILntkNxQ+3nFLIxfAhDVS0p6bAoo8lzkiGF\nlsXQzx+yudn0yLqIbRGMXVXCElLGzIvtcAkj7PCygdw8ZBzVwi3d3ZnQXYaA\ncNJyIKBmVqcLwly7b28RDcYt9jouH1iSlD0Aem42jEhXlJXNpU4AsmLcYURc\nxgQI5cq3cHMdu1FGI5oETJfP9ni4FUVu+7v9n4Bakc7eMIvs3PopOzugSPKT\n8FEfItjLZRiEmJoUaOZSKPSZQjP+feibTy0/F0/goJmOzkAi2TV5VNnGOyjb\neG/1\r\n=OulE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuQz4938gjVnctzSegAYvXSbNWEuLFcfoSrYaRFs0idwIhAI4Z5HnIGKwhHHp5vv8dg6BKpbBrg4MIunFYpiLVnzuY"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180725183614_1532544093206_0.08704157907422405"},"_hasShrinkwrap":false},"0.18.0-20180726075348":{"name":"@atomist/automation-client","version":"0.18.0-20180726075348","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e3ce94cf32bf3c6ec3263d0eb382f698e169465a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180726075348","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-n4Fy2o12vRWOPWTH+aoDRKgCoSNUJioShfIYwpt9azXTvX7Azmu4e75OP+Aemd+ATe9XCH0DsTgADlhz+E66vw==","shasum":"f7dbf33a919080632de8ddcffcc8309d787320e4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180726075348.tgz","fileCount":809,"unpackedSize":3542693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWX8XCRA9TVsSAnZWagAAqnEP/A81vVhLkI/JrKiJXVpX\nWMX3My+yyDtB6L95KUwCfOyGB7FrEoXvkHIVcJzNqUdOiCLxcxoSeHF+sOPn\nVMlGb9woCGzbjIvd9O0z28Q+BkLkfo09zQDv5eqIOfyiVFgkL8V91fuHFpsK\nBYl/EAKyfr1+JiHw5TtpNnTUh4zWrUc5OvAA6868Y3lSHLDF9yT3zkIqd2sb\nkw2FfgpeJY2wOhCBFKseKXkG1e0XVQr3LB8r9VqtZOT103OxHeIlx25ldSoD\n1wLvUN2eP6IylCzjGuxxpcjur/8hf5DYEXLV7d9TYEXI9rJ6ZyDm7KCR3OrB\nQFxryze9odifMolgMce6mCNRhQShtsClMUP9FzZUWpwg00Djsl/w5EEWOrVj\nrUvBMD4Q4DaIaKkeeR4/m7SeGAmLDAmn7YZKjckdOQmsxKkKyp/791YeS5QH\nDP8XGzaAPSudDeH4ckClusEo4y97Rw8x5s84/4dRYPfA8yFUbNoLPfzWQaIA\nfjhO4dC60iQVZ/ac1D1DVIyH/CsTMRoOD73emQFw7sUQd/A2iMcQ0Epbkm3y\nSuycFsYTUlUkYDyjuHjxxncpoHOeVV6nE4Xx4Frr0Ppq29DdZqrSYiAN06SS\nx8fuK46xAc92CMeBM/A4Ccknyvc/we9l9UxRxM0sxqEXVcWN9CdOB/0VONPV\ns0w5\r\n=aP4D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdfBhwUIx+BHkL2c/LI/GINXc7tfJ3wPqeDjhO+8HRdgIhAN/laPLeCYwZYpR0XyogCG/EIykxjL9vVHhBuLzYj9v5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180726075348_1532591895806_0.8059396695285177"},"_hasShrinkwrap":false},"0.18.0-run-command.20180726203335":{"name":"@atomist/automation-client","version":"0.18.0-run-command.20180726203335","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"60ca80c6ae7b7b402891879ddf5eba5ce485449b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-run-command.20180726203335","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HnM8eY57dWC9OuU3kY4RXEHTAsRodnWdJUjjDBtzJUIHq4WoadQQSyINEhjMs4fTVB8KuS3dxrthJ6CJQzdoew==","shasum":"850c5d390a1615e809bd9df546c720165ca95423","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-run-command.20180726203335.tgz","fileCount":813,"unpackedSize":3550405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWjEkCRA9TVsSAnZWagAA4xsQAJAoGVgD2AXetcxHtqel\nxEe6EZHaN03YRTwBGxJLi4l7SkreO5Iu7DuBvL2DiSgOFVnI8/0t7+OARSTz\nsitqApr3977u3nQ/7qsJuy9dIzavVvh/s1iYVyiDUL4QEyJzs4w/u6SlVWZ5\nYPWOISllxtLJ3QNMhiQEV2rOMlWyCnFdNKYrrcfa6ctesTlFJ0RnVxnRgvn8\nAEl8bizBrhthIbLkJShWUP29fK1LO9+0nPZ2yZyvu4IQggNcdrqznmZ7m85k\n6jhbw7FCe9cHaOPX6RSEEevRAa2pXptfY/A1A0FUXt7kBVydqpO0N4jUAjhO\n+3xMAK95XV56VVX9kABQtqLEU9pAajEJHtfVXPpTvOo69ypsdVTHxVpkeqt8\nqvSRoVDtsMEsbIGBgpHJeGKmp6lrcOiD9uzp1GPJGVsxE213Tj+z/tVilRDA\nStFipCZ7kpDsh8Fk0Sf2e89hM8l8h9xV4plxaqJXOgGVo4nu+RreH01JMBLY\nKpvpD0Vq/Imq9H6xKc4v9ZnNhc3uUVpzCvpq+zygLm4k4GCFB/1xTgGce/oc\nXNZ9f3UXig8brOabz0eV8zH8VlBzd2XvBKRCuCFBxPfduShbmH/Ui3mxEYMH\nlb7bbomLm+LJdsJ28gB4eNFqeEamT0olY1HbRb3OwAnl25K/nnSKE+7TYeNS\nXro1\r\n=/cgt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKUSdGNMdnGYQSlHUwZZfVxG0btdKMU5dkIZT3WMPmPAIgQvGnt0bVXfSeZFslcluqbJjbIxy/eM0TFYMCmq0bhiA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-run-command.20180726203335_1532637476338_0.24265166183213016"},"_hasShrinkwrap":false},"0.18.0-run-command.20180726211157":{"name":"@atomist/automation-client","version":"0.18.0-run-command.20180726211157","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e2e405d3c16dd6ec025b38217a91cbed689cadc9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-run-command.20180726211157","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9WdM4QhV2i+44VBKmLPoV+sSHKN6Gbv16Xw47/d7C04qhJsMgpozxS/Z4JuzVK9nlWB9JDALZOeVLVC3pmYoJw==","shasum":"e4a20ddd2c292f30a4294978c00a1097aa5ba054","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-run-command.20180726211157.tgz","fileCount":813,"unpackedSize":3550947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWjozCRA9TVsSAnZWagAABj8P/R9TSDMWZOtr2eBuWGjZ\nR9cMWJRjD/NLzJjleLidVosQoc6H++P5dC8pxyjJKh1qcfKjqRvHs6DH7wdN\nOUs+f7SJC8KGbCtFBA+9l634WzY07V5GKdjp/4VkCX/NT2TVtBFulHChr8Ut\nUPyCR+gHSdga4F+daKJKzslCV5LE/Ks/xEie99Oiaci8GCu+vZPgIAyKAhMy\nIr9w9PkylduR72B9d52Tj6VbAes112H4vTg3AFVwlH+FGw4PecpTBIsfPy0l\n0vfJLtQG6srnlIE0oRTuN0m1+NE5IYfJTfWy7rvmKl3EYFohJd/0eSIKHkjo\nVG9dvc7aJ7zyWz9vTGqWuge6Ea9sxce5coe+0LXhRCAQG9ZIEjXY7bGwjHlZ\nJ6J7LYYgSPM274g/EwJ4M3TCRwqPIn0+xyyHxo2qyjr5IkxKIDWQiZIHQvoG\nJxapK5YmHNYS/G8FFH048jiIw8jp6Qt7+PaCBpo2Hw2fjvXrQbvjVL47l9Rk\ng5j5cwrOQ6l90DYtBY1yxV2YqRpmgRWJYxInYJbi1+VaGQXZWbzzoAhKYRJ6\nZXrFf1SLl/zBDOL1M6uTGojVowm/n4R1voLnsZt2mtXGOP0iGWWJgUPoH921\nZt4PVJMZuKzyi2Wze66kXdZJoEH4/A64hWILVaDu4tdvC2+p5R8rxnJp4QAI\nT831\r\n=u664\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH2Mtx6k2S+sl3zN/z01tsNT5Jp5x8JXWfhn2eBDDFMsCIAmhyZUXjOHfPRW0tCef+5AF+YsMG6MVIMK6SBmY1wrI"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-run-command.20180726211157_1532639795250_0.9946422746659926"},"_hasShrinkwrap":false},"0.18.0-20180726212606":{"name":"@atomist/automation-client","version":"0.18.0-20180726212606","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"dbe4123d85f141e5a85c0023aad440a492bac3cc","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180726212606","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ksZ8DGqPbNYoc7xBvAL50IYSX410MXMU+Z33o6JPKdt9UWQtL1vfxyYdAj6NoiQzYRP1GFpAiyPAU/whgFnC3A==","shasum":"19018344db5217b138d808e5d8e01bc3d3feec6e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180726212606.tgz","fileCount":809,"unpackedSize":3543643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWj2UCRA9TVsSAnZWagAABHEQAJFI52Tk/oFRkpde/C33\nYwolON8f95NKLdK55pmsXzj3W90aj5YVfpy7XvPGR84k7BNlOb94RKWER3YG\n4EzU6LdNTmnzurIZPO4ktpLE2sNqhFKrR2ZxlN/YtJsZqyPn/v1ulcEntzNG\n01qbTozJW79AIRmhmr2T8miBbXJG44sRPYQXds+LlelyYAe5YmdTyvLhUDsM\nyqCeEuPcAWdPR2TsIIR+BwFJEmD7sl48VoAu42/NK5ysVQBMajJ48j8HW5Zp\nyNhbUCuJIjpDs4Btsiwwaxll1bXGp8K0ySvVwINhUkcEee8iD0slZsImONT2\ntXb2V07XvaG9cUzuO7pV8CkP5XbY/s2+0bPtPQM3OIgE34eXw9NnlsOw35bC\ncvNiKMT/dGzUqMU341d52det7vI/Qu4zqJ47VW9ADdqK0HR5m8IMkaUgnFzm\nE0Iv657RcVNyvCazLHUdY/sTUZp3hChm6GwcYIZUVZPKJ2lwgpTggyoCGQme\nels+Aq8rIhX26Vf/tTDxQ51WxR0wWv4T6TuFUCur7/P/522++H22N6KvAiWC\n+Izeh6eq4o96p3yx4Qn9ahHuPOKs1GMLddizaBLnH5SwaONn7gOTr4OUxZvB\nfXbfPMtswVghMHJje4Qe6Brp5ASZaxXo9A7XL6DAvIsM42utXkm62mmyujjz\n3ntX\r\n=nCuF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7TnxPKp5N+ifj/OWos3Abtk81KsNxRHHj9yeHKfKq8AiEAqNmC2dP7VdHjQPF0foYT4cVX+eCUYqqGYYywU8JZrjw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180726212606_1532640660697_0.3365133019528441"},"_hasShrinkwrap":false},"0.18.0-run-command.20180726212701":{"name":"@atomist/automation-client","version":"0.18.0-run-command.20180726212701","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"f758ae5f66fbacd6550090426367956a73fb571f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-run-command.20180726212701","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4nKEdrIwSba7EbIwI1+SZAwbIfx1cIAPk9+31OYjKjoqVAnRvGCHC/rsXWiz+Lg4xPqmZnYh+8Vo/xc39Vierw==","shasum":"1c33fea53124ec5112ded6a8236a76182f39e77b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-run-command.20180726212701.tgz","fileCount":813,"unpackedSize":3550947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWj+yCRA9TVsSAnZWagAADJMP/RtFnOoGMlzWRgECaGoM\nI+FigIHGuT69nGz7TYx9mj6J5VXOOwl9lNJ0mGKmNOTmRua2SWqs3F1pZa7u\n9AIaI7Noofaa80PAXHYfVdWaI+Ew4jCENIqgUQ7OY1DVH+qaIcHn5o4Tktfk\nKr1CCV27VTa5eTuqMPYKAgXc3Boj5+yGjvMvyk7l1COdsi3Ep1yMsfCDPYDK\nEoEHr7CM94N/3cn41cNJ7TljEe7krUyX7ekuh41NC+/x4G17JuwamOjUtpYS\ne7KleEq2hCwm+Tf93glhjqvitDsbqJosxd5I71Au+gnNdmpKIw4cs5P9j1K8\nUrxBfByPp3EwYSCRKaKsjNzF9AlE4eo8yfLS8EIWcAbHjKr19aOmg7hjI93D\n71/TYAK7J/kg2gtyX2CCkPnR0LS3ANzlVp+7hIp6qPLuv3d0qhjuLVQzZ4/C\nCtQkr46+DsF7pHLIIGScHbcJDEEeSQ71N8eCuknQ/UARKf2h195iaRJwkWvA\nVxi2+hZrypiEqIho4qezAiyfDaHjAW1i4gCMs/GwBznrLNurXm96TJbFdGmW\nGX84BrZ1YIgWoo4HtgBS+WH2U4w6iGy3dMI4Isnm7YyQmTNw6APHLrFQ4wZj\n2o1VUgxxOwj9A7eRgSsGTTEjOhROFBSPId/CaGdnOrufqSVQ+TLLtKLKMjFX\nrd84\r\n=JyuA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIChIanHaWLmyOg+K237gYb73t2+JTkTvBI8/9Y7PclsKAiEA7WmKWofmYtsUlzKEBMG6ZP1jQ8QYWJ5LhDlUBy8jWSc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-run-command.20180726212701_1532641202610_0.7511910329991267"},"_hasShrinkwrap":false},"0.18.0-run-command.20180726213119":{"name":"@atomist/automation-client","version":"0.18.0-run-command.20180726213119","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9b208b1c4a5e49077017f03a1df709cc24a31234","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-run-command.20180726213119","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RHnbpOHBHqT99/QHWYAAeGHz2An0FaaSKXs+jXEJgvRsJodgg2+kYpwVBOlZ1Wlyg2F0F2JZBsuxwiE0vokW6w==","shasum":"96c4d88d77798fcb185ed5c6d4529b1d8bb2c32d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-run-command.20180726213119.tgz","fileCount":813,"unpackedSize":3551897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWkCbCRA9TVsSAnZWagAAlcIP/ipddk+kMZAciL31o3kJ\n5RAEPLg9FJ3GJp8yrSTHCMsjAoACQlfnDUW/Zinmluur4Xu054+6NOfGFBA+\n7LZTyjPKakn72QjYmjBNsXFGB3LWRy8AD8aEMXMIfEf1s+o+rnA01BKMC+IO\n5Qvqv80rKEAnVX8rpYtfMhlkfKwDhvsXkVmOhc7HhGfJj2qQlaVqYcUtH6FN\n9UOJBBq0bXY46Xg8oSpG5R/F706BRZKG7XKTMk6hN6A0gD2UChC1lt75B66c\n5DyaL+Afsw8S2qBMN/52Wlxhs4M3UIsOeGH2n2VjIJcKaDWkz1JI3c8HCkNj\ngQ+G0SpoGmDQQcTyp3+4ppaic5TVu8JhT+5YAhjrHu1SgA1gtSgUK3G1EZPu\njFW/10vT2iiNyEfEqSjHEPnMunNmtkVZqWvT7YlU4o5uCcIJ9lxtv4No93N0\nOywqX41Ri5P3WjTjEhIeYsErIpkStaGPFRGfDbo7C6vWIrTx9lvlLgxbxd++\n4yWPAAd1TsE5mD7HmHYeT7NQdBTaqftVf4sD20HBtkmlrwoInkVEOywi/oYA\nK6KHPWXDfsot5HMA1ZGwXzQXap2O9ei+h94LolRjjvPfx6LZlAi3WTuwifVo\nSUganYlTR0HRSPSfEplcV+H98BXmlYeDMithw+6HrHcVWhJW32h9zn7pX0ki\nvyl0\r\n=z6SS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY8f78972S7YHuel7AH8TOyHP/dqeIZXeY5f+/kcqBxQIgYCAQOfAn9JjOUvq2dDj62cqitd+wVUwcI5ffY10MJbw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-run-command.20180726213119_1532641435389_0.0943890200671238"},"_hasShrinkwrap":false},"0.18.0-20180726225322":{"name":"@atomist/automation-client","version":"0.18.0-20180726225322","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"6562dc853566bf979b049f41c4bb2a5f55ea7ef6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.0-20180726225322","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-65+vm0Mg+4hqSMhWXw2K4GGaDOKKIumzCmHcPytxY+/MkSLZsS4OQtG1D1shDx1IpS6w2xQ431S9etqTgRFpUg==","shasum":"47e0a416a28d1432048c0b5d68a9e35f4d8784f0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0-20180726225322.tgz","fileCount":813,"unpackedSize":3551885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWlH1CRA9TVsSAnZWagAAl4AP/iqiqXWSNZ7xkQKU+JTc\nA4B3ad0tYsGGzJ1ly7abVM22m748f67UjvaoIW6Ev1cjhBf4GSeGZJmHxJQM\nM00pBMJNZHh5pDXmTSpMW0kfjyBaMlSkj6O+jlrXz+vJC754de63muQhCqTt\nYvjt075ToVw5KCwvsuCZUitbfy+1r8Z/6zCFXAksNJLrKF6pp8qPMTVFcCZg\nAGrka3PU29+tW1cX69uHo7DRPUdnPuqQFxJMf84P67DDO31tL+6IJzkhUKYv\nVLkZlSw2KT3fSzRtlb2dL5s/YMJKmrO8Bx6HZjL4qE7pyS7wf9IGE3IozhMh\nxzY++3wAX0yEncKIk60nMLwZzwmCjFve93dNYmOhn7rRLCwY/os0p7qMJeOp\n2wCiuGnAeoxgb7S4ZGj1rzloJnDmesjH5XUpJudUn7gDzpc/2zOAr1RK5cuC\nN0k1gCgFI+zGDC3QJSw05fR6JesDeF2uGAZH4zG8zvAVFZqd2mBjSY5zovqe\nhdPxrEwbBo2EkwPIAmvIGoDAzDsjTTsopXr5CvuGbgupAxXDx6fK7JGbI2OR\n6/MqFO2Ujvz9p9NZFWjaLDVwxOY2gTuPH9I6HCv5DdB7UF1JOeNPMjdRkpVz\nTN0dVw/cFMWwnVWUzba3I9P2+ZpyCgaf8D30DIPUhHaVHAorO1w7RO27XShD\nJN3k\r\n=7bVu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOdtps2+L7Bg2JDpwKpyGZ2j+VsWWBQkd6+fRC7i+ERAiEAtGsJazgmLqyBOdVjqk7iYjyy/KcEHWKXCfIRZFMGqVM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0-20180726225322_1532645876820_0.7363704789447503"},"_hasShrinkwrap":false},"0.18.0":{"name":"@atomist/automation-client","version":"0.18.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"6562dc853566bf979b049f41c4bb2a5f55ea7ef6","_id":"@atomist/automation-client@0.18.0","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bYpQOybMtUV8S76yv32XZDBXs6VyDGFyTWYzyhQpfMGc6CsTWJPCcY+NivM0rRXpumL1zjlWhQGBtTxGiUH3nA==","shasum":"8eaac8b1ee46d5c2c4b9d297bbbbd460a9ca6b7b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.0.tgz","fileCount":813,"unpackedSize":3551870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWlxPCRA9TVsSAnZWagAAUEYP+wcBRqyQy44GFHD0+Nn5\n2p74DvUveI8AnfmS04kYSuieWl9F5fjfc1sTMO2eoPYEuCZ26fh1Wakkdm75\nPRDAUPossAdqDeRUQUfCBDUX5097WvdKBS31/I5dVRz05Ske84OZORLmW7vg\nOZM9oYngZATuQxlxJbZ2A4h4HpnNbYR27Sz5V7CECw9OIJ5CxHiS6uGAOagL\nlLYPkshNt5WMJAaV7Gy3jtY1er4/KS1UVpSSnzGHCLRj5mQCELAecovWH8/F\npkTKMjecsDpLHKMO3l0fuhexbSsXs3t2zrAsVSEXREQPeyIWHsIQNXTkQMLN\nnWzwVOfI/K8yqo3Syq2Dse8BnSlDyXpP4YO04SsvBtOiCe5R9sOqNZ6mXQYP\n5Pux2m3uHfTY/2mDRwDCQcj4lUl+848nFdb0L9cK1kT7TyyYl9pTOiet2Ns8\nDOQ1yWyZF2JI964+ocztIlKqs/0IwUiqAaikCUXBZuiAzFwDjDGnNNNfy+Ad\nO2dGU+dN1G30rrhbasnigm/PgCyJ9188oay+JCkSJcHHu4lN0Q2JrDkB9wCR\nLEQmGyDiOLaRPDTNfNBdV7+2KpvfFJt2tCjpJF9WD2D6STODVdT0Pnfuebp1\ngWhanG37V3BT981qqrMtJvL2SuRGgzy5gKGRyP7y9dmYUU+NLW0Ktvs/Nlv/\nxa/e\r\n=owfK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsDtUxsX+8V7NVcE3lAUCHHsAuLaEt8Ta0FWYzgq7uyAiEAnOQ26IlgkZ0lMfqOHyDYIU5196/EJwha3EkDwB9UNSU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.0_1532648527167_0.5324669016655161"},"_hasShrinkwrap":false},"0.18.1-20180726234320":{"name":"@atomist/automation-client","version":"0.18.1-20180726234320","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"ba687d571ba2d9a1a72f385e40638759cd876225","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-20180726234320","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+BUA/it5kYWjiPNrr7rN8FJU1ozoqA4tNXkVDniN5Tnp0mhiL9Xfet7Ks882JzBayB5Ry6OgeKUyFLyUjHCZ/w==","shasum":"f222db2e2956cc556a5d1d831d348579d2dff802","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-20180726234320.tgz","fileCount":813,"unpackedSize":3552093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWl2oCRA9TVsSAnZWagAALHEP/15PvOqDWgg/up7Bz2gr\nLShhO3g4ocwbRekfxKgklnWvSf5sBEe0Nx6E31qBX5kikfcLspaS9YP2vp5t\ndUAKUGbhe1wsxYC70P7IXzlmND1vT9DIHSwbJ4PqIPOb+kA8FP2Mxrg8w060\nZtq3addzPBsIvWCeuQSDGsYo+yrqUNY55UX7vyF0ZWOmIZc+PtK2WJdBA/KP\nl4shptuFGDn2Zvhg0MMsHdYroXp/YdBpxEC2bldAZMY8Tco+vGV6c/htPq7h\nmHRl8Nf2zgZdgHcnDZTxFUE9qTygUJkqxs43o82/cLYuHhQG8wtoopkyi4bR\nxs/uLFD0dX1nijOSbl19Kce/7uhFPMiCSFOMDZ9NHjiLzUHLQsZai5jJ7KSG\nfiGCqEFFPb1POuxuyWTUXaDy7nPFj6HmxfGXUb2NT9MUo3VEZfo1GHP7mXaX\nVgNaBAMM022CYU46EHjmnxXUmpwf1FCyjb/gP09mrX7jy3UF4QoViWP/OFjB\n2C4DZm6QSEoKcdQsmKBL36kIDR4Y4sY3yBTrrHf2DNOop7pSWD7FwkuBiZhd\nbO1kJ4NCuIC2DOkxHwBCS0DDbaQuBQi4/hDhTLjJ8PApUHdEyJAOka3cuqWC\nZtesuhPLU1dulFdNEwWqrUVqiRSc0LKyG1B2DD0yhL7cMJ9eVt41mpX0iQpt\nyEDc\r\n=Kv6t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5RRzqAy9Dw+cG0vr/8soMaQ9DXJeNi6bs+3j++DnN1AiBIEemGG/dzIV25Q24+6EhBNe3Ae1f9YfapFhHiYoteFg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-20180726234320_1532648872578_0.40428571928658474"},"_hasShrinkwrap":false},"0.18.1-nortissej.elide-axios-response.20180728190946":{"name":"@atomist/automation-client","version":"0.18.1-nortissej.elide-axios-response.20180728190946","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"24fb6e70bf1600d76e0b032f775d1cd385e7998b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-nortissej.elide-axios-response.20180728190946","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PBbKbmBqEMifFRV9xrt3HJKbJmSsslllReBTjporu0r4tFv3BVn3zBHxNGqrs3j9/427VdB6I7IQtbtpr4jXTw==","shasum":"0a20ad3cacec91103f4e7d1c6fe9b6eb7942ce6c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-nortissej.elide-axios-response.20180728190946.tgz","fileCount":813,"unpackedSize":3552897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXMByCRA9TVsSAnZWagAATNoQAJMNbbFQy/itAntEXQeY\no75pBVkwTzqws9eMB4Usb5qkUx3HwLK3YyCneS+/1N/wPkCiqIbL5Zu+a69/\nfeXfbLtxUbLI9ymdRuWSKSWq0WwpdhUdoevroRVYtHzyOcXTmB1KBIhrn7ov\noLCb1RQB8FzgK+AFFiMP3CvGUVgrzi0gVFe+Rj17vyddKNFv0Uc61KNoY4g0\nEu/H3b4hNj/rx47d99ypXYHPpv07QBe7oFrXvQXs+Ny+N6MErGu+C6l9iMDs\ne//JVxDcaAbYR4GH6Bkc4rLvklf5sshE6AZiN39fbboe2dYPYhoyzS2UheuT\nLY+GDWX7apJGExJVcNxWTG7woSrIsHkXwYJLqvenXWV8r2MfxhFo2uHfaKad\n1oRaEJDL3MNpUFXGufWz/c4GNa/GUHXFjc7htRi6q7XDFXaTwofwNLEvtGxH\nvfxaxXjbc3fevR5DcFanGckotSDrbiLiViwe1eIisYbwsRroj9AvRHmOPCnC\n7/f/b0Tyrp/NnYuQVUu7crLcXJR3Zx3HVUjxM2Y0OjWCz0F0dA8AEr6+WfaF\nRrCY3qpOVKV8nlcaKYzOhaU906BBQjc/e36wrMAj1pz1XTSZEF9q62Jc0WMN\nbftXWLPWDEKccr6rIx0kI+hGErOi74vdTxKEPABZBwoPzroR4g7UCA2cTtQ8\n+PIU\r\n=bpO6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZYrGD3r8aNoSEOoDTKbnncjEsFCKEaykIfz2dd6Yt8AiEA8Ce2zDNM3K+tgnXjuAkDObO5IjLkw1GD5r3xsvpQ1bA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-nortissej.elide-axios-response.20180728190946_1532805234010_0.1477389951193424"},"_hasShrinkwrap":false},"0.18.1-nortissej.elide-axios-response.20180728191922":{"name":"@atomist/automation-client","version":"0.18.1-nortissej.elide-axios-response.20180728191922","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"f927a05c24edf14dd0da3bc9ded3db0d8453a6e9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-nortissej.elide-axios-response.20180728191922","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gslZ2M4HHGoiOxdg0Bgx2M4FqswUI/R1j4fuQq6Fr3J6xvhramep1LY9/8oQNlMtoVp0+suDEFjbTS8BLdjuEA==","shasum":"e145a8fb852682d451ab513a541fe4526f66b741","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-nortissej.elide-axios-response.20180728191922.tgz","fileCount":813,"unpackedSize":3552873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXMLECRA9TVsSAnZWagAAJhUP/3e4LP5hTNYkDaAUhGsJ\nJimngYXI2R7aE8OkHvIGuL33XoOYZ2EOpceYKgjZne7+2Gyl/X0cn74vmZ6F\n+DQaIaXsuA0VTUIB6gAcWIq4Qcdke7YkofNUDT3y1cfkU6E/BwRGwqAwvCER\n4/6qL5ZLUfJGFIOTLSaMrNQV/EtwiQZPe8QUZ3Mq4nsONQXQXw5CdFzB7ZFY\ntHpLWDzfIkqAWBlnhMElLbR7zYfk1zpoXh042x03fBjJI/TubFbnf+QvXRLi\n129+UEijT01Oc3RCKqGxzbTJf1EBV0Kv3mWecA0Piw/jgDWVHkui2CKawXJy\nGTdl3ykwMyRyUTGx9Oqzf4+bl7lQtTq1mNDgzXZYpeaD3tIgj2IINoW37KqV\nxVVJSbUI+lgJ53QfINuwztAqUwuf1IzIBAvwTDRQcDIr3n/vLvLYg/0+XwZC\nuYKfyxIHC0oXtF/Nv4nes+8A7CrO/Qa+4AKnhKxhQbs/lDxJCCmAmppScxD3\nBuovi4FlRnoJ99jS060Fszsmm5uLLPNHUvTA9hnZcbMuqFZCaFZZwnW3ZqtV\nFjrkgeNdCzZ13kwJaQdPsvG+ts6/IpXE9bO9gpdHs32YsrbbLkfbCy5IKAN5\nKXq67Agub7ueFRpLgjWsyfMQmhdmmjLrOtPVNBAMIMA3N2mPZKMf36uDpRZa\nCp35\r\n=kmHJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICt6RgvCW41o1MuyoTv+keWjzxBtb2AKv+vU8Wv7hUn8AiEAqE++7RQUe97pQjLmSy9RnypULTdACenROk3kC8qhl+Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-nortissej.elide-axios-response.20180728191922_1532805828148_0.08254370027274938"},"_hasShrinkwrap":false},"0.18.1-20180728225753":{"name":"@atomist/automation-client","version":"0.18.1-20180728225753","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"5be9f1d0ff6f5a513ec939d5611f1f1dbfa3a4bf","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-20180728225753","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xbI3QFI+1Jjg4aZ7jVxucBzReyR16zlADmMDcZNFz5O/Ues3niryAiIDTyNjm0Wjz4AQ2kodo47gxLFrOvLE5g==","shasum":"fad14caf6103353781b3f03df63a5cf5cc4b82a7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-20180728225753.tgz","fileCount":813,"unpackedSize":3552842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXPX7CRA9TVsSAnZWagAADmUP/iwicf1H6ugNL4C7P2uh\nRneTmDA6rt6vehy8OoYoT11XcPdq26QKjc0d8V2XAhoLamvlciILH/+3uAUC\nb2wuJiC5qVIvhjgAhm58iSln2seBCd2+pytZMSErP8kYCYeeTsWdLHHn1WkY\nPYiY4m1e6yFuRUBrve5WWkDMpyzj7J7tO+2b7HcIHkt3IKwJtGyYf6Fv6EyN\nDjUeKP4PYMUL6ciVR4DoZB8voIFlT5xXIjiDc2w9wOsBzeKFmBApvD2ZtwfN\nG8KU8vG1KdCYFGVJWx/jfAInnMOq+njs1f5pDgvYfVIXCHs8+r5w/1IM7uJT\ncSBasI4h4RB/7rYqWA4G1IZrSYUlj6Q9auaVVcKEQI5f4M7pKVnDrKzQNCqu\nGfIX1wq/8iVQXYzyEXxFNOsyaXp23/urJmAsMsXUg7V+1AxOSzRtZx/Zk5hi\njyg8BcO5sTQBGoNsbKmU39X7YZZGlMFJyQu+4PcbJ3taERKpwhe59p3d90BT\n1DGyvWqrtWp4GH3gzYoHNI2ntkWlNP8l54ip+wJh7qThNHO3UwRvsH17BW+v\ngEO61UmrJ7IKFSLlQ8XAR46PuJgqhKo+5MpQgTYJ+3WsiSy/A/JujbYZIsSW\nTGenAmTwxIXy9InOER0KJR8lOYSNgwIWTYCOgyPqiM7o7m7zS4ep3ILr3Prr\njFa1\r\n=bAyy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBzim+oHp13ScSEkUHqfSwByrQEzKlW8z16T2qO/aELZAiEA6l1Xw1CUFmW5Vjt8S/utTqAkB1JCOa91Y2K1TQDIeUk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-20180728225753_1532818939784_0.1638065611257966"},"_hasShrinkwrap":false},"0.18.1-nortissej.defend-against-circles.20180728235637":{"name":"@atomist/automation-client","version":"0.18.1-nortissej.defend-against-circles.20180728235637","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"fd57f09d1c5cb881bdf18593eb6d152c3051f462","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-nortissej.defend-against-circles.20180728235637","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gwiyubZAt0OTh/M+VxBVYWEf3rVBTtSnFdsLIgbU2gFBEu8uSBh+RTcN2vYoHjZ3ht/0QFPIEMDnGYHLnT3lwg==","shasum":"a4842bc42f8aefb73ee81c950dea95a1ce5fcb33","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-nortissej.defend-against-circles.20180728235637.tgz","fileCount":813,"unpackedSize":3553568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXQOpCRA9TVsSAnZWagAAk7EP/iZZpG4Fk7LlW/tMtvDY\n5+wJFVrKUSW0vsNv2ZQ+yGEVqKc/2GxPp8X0h2lkroTqXCwyQc+vAgLzMtem\nakgfIGBZDvaPGzMQeaH6KqNAqmY9NacXQQIhNgKKnF6iEq5hDn3eI8v/P7p6\nkWrd5/e6HwJmPaKJdqciMiWphbsT5MgdEql3FypQUVW7l/zTAIVqF7aru1Oy\nPRlwaQFXGHlrB9kXT9JyvqvaH+To/yy+KwIWqKK8SNmTupC+s8Q4wP8ehVwZ\nmLVr0laMWMoeJL0Y27xZAUP1rwKkVDLdkAXgsaTnaTkf5TaAhi3Gt73HH5tf\n5ktEgYFl+DAmCS364pvxZv7pNBf71HDrjJZVkxLK0RQQjZDUA3cbTjQY6QK7\n+z1nKAPGnYZWft7FMmqZ/HsrOTThdtcr6rGMRYZqe5TIguw3PGlWUJ0Bp/If\nsBguMNd2Bu91JSGBLgg3H2iny2IySRdc/JzA1iebl0zHCCKauRSQU9J06f33\nu/tNaDWoBJX/aEy/tmVoHrH+2eBOZxuramRqxlXG9AJVUAzTmVQU7Z9pHMv3\nF1doDWf5KhJb2HQ7sjciSCfucluTjB0stnti/QLP8CG2uZ4yauUG4Y1Jhng8\nnCKclMgGKfPWP0Z0vwVZfrLcouPbYa6iItluyQTHELPJnKFKbp7TGOzutEey\nU8br\r\n=AzDl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlqUmmHJwOBw+JBSXEL8yUKmzoSBjKfjGonLCRL7pdLAiBRiZz8sFKq5JxQSd06QwfjtfJnAMj6+g94VeXhoNg9Fw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-nortissej.defend-against-circles.20180728235637_1532822441129_0.9124108272217502"},"_hasShrinkwrap":false},"0.18.1-nortissej.defend-against-circles.20180729003756":{"name":"@atomist/automation-client","version":"0.18.1-nortissej.defend-against-circles.20180729003756","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"60bacdb1497180426e457b397288a441c40a34a3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-nortissej.defend-against-circles.20180729003756","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6C0fkrpTRVsa6wUZZvQIPLfWmfUPgyI9KZuZfxuUVFX9CiNmWM1eRr6z0ONhuLGBaweF7QBf1s0jeTZzsHMhGg==","shasum":"19064a204d295df31000b3ea3b2ef8247e6efadb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-nortissej.defend-against-circles.20180729003756.tgz","fileCount":813,"unpackedSize":3553751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXQ1YCRA9TVsSAnZWagAA74EP/0EXLA+MBM/iMsrE43nK\nheVXR1e9TwFvSK2NbTlg1QHomw6KBlhCYf8XLCckSH4u7iXCFuGPphb7Lp0j\nuYJasnr0KSIuMJ41yeDy+7y5XgLwt6Il40Xz70dPLdPEDNBCWIX6yuo48YD+\niLAS51mh8ZelpOFRgOiCXIuO65xAjrkYNMIK68GmNmatcQsv20iOYL3Od35k\nUaX3nBPppVWZ5BZZT05PWNGjl8JM5Q7zTZCsDQQPkfopPaRWy04gH89qiTmZ\nvXBZFsGoqmuYMGN1LfiVri1hZVHpdbubv2ihG7GnFf+h+grfCuL/lE9bKZvr\npI0eQlfmkRKcJq2nmJSxWcU33IcoHJNsZJC6rLiPzYQ420mXeKIuJPcVFXJu\n80vYy2MdtULmVTRxKQojZqPmO4iUjjWarQ1SyexAt8xz3bazINRMwzn3TDoG\ns7qCurvw6afXvmO9acm/AvPVAQk0wLmt3DIxUkTcwHemZ0w+OQNWwihTfkxW\nLLlZ00KTbQgrzExKYRh+qPnmNrbhalPOW2OZ1V7zzoFKIBFNTQ8T1MqJZayG\n2zbyIKMBzan8mNjoQS+C0HwkPc4Ra59Jj+YJGivhGoVB3TAUiBrKG020PZGv\nB6y5EB1/kVDnmIYBGRSzXoqCBKw8faQKMCazUZK7rltVYrcx3NACUz02Kvrx\nePq7\r\n=ytqs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE4XnHAUrZJmKKtONrsQefjcTOyYMu+XYESCss1ohhGTAiAFTBQ2Gu5RHpA4nro6qORYBKXf5WY0t0RpX/8/YzSsfA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-nortissej.defend-against-circles.20180729003756_1532824920344_0.0399984971118188"},"_hasShrinkwrap":false},"0.18.1-20180730230821":{"name":"@atomist/automation-client","version":"0.18.1-20180730230821","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9607c662c17af77e3cc27f8e8750c360ac185aed","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-20180730230821","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9yJnHutoWlV6Xy6zBkLYMWqiHtZCx+uJ1o4Nt85fYpwSJFr0U1TggrQ5H3UFZYmVTuqnvs1I7W0OXd91V3DwDQ==","shasum":"32bf861ba6d87602bf6dab1efe22cabe4f8139ce","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-20180730230821.tgz","fileCount":813,"unpackedSize":3553007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX5uDCRA9TVsSAnZWagAAnYkQAIbncYwg4VuAEEfop1q2\nnUSdgu4f0HB+d5WyWFsd53CEFcdLwL94C+BsTaacMK9y8EwzXuOfLUvrGB7d\nYRdEMa5PEHqf0NRSBUiNnysVyOJTnr3XqfzlenQin2BiD73Fwhn/MT4W5HwL\n4zrn772r/5za+iUm7eC8age39C5+q1FyZPQbSEzuY9v3c2TIqG79/gFP45bR\nDfhrzjTsbtc7sNdlUtj81mJ7C6XA1tN8FZLsHqPqKFrVSxQKxzhRjraCYsP4\nVlRrnHXf0VlLVxrJtBJ0N9blWRWaH3fpG6MYMJHYQ8phyXeAm0tqvANK7DOK\nRgUeplPT7xtHpyrnVDmQAVkjV532PHNGKysW5hEoosR69wbam+pV5nFKeDnT\nYsP+WNvs4SKEcETAgTN7K7yMkpCCRczg1BfH8sjY5OJNgd66NsoSX76FZYps\nmfPFivI5rcvURy/xFqO5tfC56uRByofJz/MQaUvugGHS+2W2HrLSZ0TYNPyP\ncxQV26G0qZWwTrdcRe2PQzjKuaHr1T4wQOZWeFrN82cLS9HKBk0dS1tfoAlS\nhEE7fTn99XAAAwUXCuQJwByZUsg0Kzl69qHUmEvWsfojUpDY2O4oIWc9c+eF\nYaZ46T/JnisRWG1cwuacWo9P4Wl/PqSzpcg1+ab/WhLEm8BzJbKcj4tButMC\nHnX8\r\n=cLmZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFF5+jqDzUKG+VpOXG+P6yD9Wlwc4bo51pc+5I4vrB04AiBEDPB+MyBFIN2Ubz0YsKXmHs4G03fbCaO1Y2x/kiwUQg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-20180730230821_1532992387771_0.29605152195733364"},"_hasShrinkwrap":false},"0.18.1-api-keys.20180730230936":{"name":"@atomist/automation-client","version":"0.18.1-api-keys.20180730230936","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"1bac75eebb37d7f41632c1d6291b9d9aaa69630e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.1-api-keys.20180730230936","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tm44BlywDR+G9pknGGfAy7hrEtoRHb4TkszTeE9craVlYWRJGF+8ygqAINnDf7596xe337IqAHPfCLOOj0EXjA==","shasum":"0d4462609df6d8bc1d7e9523801e67e501fb98de","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1-api-keys.20180730230936.tgz","fileCount":813,"unpackedSize":3554380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX5vQCRA9TVsSAnZWagAAODIQAIyYJ+r9v5M63Xm0z9HB\nYtmZfAPsP20cp5fw30LlxoWXz4gK4w93g/uq8HtQk1Q/yeYqGZnrUiEcm015\nifubbYVVEYNnfbbOAkAYmrAcapGB+MouHfN+2kATgFYlVFi2C139CGgU3YxW\nXIynHRtffDfxB4PukJ13Pp2Csumay2+yCZUqFPlV0tOAcwSR2UK3FxTPlcsH\n1FZrovUGrW1lrf28Yi+cEIE7Y1LGcyY50egQ5H6rLACJwqsOiNFsbOfaVvWY\nbTnhQB3sGdkSQ6uApKR//y6krhBC1so94911OOlWnbzjgV8L7k1fbDjwgFNL\nf3cN5RYtZEoxjQZRf6gSKmpmQcDkDHbD4JcJYgWNkUoJ9sKcWCiZn/R3RQqa\nQezLsHILIx/9T0Rz0yO09JbYQRnsCqSPPIH3dDswVqvMemfIT41RzNtKS3Q6\n9cApI6KMUjN1sjdjTwX5sL2qj/DbbYsACUF8Q+aRNz8DfoYfYWe8BOnozAcY\nS/Awy87zHYfWaQ2zG/xK9R8ZSo7BbAIqYXho1rUyXl+ea6X4+MxbcEjYbWcT\nYfUueupcj5LxMmPiLm/007epdjKipzj+mzFvs2XO+Qs2z95NRhhv3zSyjMrl\nDx5mis50H5k1rdNLk1627tDuGGN5ETfc1opdYMHjEmLwXqLq17O+yrmwUNSf\nW7bf\r\n=7r9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtGUDshFXsCK56SO59/b8TpFGVBOoLv2MhVF5tmccuQgIgTjUdsTt+j63F+t5Hu6s7fpoW7SNtgm2SJTJgQl0zyGc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1-api-keys.20180730230936_1532992463924_0.9162106200373512"},"_hasShrinkwrap":false},"0.18.1":{"name":"@atomist/automation-client","version":"0.18.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9607c662c17af77e3cc27f8e8750c360ac185aed","_id":"@atomist/automation-client@0.18.1","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7NEATlJ8jNeTVnAxV5Kjh8DE5OFdcRAb215osPCxI4NbHsq8+1n5eKuqMPEH/8zJqTw7H424sm3gKPNMd/T/DA==","shasum":"89d272da7739bb58c23843e57d0dfd05401bc805","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.1.tgz","fileCount":813,"unpackedSize":3552992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYBChCRA9TVsSAnZWagAAI88P/2HRQl+zVEpktpaRFdzD\noOYIUXkIi+eqgXHIkdZr7hxFccKeid0tVHj1CwbPTVzvyenTFCTWhZYX2b3C\nhUz69ehpFRDWuJqC3du4A3o8ermL530z+TYKjailVBRoAR7cIIOlUWDbIbYU\n2H1cmuU6wPSQniGVsIqcVtz+6Gr62tVbZ8Rn+440A8BitJrhi2mz/hQ3LXFH\nsy8XIQNrTinDMARAmOiycUbjQIQ78sVzj9K1E6QBL9I7SaGQlAHvgaVkjg79\nQrf4tDnkAcU0yn6Y0GI2k1NAaQaWr082Ayna7+fB9PCIyYUYR2Ck8izdR3Sg\nV4bZQGYyI70eg8Ph3z43/usRCKuLSgYZdaNAXCRZ2F/n7Un0saSXAsRvd3OP\nznaStRLr77PiBwTRY5FlVLsdlYveXkrjBGa4JaCK10S7D9oWDaLRM1/4la4j\nYh6f3uP4IsgpjCkRuV7xrI6VCIsyWd61/RzwvxaUcc0ueE8XKqdAmpXUYpVy\nL4jl0djRiqgIAB8n9YNy8vGj5e6cb2VWnszMZKVK6lDunQpOvOZLUZ0ruyr3\n2fW8lGsm4319tl8OB6aXZ1W/Pe+pW8yGRbuTKuyFO+zN0CErvjYFqx2XssDO\nG5EnfMfNMBQj9UlKDnwusUd7elUxwdqLGE/j8e83JrnNAWMxrxkqjtH9hXne\nGd7u\r\n=kZ8o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAwawYhId5OM5RIjb9ZX3BtUTReZ7S8//VH1nTebhr61AiEArBXqZaXPF4fCqRSSjIHgNVAptPPFWLGx0isCSgGU2aE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.1_1533022368982_0.37018722642705026"},"_hasShrinkwrap":false},"0.18.2-20180731073354":{"name":"@atomist/automation-client","version":"0.18.2-20180731073354","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"9da3aef1822c405fea1a63b02e219cfbca98aacf","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.2-20180731073354","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-g8q6OIHUv7yKy1rXDeY5S3xQmwXOcG6oqcGM/75gwrmmV1iRd03pG2HOXW0BYVlesonh8/hD6WuURZzBKeyV+g==","shasum":"9752029ac8f458e08581fadce454d0bc4f9fb1b5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.2-20180731073354.tgz","fileCount":813,"unpackedSize":3553106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYBIBCRA9TVsSAnZWagAAWZcP/RnHRVz0hfiiLCjyWS7Q\n6krlGi5T+Hz00RcMFo32EIE/ZkvQXeMFur8eCumyoBeNacMQ6m8K5vf1XXQw\nO0vIqcJ0WM93qZk8XgsrcsXP5QfGO7ZNaof3ksguY/36hU5nMpkLbSkExzRv\n7H7hD/a8ZeRGOL1TBnyc89Nx0BMFcmbeh57ShXeEMMsBYFlut/brUhXBNMaZ\n92VZTpC63zkvcks0Ns/VMojLklerYslACq7TTut4o97c8FlR+T0GlXYrGUdx\n8XRYB9y9Kdm7AxuIzfRpgWsb7HBKqVzIj1023IwjKMYv0IwooNkIjl6nBpgC\nlZUpmN7kq7gulQF+Md6TwxBeXpJUaZATpUERn13B0IfOtglef1Y+mz+0dX6t\nQToKJbp+/3UPgeGChyCtzQNuIiQfyYnxHm33R6F1uidVo5P4dVRdx4Q3e1+9\n5W+/0dnRxHElj+t/K7G4bIDaHplOYUROODlsxXOUr7K+d1QFm3r4p4R2FAS1\n4+KUEn8KgFZLeDOZz2CIm7UHc24UxbWUZTKINGhA8B1XI0SD67wlmWD3QBfr\n7j/FLg3w6MJYwv7EdumTtg97fQlXQAZPdWDrcISvxzhbPTLr15swObAYa3KV\ntJ0QOHXI7g48xG91ELS9+3YkKssPpiwKEx3LaZ3at+G7Uj6OQyDx2G8Vc9is\nV35r\r\n=MnhL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/sfaNAI7MDHUmdidsQJLZRY5UeogCPf9rqvLRexmpYAiBiLfiSmBspjQs/D5BxhTZdSMdojxUmZt7PEoHbU8wOQg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.2-20180731073354_1533022721051_0.9991450745893768"},"_hasShrinkwrap":false},"0.19.0-api-keys.20180731080018":{"name":"@atomist/automation-client","version":"0.19.0-api-keys.20180731080018","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@atomist/cli":"^0.1.0","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"atomist git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"58e50e7c2206a449ea26e344c65691b964ef60cb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.0-api-keys.20180731080018","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/4Qkj9y2hqRB73iDY9EVLKecZSrqA/9luS3xwYDMDO9ftaxft6bkVVwE+vGEIQUvBAI4f+xlqm3ayCe/NKc1gQ==","shasum":"3cc6c7f812f91cfbaea663b93156e9f204af0c8a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0-api-keys.20180731080018.tgz","fileCount":785,"unpackedSize":3480815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYBgsCRA9TVsSAnZWagAA9a4P/ihgfFAxz1DSm49AYrp8\nsclZ2FUqyYbMfe9xZTWqDFA+PIN7bF56sGhbDhl3ARXBLZT49gOmQA+xz2xE\nRbT4t0y220EgPr8VGtkmuVuFKNc+EyasroPSp6KOuhQcZ6M6PaPvB/Ggsb6/\nUW2+R/lpOEHHukKQiq+9PHc6W7oHiTSJ3DO4ha6mV9pG4VTHgZltirj9M6nD\ni8xgMfnUycJ5WMHV7jWk0sw82KRy0T4x1YjPz1NLfyUA7dMrev0NcdY8uy9K\njxJZsHE9Cb/sFpIuRJ8NByF9Je2uZuHI++wGe+5TJARP/ODDZNZcOIc4cspI\nQnDRmyPL/BfRjzrBulfhVlMAnvuh96vZkM39lyClicMl3Y99s7w8hXyII+ou\nR9RWMz3BiBQNC6jOYsDrVpAzUak5QgTFoxG8WKWm63ny7Ks3GGiJktzG27eh\nRjDwOVZkuE4yW7kw3PPelBtsUUX9U6MszWSFdILUHEXgGY0EaI8n3jIl9oz0\nN2lYNZ5kbTP9wM7e8eoRGPiIjvSGKpoMh804FH5aQgv+iI+B95FPC43o5KEI\nSAfzWELdPVeKmxcWbSPjQLqqbo2zHAUBBb4WYYo6EDG/jmmcP3H9kfEbN0uK\n87qys66NqBxJM/vasMspeiKiKiMUZ989lZ0qtWYvKUpgNB/yvUbYiyo+RFM0\n5Tpw\r\n=Kl+O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOFGUZZzNyABMVH45xtOpVwOeI0s4nLMx0yg+LoePwbwIgdfNqd9lYMzd0EVbQ/h8jEmj0HsrG1AUbicxSCsWlJGw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0-api-keys.20180731080018_1533024300502_0.3384889729117251"},"_hasShrinkwrap":false},"0.19.0-api-keys.20180731081614":{"name":"@atomist/automation-client","version":"0.19.0-api-keys.20180731081614","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"2ec3917244d7f33564c5aaf64e0001c670fd7a5f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.0-api-keys.20180731081614","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KkM7wWBBlgKFAXONJogOwHP+1mzlv1txNVh2CvAu9lo/59QJPHwlmL23SypOeCpEfVOUgBpRvu4dmFrj/aS6vg==","shasum":"ad4a2d5d904624a626c07c6f252899c8ee6cd4e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0-api-keys.20180731081614.tgz","fileCount":784,"unpackedSize":3480566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYBv2CRA9TVsSAnZWagAAHWsQAJuNJd4p3kw6Bl13qmZN\n0tx1DLHo48n2O6HkSvvTPYejuwIV2DwSU0AqF1iARxESP22ksVJSRFM3ESTu\n8Pb3Hn/HX8IIwkUOmU+jrQkkTcqvIWYR53TbSd4xLbxi9jD6HD3w134zQ8nh\nIOxznOvoL5GGZSIQoQ1nS2OGWLLxcBFFDS23taY/9iWGxK5daT3+uWtBnDls\nE+AvBXNDIJQiaBRtjoXEvPWhzqzhMMtiSo4AhkhYRMrJrSsToFOUA0bqINgE\n/7jcuJACg7wObkrBAa2BP3IziY9Qz6WUJco6YQfT5G11VzCaDpPY/l4/j8Ca\nqldGtzryGula6kF6UfIhR3R0UPWvqUMbs/4at0Q3vm1YuWXThWSV1GyA71mS\n4o+g3pupizwR9kP9uJYWPZXwSvbCI4yyYtTnA2d/Hb3JQQU8pW9Ij14wgw5C\neZ15zQLDpFoRGvG4OSxnMYqZ5QxFkUeCmmH+RinJ136C91yDh2SSxZh7Hm0G\ny721UEMF98Ou5sbLO8u+NJeu4gE7aU67hP0kQs00p5EVRlW3hELpiRgYOPS2\nKrbXwYG8A+ajLatcgA/MtDk+72kvtIJsDU8GtoaJa4GrdWd7Vkxt+x198giU\nD8Qq0SwijjCOh3j9ndExbiZydYewbpkqlYu+Z1xKG9afxLHiLPBbdzXDxyOb\n52/q\r\n=lKY7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsmK7SuUuxlX7ZBp5UYXIurPdr8xLUiOqBq0ktgqASsAIgMzHOkt7Ud25eSR6WaPCanmkP6h2Vxp5cKVAhpD1aIPs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0-api-keys.20180731081614_1533025270312_0.9514606659517122"},"_hasShrinkwrap":false},"0.19.0-api-keys.20180731165353":{"name":"@atomist/automation-client","version":"0.19.0-api-keys.20180731165353","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"ef4dac00a30cf4b4c28c90d80b866e0b79ac4554","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.0-api-keys.20180731165353","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qEzgOSEWCJyBb8Q1WR8hhhzfwwz+D7hAQF2VOwquS+oz+GFnCmhlgWSmwhH/cugG8UUI5L/M57xb33sE9c5AmA==","shasum":"49bc6486fc4cd9d354259cef150f24ad21ce2d90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0-api-keys.20180731165353.tgz","fileCount":784,"unpackedSize":3480422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYJU1CRA9TVsSAnZWagAAWUgP/0pDjXngBC+Ipfy126Rl\nUPhBjJH/nueriw8LUcHZ1x/2l7WiQTHJTwj2+pIRn7gs/qRtK1JDShEoxudI\nox6i+nqmVN2zKWfXsX6Dtrqh70/rzZWL7L1HnZrTcr2jBaS+2495VVz4K/P1\nsi84dvC+v2EuZAUdaLBZhgM1vZAtjA83tkQSZ+HZlsvuijFyQjA3c5y+H00J\nJqzZNph1CqTlxSf6xN94J5qg9wGmm6Ct/9dRchUC5jbC5w73jZZwlBFQCf1z\nHSMDABXGrfitxxKln3NSNSzHW/BDh1eonLSYPaTU+3MqY1Vz6K+ZEw3uOE0O\nJ6XQOltHYkODGzCLKNONFomKCCyiTD4Cme0daPYWhYbnNtmyWkkvayfbWY+7\nR3NvxaIypLUBdWwxmY4HIXkPlA6VQCu00LJ7pMpP0u4xbluSsF4GqmE/k4K9\n2s+1m3dxSeu9eJikUNYorNMaMECpIFjoQKBBOEtv73C/QWYBUPIR0Tx0Z2GD\nIQwjvWw0AN8R3sRVns/focOtALXNdEF6RmvFQdh8LF67ICUoJZMCPjdv9xou\nCxKWUwGWf25cJR7YXCOd4G8JcQ/bJU9Qu2yZKyypQOMjL7/f5rNK0rkLMIGu\n5XUY3DxHZhc/jhL8IVC8LhCNd+CygljM0n7KIcQTr5a0CqIB6TWxQoBmroEO\n8n++\r\n=GgsN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHAM7Gt70M/D1WtmEsbkpKPlrVyFOFlnlZE7cZqQJHHKAiBWvmRl+vCIemFM88cjrOd2mEqFEHkDS2x0obJ6ruXemA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0-api-keys.20180731165353_1533056308882_0.16102113366957904"},"_hasShrinkwrap":false},"0.18.2-20180731173624":{"name":"@atomist/automation-client","version":"0.18.2-20180731173624","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql git:info","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","git:info":"node build/src/start.cli.js git","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atomist":"./start.cli.js"},"engines":{"node":"9.x.x","npm":"5.x.x"},"gitHead":"e2704c9cfe6d59cd0ff1f900f045d9933f43c58b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.18.2-20180731173624","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VoGvgHvBKFOaKGdt6zoVuMziz6JCKxoP5JIvFKJB9OZ5hTuVpnpon14Lg+x2WevHrIYNelRILY3MeW3hljtg4w==","shasum":"03f11ac461fcceb2175d64a4edcf8baaf950db65","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.18.2-20180731173624.tgz","fileCount":813,"unpackedSize":3553473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYJ83CRA9TVsSAnZWagAAD7MP/iUGBtsf0NFckYIShZZY\n+deHgdh4XEFfkvoy7UxOvDiQ0kl+2SofM+0nSYc9Sj+kPZOLBE4xwx/wRmJm\nqwu3GjmQQfKrca+GnhV5sk3JNKIXnOPj9BJnwZGaF1KdRrF/MDhaF8cN3msx\nZLvGHN+drfPz+u+dKTRUC7NHucaa4LQlWAXzsqSisOfKWLzAHkj1v5eQRHS1\niAoIg3hFnNdrTcBZurA/mAkernRYwb8G94X0SUj2nxKUW9e9M6MXaUdUsD8d\nXc9eWIzZE3xVgEENP+xwCqdUQL7dqJz34duTXp2S0a31+KjzukrTCwCCXj8e\neXvyM8GwR5E3DxkWyajTNDohqYBCZHzkzTAxGLXkkAxfhWiaXdo4d5Pu07HH\nxCTciBWZsQm0O3Q8vupYKUu0GTWN/ReLb70FRlFzybJiJ2sgvRD5BsoOlSir\nWHTemezqvQVifAZJFhIQ78SkWaMJqDRZh/naRlMo2iygYWfYUsr/JGc4jJYc\n7DNxBXb14Ljl1ki3UtHyty8sgi3mWAokjMmm3JzTZE8/9yB079cWaXdP5qjm\nWI6bTtIgUYwHKRJxxhllqGf6/cl6KCLZX0axKb/1qoqXESYtNIJhcTn0KZun\nvnt9PebBb4uvTHDHCpA4ihKYHaueaN712eEvc/cz/kyPx8CBE34nd0EXa6nE\nAg9y\r\n=Av2b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwItKml9z4WqtcWjpn/l63d+oA/7k0iNQELZtvRRh9gAiAKM6dsgQ8EwimQF12qmGcr1c/bkKHZWJIWVHUt8QaJVA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.18.2-20180731173624_1533058871503_0.753260550024855"},"_hasShrinkwrap":false},"0.19.0-20180731181755":{"name":"@atomist/automation-client","version":"0.19.0-20180731181755","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all lint compile test test:api","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"typedoc --mode modules --excludeExternals --out build/typedoc src","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"5746cb3c70a134b3238a86b262f1c00b5d1bc0f5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.0-20180731181755","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9gicKblym+JPvk0pKFLMNgj/GDcUi2beJp14Al8N24GAweJTY/4g+jwSlPMLmMrCRdq8vxbrmeZiyN9DLpWiIQ==","shasum":"e9777ef4db74370285793752da8a4adc5756127d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0-20180731181755.tgz","fileCount":784,"unpackedSize":3480883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYKjmCRA9TVsSAnZWagAAK0cP/3kZNYYDteaZr4S/Qk+W\njUMcNgbGlFjKOTMoUjlVOn6HeLJYzZsFnFZeStatTxiabTWQVU6opqwXNcZH\nUq4nhbGD/v1c86CbiGtJRXFGV5LaCIBgM79N3VnbKlu4LiCMhmREScwB3Mte\n6O5XZd3u+AuNBkvGlN/W+JCF1H1rboJh81WiJI/MiOii4kIU8wGwoE4pI5Og\nRxFNXEZL4CxSfeVR/aS25F10YBETsw7DKvVYnHWKJqw+lGaHCYDAsVgLPktW\nGC1ntVbJau+yQr4pyK4hQeYpkMlW5zo4gg1WLxGKaWDE8v9KYEgOrT286MEK\n1ps2M4pLVMY0pNX/RWb638WvCsRaiMr/ddvIoao2wn5PrBqO3u2hLkSoEhQd\nhT+++a3591RDsmdc0ssS2apHEGAoDB7Pfz5Enz+Dnfam3L77L5zl3PJCAq2E\n+szU2Rlt6UyEqwFxGL/XA4TRQ+EqouMlf2/JRJpGKx60VFgoTohhq+JXKTRy\n/zBGHHTzyJjKPS03otkU7Hpl5CM29utFWEf9F++CO5haRvhMxhaERm5rCpNP\nTAkj6lJg6izm6jQlO+vVKIWZqYCradRsvi/2bBE9O8kB2d7mZC3451/o97bi\namG8kMXgjgXD/OCdEoOq/QHKdcz012ZmvxQJzbT9Pl9/g9L17ARtzbceIYzZ\nOKk0\r\n=8KkO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhmbcYF5TqfYjppPFlVxVOLn9jYWloaXkndk33UBZNDAiEAw1CxI34aOTaGdbKhQPCqjSQ4AkQMdZJT8BCzMquSlpA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0-20180731181755_1533061350117_0.11947728729750584"},"_hasShrinkwrap":false},"0.19.0-20180731193429":{"name":"@atomist/automation-client","version":"0.19.0-20180731193429","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"33d37ce20b57c73e29ff54259bb565f7c3bb33e0","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.0-20180731193429","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8tT2cjv4m+hwJhjBijGT1WAUf1x7CbKbS4RKrX8YEJZlzPAQlkIUeoXD31QAskx9ML9kU16QoBBWmAsm31Qqnw==","shasum":"4c19d1803fe2d99ff5715658f7396503c3c91a34","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0-20180731193429.tgz","fileCount":784,"unpackedSize":3482635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYLrkCRA9TVsSAnZWagAA78YP/3gU8zszbESx4Xya6r69\nzv8RdyJia8dxe/RHHgUyG9L0Up/n1Xbkx3OrorJD3QOjO6B0GyNckdPNDy70\nm0YVSr2xtV+SHFIqc/wTCygp/IdzYcenAymTM2LaVfmZv8l8LtYoogItVK2V\nPU8UQ4WCXpH6xcU7zXIzRJVIirVQdI51jDDC5Mg6os3bfhDYIOOpXSZKZi4g\ndUed3JcebycIIMYnbL/JcICfpnDnvMs3eEf1rxYEXF+D+F/RTjJ9ZjRfVGs1\ngFMC4WCPiwly4rg+19VmSBbO1EuESNBOjbTIpXD5wSK5kT0nEP88YdnX20mW\nIb4Trb8/W148CfbOCYIgtS8qwHuQpLt04YLwdiNPR4xVcnUdfDshFKUTQff7\nzkd/tIGeuQI4rJO7H7Pp4dG8BLlRtw5gXIlu0gbSzoMy8zv5CWbiFKOZ1uJR\nfPF2OK+0am119VFN111p67xePKlTxO3fu6pr+uSa8ZxIiHXc4xQUjthy06xg\nDvL0StuXIW5QCRcfyn4b3tIbN1pV8p+o5SPMy9vljK2vTG9hbYxz5fn4A+hx\n1cXjBuPvY0syGYAyzrlspLiIu/KbdxRo1SJNcqzXgQmocJ/Y5ilfezuAErcv\ncqM+Fir6fYS9MFkgQGHZWiY1a+Sy3Ofl+UnQ3k/ayqhnxgooBir0+z4FxmsH\nidwA\r\n=VZNC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxfjVrpXTiOv+z4Ny3Ty19qBlMOhhZg/QZOfRfpKQThAiEAulCHx9PLDmjJfjxnfy3SBUjdaAUHlGPY3NjbqpEsJ2A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0-20180731193429_1533065956210_0.03830654760022134"},"_hasShrinkwrap":false},"0.19.0":{"name":"@atomist/automation-client","version":"0.19.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"33d37ce20b57c73e29ff54259bb565f7c3bb33e0","_id":"@atomist/automation-client@0.19.0","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-SLmLjLTGsy0pX/m330TyKeAbxo2ELXQpM+66LlX3E7vIEXdlr4PIeNek7MqU9k7mwQz3DakeLJZB9Gj8Fnjg5A==","shasum":"fd165a7ec7e70246b4229b6a797375d0fae39370","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.0.tgz","fileCount":784,"unpackedSize":3482620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYMaaCRA9TVsSAnZWagAAtkYP/0WJ0wDww38FGzzsQAA/\nrFxpB1jguBgnW7NX2PINPPo8jOod1nAv+J3d064Z+4tra5T6EU8ZuhnJo5UA\nkgRlQdR1nkhK9IzA/gAcH6VHBugRSF8xREmS/CPebg0tNNJLXM7M0LCO1hbD\nfUPeZ237WrYE5s1AJs2QuAYqhWL+dj3UQqqMw+I2nlVlDagao7m8fdZmV1Mn\nR4bpYjWI54aKSxbszSskx6uXVkSA2FhDtKZxIDLivwqRkIqx6a4VcdSM6Ng7\nYSRCcuM/Ja5hO7uCXCeQ8bAEmcThlMepaTmKZamz+Q9feP55yNWWp3IxGbea\nmXqr16PBzxEg2g0/Ijf729wJFD/awabqSRXmc7oZFDQGSqwaUQmk2vsRNg73\nXootLQkf39GrhU3han3nFkCYi+XT1z/RuglwufiNyndda/P+SG9px80VGmgg\nUPIeToxuW2LAgUoNiyTKuAGzveRbSF/A+7EO5DYWtMKMgQlF0nG6Rq5NIlQr\ngJykVUWQ+xJNl3clm2cOnBHEBRhOcQcEjo4XpybYCu+tKF90iXzGT9k5+ryl\n4b9IDRMAn+L+C5l6pEXfGKUfdSMnDz53A2kyyKoOPcCkD0XlF9l+gY55IXj6\nmd0omYQTP3FPUebbFjxj0vw0JRdNHO4jHufL1uKKcubWpPS0ghokMhjxuCH7\nub6o\r\n=RpI4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZglVFnscxsk8d/eEVmhcfVJ70vYDo++An8zOw+KztxAiEA7qeyb8iD3ZDYY4eEJ8dyhTXDGWTA03mNW3WRQEFHXCo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.0_1533068954030_0.897918003094448"},"_hasShrinkwrap":false},"0.19.1-20180731211352":{"name":"@atomist/automation-client","version":"0.19.1-20180731211352","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"867d4359f8e4e3103c14b06cf98e9f1602668f22","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.1-20180731211352","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HUwkAc7F3BQ3+7ZLfLi/0hrxilCacxpyroThMF8m84iftDeXtrf5kwsx90WscsOVpF9gsNTyvsN5vlbac5KCHQ==","shasum":"fddebd555a97afe8f8dc7d9b3fdf64103f3eac3b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1-20180731211352.tgz","fileCount":784,"unpackedSize":3482719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYNI7CRA9TVsSAnZWagAArbgP/RTtYdN3ZKa5aY8bHVV2\nJ3EWIpAvDqxj0rpZ9kpkSFYuYKZLgvmW4lQYz9gvj7ZxQspkclvIIEztABoQ\nFrPISnFZMFgyGj0tZz1+NspNyFoJnIG7FEDQuMhJHyyQCPUCtk/obOrZ/2c8\ndwr4edOY50p8oVqY2nYFasPJeKljxyiJErgeGhAN4L44/81Xk3EiF7WsH9S6\nHYGON0Mw8OAqebcwHPQKjvxaqEwtHZnwfY2Z0fHjqm9gnBwZSGsIVn2m3GZT\nHIR1mYmLZDk6ArcWC4shQq3UNP0u1DmU8nd0MMAzKdXtC/iowanFDA26VnGs\noLIe4hWIy6jZCBrnMHGSaUXPnbIH/oA1aW/a9/ESmrg52f6LE9waTayTs9uE\n3oJg2UIauxrmV6COV6STEEQhbPhaXt8MJlcHoIBDG+VjmCbUAzg8YitIdPsG\nILkRDibvF/bUuNESwAB/xL3DwMfQPLQNfpR49MdWQMFeab2ixlPs8vy+MrZg\njK7SnsN+hFcveSYE4JZNeihop1qU7UVCkmYKQ5rJMrPk7Q8xr33OMLDa0xHi\n+AnBRooATbNkbDtIAlzlSAlEHmCaYt/pvN4W9g2bkAyuLgJgG8fyjS+OsxnH\nBAjlC6w1q6QJmB19owQR+fiVRtJaBT301BOuwc4IFcofIdBSemA74rx/bRZi\n2ctV\r\n=cBAm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2hzIY7oXZpSaEZyW3UiZQQbU8wuGp5eu+Xl9RYwQG3AiEAxHDHrTem6gyOSpj9D/Hm02M5fCYC5vMh6up6REpXKGY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1-20180731211352_1533071931762_0.8526306584140693"},"_hasShrinkwrap":false},"0.19.1-20180801085032":{"name":"@atomist/automation-client","version":"0.19.1-20180801085032","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"710794e0a59412c3b5df5372f2649da347138186","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.1-20180801085032","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AnDhHROdfCmS9XgYkUvwswSj6dR1wLq37VAD0LjHYcCLWrreRUbBmkbntjoSATNi0OVzCuZmJeIIaONxz7sgXg==","shasum":"b24453b4393f1ffd8b40009eaec3c304e2d08fe1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1-20180801085032.tgz","fileCount":784,"unpackedSize":3484394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYXVrCRA9TVsSAnZWagAAvhMP/Aor1xNv/UnUzjEjH4eX\n10DWQQqp1SCJmmK6V3qtQ72GBElq8XioyhWwZ7fNaYzP/ti1C3CiY8t2isvh\neBQPTBT6f7TXJ2P+Bs7bo/XcHbahYPmV/4RxqDkW6lJcvPbMarkq5eGe3N/m\nFWH5QzsTrfUJe08Jzx6j73a3LjMY8J2+nwjAcufLH1zv9SEl931B7mMW8Z57\nvv4X2OL5ps4tWNVg23I2dLaFQtx9a1sCjy+DrKjOzcKoFMuv29/Sxt2eYS98\nukwkrNGfEJv+QFVibh4QYmkUawZlSzQhnxETxpXfe16k3quR6PO+mLtnWr9X\nVebLWtccKJqbUVNsOWJFrAhqAPZLTFGabTXLcVx57sxsFH+g24ihCJIMKoXw\nJHUXaVZARGnCt2eV3C44Z0HF0Hgt6ZYvVqM/CGT93zECC/2BjCy+b0u/cpyf\ncgfrOdDgDjdn6Z+ZiWnIUcaf+uHL8Ks5sGouLP7UCjdM702jHF5ye75AHTUT\nr1oj+DB91qKoCNrF08kiH+2GoqmkQNrQo3qV9JY+DGOWlNjaZQVIeQhPnz6V\n75MD6vQDcbWo+i36ilftWehtfKbZH3CyBd680277LYxAGUJzf1iMLj4v4JlS\nyXhQZ2K79btmCh42b06GhTiv5cp4UxS3j7hyQmkeD9xo6YcSVVx0zFV0cZQQ\n0H9J\r\n=BQ4W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTqk30D673go8tCa1NiSOJTz+cC2g1mDeaEvFUUmN8yAiEAyrj9uH73G5n4pUkMsyeHpmjfbKvN2eZvtjO+e6t2rBI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1-20180801085032_1533113706723_0.9256786239391499"},"_hasShrinkwrap":false},"0.19.1-expose-child.20180801101344":{"name":"@atomist/automation-client","version":"0.19.1-expose-child.20180801101344","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"2a5c7e44adecce56e786fcf16e0d92858f941f38","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.1-expose-child.20180801101344","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Tdslwmuqisf5xX80OUWA+0uMkdB0gsBbQUonCU63yGL4k+XrqtvBgYvB167/KoZ1llBpb9fOZQE/XE6oyJg42A==","shasum":"dbd564dcb35885a771e097ee998773633941f008","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1-expose-child.20180801101344.tgz","fileCount":784,"unpackedSize":3484507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYYj3CRA9TVsSAnZWagAAdaUP/06fqIzzGHwku/tsuLlc\nO90AdFqCkqZAGjJmOcw9cNpVe0E7Qb5htL2fD+Uw4Y/G0IcEyZPz1fQrA3FL\n70ST3UilIZx1D8g0Yx0U1MiylhZfOi+97tFMR0eMyuOYOvzWvLgkkMi4El06\nn7H45lKZaXab7QnzbPhQ6KWsTWYmFk7/BrgEKjIqUZ2F1veAka+5cHsc+lFV\nIyWJXhNCzbzZlUehKXWVasd8FnDHSYn4gqr8EzwCjCgmMvk01jp4NM+a5AZV\nBQth9MnoxiGPZg+5kTQI0mLFmzLG5XFbi1yYFri9HPcdJX1jVo7jRfzxT+II\nOXfBeHYMwzpkv5+hb9HijHVQuUPSS/kc2xw0vU+JwxzGpsrelu2aINEHt9Ej\nbp+OOia31v+oED7LjSqzasLEG9U8KcCGvosa+HjvqgE+3FJnApfele9PPlV0\n8fK1eSTXhCDY04Ch6EgTGlrCfb9x7o2QalvY+vyCBB/EM7kmCAC1yL32Wqdf\nizPJZ8w7MS48T1lbhGv7M1kZCURFlp5JZDjlIVjBj0N3Uel+4svx+yRzEH7l\neJRxxNvAuCMjCS2gP8v7qSi9a2/aEOlzQE/O2ZCWaITwUWjDotEECOKStsyQ\nSpMJcWcOIrGqXnTQQOsiDGBxaIOaRTnPA+zvvRAADO2k+fMBJ4EKX5y7x+Tn\nL5m2\r\n=rav3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDU5MULvb5ZqCItMD82IYmIZ5qrxt4Igd+Yr+Jbl/plDQIgFMW3PKMJmL+VChx4bctK+DPZ5BhkfqRjeeYKZvzVodA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1-expose-child.20180801101344_1533118710593_0.6974590360833015"},"_hasShrinkwrap":false},"0.19.1-20180801114956":{"name":"@atomist/automation-client","version":"0.19.1-20180801114956","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"7c4ba22a7b91d1db74746aeb88f8687f1502204e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.1-20180801114956","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-L/ImeIkRUY2WGxELlnBKHY9fDgIREVFQZ6/m+6O+LthZ/WBIWnvRuadtYtS8lUBBKYXa1nCeQNCbBl2v+G5Msw==","shasum":"89b5c48af98538e50d45861a079f563e4ea08772","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1-20180801114956.tgz","fileCount":784,"unpackedSize":3484416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYZ99CRA9TVsSAnZWagAAH68P+gODawAj26dpJPmQkgTA\nH8m61L61v87Xz+9a6mtkEWun8m/eVMHTarClJk+jVEjR8wIVcpTKja2R6X4r\n58JzEMaJ21R3P5WBZHmTNK2GKEXJc2cqjKT46UMc3zkXqLhYJtTUlUKqF+B4\nJiOocrIdlf4D1xAlZNOKpe30unxiAVoPjq2hwab/k/An81mhh4OefS1/CLGK\nrRV6COVUD9WFDOKrOoOu8OzBG8nMqLnkVQTmY+Wa4w8EvPCAVYsZnu6oOwKu\nRMGFUdI/k90CLQsId15JLLBYmC0yCo5onSh7q6p98K3Gj9rojtW7rwW9OND9\nDkHF3e8RXiSwihmOi8/x3Md9K6zyYDwqTmnFAD4R9/9fuV1MZrwyMM66Mgyj\nCI+NOBhLT7wVvErAjClfjpvifK8EqH72A2b9QReU21OsaXjbR63Aq4yh9uYw\naV+EZZISdamhII66WFIUtp/QjdMvcG/aJH2zG62QR9WY3ayW5dOZ4WaKf+bM\n7E2mjRoAzshzGRbmwS//BadUxq+/I1DqoPvs0ktT4iduCECg5yX+xyJX5EHA\nRvsU5xPBuep31JoyvEttgzYzYczH8mF9NBP+BNKA4R5S5u0SQKI/LFTJFbPt\nIrJENo0Wzu7lQz4g2F/TviZCxPW4WzZEWYzEGEFwteR4JbfSIYEa3IgSm0lG\nRlsf\r\n=i++z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDICqG7zm+qIb31wAsk0o1b5ZACTSx+tTmFmpXy+0tUFQIhAOBT29FNeK4z5O8pz047AwzFvfVPwo7Alea0HTxtdX0G"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1-20180801114956_1533124476484_0.9189718245891241"},"_hasShrinkwrap":false},"0.19.1-20180801145628":{"name":"@atomist/automation-client","version":"0.19.1-20180801145628","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"77f7a492daa83fe4103dc3ebf9a11da57521edc3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.1-20180801145628","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yG9E2Myt8dQ+NUnHJhKFFaMgYRSY0bA/TbQ3zTOig1THwYQ2Wsvrl7exS5TCfuH48KQRQ3mUx5Fl8Xm/lKgL9w==","shasum":"bad8636cc5a2cde173b3f320dcd5bedb1043cec9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1-20180801145628.tgz","fileCount":788,"unpackedSize":3492752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYctHCRA9TVsSAnZWagAABWYP/2wJPhUYNnM+zP0TrRrI\nth2Q1hn4t6ayVTNkkmm6q9vAkSxyrNIA/V00tQ14POVQC2LmFYOc08p5aY2T\nVB+H2OzCGp46OUgDNiIEKj7Ai6/+Yn2uxU4HXlITlYfTWqe4nEw7u/RytZ+Y\neEksGxhtFipVW+MjrpTVIfPxWfO8P6lxhfJtLFy/hafNZyLj2GRB9cTrwrb7\nBSq/QzvQYo3rPuugz4SyogXvGsxHT6l0UYWWmqxDaZ7meX+7pqY+a5Kbea5j\nvt78PFos/yLy0E4fi4e1wyoZgHOBSzKhhp0FlYd37u0R44WkjuswCAVljtE8\nfTrIx7n/QhgGIRMxvN4VcCe70XbZAARgMxRVqKG3rdtK/DHer8iIQKXKmnVj\n4xydfGNflR4b+wOcthOlYmhzjWm8nh7S25MPtl5q5eD9i0bsIz/0ZB+VjYEc\nazwb8GYFy4vYmKFb9ySX6JX7ck8ReNO1XzGIf2toahlBHv48e5sTVVIF6CYN\ngQCDu8TYgjO9uNCtfL0ZAGiJ5/kM3wnoQaFWf/HUM8TCxQpQYHoVmCKJbKhg\nxjwGKG+oK0qIRAGLAwyyoKUkKvVYnAEFsvmV7kgdPxGFCwWka51rCIPHqERE\nb1HZmac1mABBVfViS6e6ozfdaWrHwdoqdiYDAxIElpNNcUqysGYnRgnp0UpP\n4G3s\r\n=dO2c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMZz3f6Wp3hNG1FI7nvPb39UZ9bIp8A9LQ7k+bcm38dQIhAIDX672yUPYLkHoPDZOxK8ugUPQ4lX1LFLWVl8mPOmkV"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1-20180801145628_1533135686730_0.25005570469982996"},"_hasShrinkwrap":false},"0.19.1":{"name":"@atomist/automation-client","version":"0.19.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"77f7a492daa83fe4103dc3ebf9a11da57521edc3","_id":"@atomist/automation-client@0.19.1","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wccApQHaKtY2/2kMmjHgtoprKl/Xyu3YLPKbh6ZQHm1k7hqLyVaQQkT3mfYFeYUVacWc3S4bzH4NTSljAs5B1w==","shasum":"6c0484186aa4564c13a0874ad29c6fcbe2620b95","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.1.tgz","fileCount":788,"unpackedSize":3492737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYcxqCRA9TVsSAnZWagAAq7IP/j6/tqTMnpYLJXc8bYtH\nGk5XnbXJieUlQaWJEsCXvCZ3oLbaeqLechEv9FOskTawKus8Q17rra2QXka5\nHI1Q8ZwuZHwH1l8sIxkTZ5WPUwc/b4P61j7GXZ9NUFb9g6Kp4mVR5QtQ7134\nw72BhPZ7DgTcaOOupT6hEqxK6PDC/Nz9ANf3oyibS1MzL0x7Nm667LFwqQFB\nRHwXF9xnk9Iaxm7lVk1VltdZEXb9kSymRwpwZd3hKSBD9qZJv7mo9NqiLSMs\nsL0pEd47PwAfUlvCWbMtaNSzdB4UtWCtueJ1PHamBAv126+/dKWlnPb2S9f2\np2aZ2DX90Y4rqxLcFMVpYnInOfwy2mmTuKFwS9Fxas5cm7wWYzuZfksDYRmY\nox+uxu4m/FnA9wTRkjOs/Z3ToMI+GLi2gvKMqTayvKzOBXfJ/m/r5bayeQHI\nO1x/zsY2gAHsqXJkNwHr5vMVO8zcPw+wfW+HyHu3VKRu6ZdiqjgmV1kI4csV\nW6wtI+4l8vXCzyP6j0XBUqMNHymdz2xEzNCwhK2IE87gh2apKxUgHy4ibjio\nQuKFmHY5jF/rqH1Gv1pxBL2t4TNnjei1lQ3VUzwLAlNNUoxWdfdRzFpLM2+e\ngaDkOhjH2wEVUs5nSqVAD4ZWeBKlj7CRlIiSRBnhGtkVLwbjGogRhyLUSP7p\nOIsG\r\n=NVlA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3ft9RW6hfhwL1GFd0/2K2jEt0SyqMxcHvIyKtzVSoNwIgIw9l+nB+K1geTr3C5urtgAHEb2M+xz4TGzBX1j+HnGM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.1_1533135977794_0.08066649917778412"},"_hasShrinkwrap":false},"0.19.2-20180801150715":{"name":"@atomist/automation-client","version":"0.19.2-20180801150715","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"fb084fcbdb3ac3b160d6bc265d87ab4355c41f2c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180801150715","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-shGqqPd34sv7a8nEY0p21AJ4qwkT2RIs5+wIhs6D3zD6qDHMZYw9YfvfQ7mHXgWLF6xAgVhC8/d4aRG2gsXdvA==","shasum":"f72268a56a59268b4afb560ba344b212ade30727","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180801150715.tgz","fileCount":788,"unpackedSize":3492851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYc3TCRA9TVsSAnZWagAALT4P/14Q7ap2hOMvBmigD3Z/\nE1DSdVw4MzAsY+df1+NyLeJxAaneKtVJJhGnKekSMgCBoo/vYDZVmVClCt4S\n4k6xO9whiRL6eHUxsJuIkVettw9LmdIFU76kGR/RGUx8FHXiuDBRdJjXoJOn\nejU9BXUXdFjKD7hWclWglU11bPc8a/bwk0iqme99X4P/pAUskhMFngMAoEpC\nhjdr99Y0aOZJVmO3fyQf+FjN20jU2mzj+Mktfd2GV1a5pB/iWSDM+iOVRO76\nPnhe4SJQ5YzooGfOnDThVZlWC7AYeLJ7cVUkVeP4YNSLbmuNUSX4bkGNCqFs\neSSAj9DxJYnrYODSDUhQl4ab+NoK4bpHQJo2Fi61GjkcGn/SmvTYPRoKNK3c\nIN8yQjXOEyltRJ1lMlNpOblVdZrYqz8jxwUPbActOw2RMto15Pq17bH17UzK\n3Cw/SALVA3D+QWoBRN5TPE/upPHroSdBhFFlvvs3elObgMwqLDQMROTRhKfS\n3bsM+mRo3cjKpM+FWxJTp8InK8EHQK2sp8bLfZjsv+Y0HrW9SqoGKEy/Gdns\n8W/q3F3OK+NGt+mQ8j130unkiWt6X89sX/4UimJAzvjvUmyjYtFvCoiimxtN\ntPb3y6b56XNW+cKOcMGJCgswuDuxoZhfu6Hnr0T5striublx0ybhg43NNj64\nNptF\r\n=Un+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICrw6oW2cntyB/+DaBDwwSH5vjF+RagAv7H2T60gSQgzAiEAgCygpDaW6AF4chTMnF40ccAIng4FsGJkaB4z9V0CNGk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180801150715_1533136338384_0.7349268380165428"},"_hasShrinkwrap":false},"0.19.2-20180801210538":{"name":"@atomist/automation-client","version":"0.19.2-20180801210538","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"5aafaa8f45026df64d27d3d378f225dfd5f6a649","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180801210538","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eWSbqLcHU9tJvAoX6Zr3GFQJKGM+ttlW3uNoyBAh26nBYW3B13sSb35WjYXQFQVyk16GqWRZYtkzXwRjpfrB6A==","shasum":"08e9ac8fff8981af9322b1838262706c89c51cd5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180801210538.tgz","fileCount":788,"unpackedSize":3494110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYiG6CRA9TVsSAnZWagAAY68P/0yyo6U5RjjkVBZPjrl1\nZQXNvEMMZKSGWe5j+7bY6AYROqkgTtTMzt1yj0+3rdmLWcPrhXnyKJ93BW9T\nrEoiPSnGAY7K7H5uLbOMGbUGB+EKMfJS8OFq5Ik5q4DOvkZso4kooDx62cRv\nCWfYFDEBmnwKg/V6qTr9Q3aPulnhl5GxOfisKLezguVwI1SuYrsEESOmQUGY\nXCG7Xwcyokf3lh82/sgboAP+io9nFZNy72XY6hVYwW0tP5CzVlzFHNG6M9J5\nQm41vbLPI9Egi/OyRxkMIhm/tlTu0ZDKAx2qjlGWElNnibCuaYdY3g+qv1Dy\n1+xJurqQerc4JrVQXpsuqd4pM0eRIOpkGhBMw6jy7H7hY87BG+5cVgsMTV1Z\nf2NQWTI+FFpIIeMFN2MBCUhfDyqYF/5zyuEuGQQmteeiC3UyQZq+gM/zpIyU\nEbHAMPa7WcOxbFXQc4nz8VCddNNTnCTpW2+J+IyPobNDjMuHoRHE38w2lP9W\nQ4VuHRjVXnpCs+mO5Atk2fQbxw+TxNH8BK/SIdxrpjsK665dZeXAGkt0ZhPc\nR19GmdvLm4hRGQIKO00W7PovQLKTuWPVQ9L2z3jmTcOaQTaXwP5A9o+yYHiz\nKU903L7V/wxd09cMCf7FdDV780vYzMxM4xMPrqbLz7Bo7uWetstRm67USVvw\nbXRU\r\n=MgGi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAEtn71JMgCEX7+goIQbQEMKCk1IZquUxzmObDUr1TiSAiAPzuaMziwa3bZaaIrJRImDFMJInmdjvIgf+qcaRcNEaQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180801210538_1533157817774_0.7050918768073104"},"_hasShrinkwrap":false},"0.19.2-20180801223358":{"name":"@atomist/automation-client","version":"0.19.2-20180801223358","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"5ab9b8e150aa2c5ec19332949076c9a4ac81e131","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180801223358","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yh45u5jvOcBkeM6IIWvpqgu+7PHMwhQb5EAfMpQDOCJiZwQ6aPRM8mphpOKd36uVgn53HDH6XFTDKxijzZlz+w==","shasum":"f13accac2c176388bf67b01e54908461299454d4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180801223358.tgz","fileCount":788,"unpackedSize":3494219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYjZsCRA9TVsSAnZWagAAdbgP/j67FksYmnPUTIg2GX1X\nDOmBlrqP6xz/+Bam23Cs5qdbfKkg1eg4FNPM7Cuf8iBFJlzsAKvyKxfh4uZ/\nvtXyB+F2ByVziJ2ptRg18MmnbS1K+x7Uqo0AqmqUxu65VBffFqQX0Mo3wJT7\nKJWKZfCvCvtgwVGZrgPN5uj/nuUivrlXDzYqKMqLVGc7iYqW07s06IUPEBLO\nYbzqWXqEdD0EcXqcQf0D++VGn6HQIa1zUI0kjc/AqZkQq7ivTdFxpUgIbKn9\nCKu8ykZELMKdHBlmeae49gdeDjcVpcYQc8XA2HXem70XvsPipC2dO6y7pg4r\nsUO0+LjqMVefcVprS/5xmy46FjzzxPr3v9VSHPtRClPO+XfpIbo98uoEQqXp\nWXWDxUkqsuLeucScEAnuwnw3T0R0AogPvjrcMPo+Q6hZm4oz4QiEdNIKXztl\nx1ZRY5dxURyZ7i066cJQpsy13dw4Z9E8I6s/pfXOPoyZH4yYNXFDai1oz9MT\nqk8/cUKpZeYdTXuY2ZQez3bPgLD0F1yzWn8FvxlvT0uL/9ZZbqN8Gi43SZbU\npd0G0ePME5AM67EaEXXQvvKs44/j2L0UtllVIe6JBm/eIh562lrSGBEkvo9b\nxGggnSf+83MK3mIR0/pjEiXDnFjkawbPFTNlM04Az+Avg2EJXQRqjJsHWZW7\n16cb\r\n=d/92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP4oPHQ+eNMIEUvCAuTtKlZWSw0k6UOPT+NGWD/NgZjAIgAekJDRkNmLN4abB9JJ186S2YmHcvVC53hBVajhgjtsM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180801223358_1533163116112_0.8548756186247919"},"_hasShrinkwrap":false},"0.19.2-20180801224313":{"name":"@atomist/automation-client","version":"0.19.2-20180801224313","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"beab068dee81f31988749335ff72120494b14a2e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180801224313","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CRFNAWkdAYSjVf1ERA4dVHt31zkipm07FLMKBO//I4et2POdoaNjMfX8o0EM2RR7PoX8uMFNedPC/CbjQtce8Q==","shasum":"b4069f14038c8eeee0b8b9785bb6ddac5d7bfac5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180801224313.tgz","fileCount":788,"unpackedSize":3494030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYjizCRA9TVsSAnZWagAAUlsP/1/iVgW6jugz00ZEIP3A\nN39pjhIJ8e1ynEIlFOSZtCfUPrbbaso9RNQyNgDj3bOOYhoVF/rgSXWMcz1g\nNpo5wlgxCGm9wZI216oBCQQH7LxcRwNxZ/J00ZOUT/GwnvrQHkktcCzA3PYA\nYyfv4F5Tg9sk4cz4b+3qU83p28QLqdurKxqth+AQpZAoAuVKJHc47gNxmUnx\nVjc0G471USdrm5TFGP/HQKu46tF+Td9EIGw9yyUBDoUM3TbNH310jSQKSYHK\n++NUgoTa7qB4TNGJpUHzAqT+0BUmc6eeU+sADH+yjDux1HCmsPqOQaWt5tK7\nnsr9qCaWELKLFh9HdLGVVu61V6wRVFd7OQGvM4cZEAMFdiIe4tsanPlJ0Whj\n/FUKJsX/R6hugtSOek5rIr5oKABbVBkBNtctbkwUkewycaBDSOFyDTd7QgzF\n+OYMfxBMXj9UDZOyJsFr4c8QflWKdZAwRvqBnSSpjRRtlWqMp+wUpZata7Tu\nHirdjYDyFBIGmJdTJRk1K/zVksynVSuQLZsbga/D4aT6w08roLowVNspiKyG\nHzQofr6/psQ4LURCII3wW/QJMjdq35PkMhJArsl2czj/D4yC/g0nNE4XZpkA\n8lByUq9wp0/lsnkhP6xKJwIKizld8rx/Bw9/Fd4WTdItGjI+VCb8BxykajSy\nZ7t7\r\n=mXhY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmEr03anmIwtwB43+rkdlRkAtJlB22D4jhkXtgtnfWAAiEA0g9QNuMhTyXZhES1zy2HXzTaRPmzi+h+dFCtYm1aT8k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180801224313_1533163696504_0.36830097052484034"},"_hasShrinkwrap":false},"0.19.2-20180802060634":{"name":"@atomist/automation-client","version":"0.19.2-20180802060634","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"2277f50cf4d8b33eaf8d2843780f700a496d0b4a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802060634","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-saSdJgTJfypOR8FIeo04A7NH+iTpzXc8L4rpBjUA03gTYZQxEV5Oz9+MpWC3PH9tBmXBTNeSrq+fsHH464QFTA==","shasum":"838593d84fd1c380b5c43ba0dee632c9a67df85b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802060634.tgz","fileCount":788,"unpackedSize":3495976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYqCICRA9TVsSAnZWagAANz0P/3+SHA3FBlrF8ch8ekx7\nEQRSQ9WMcjK1yHlkxp4QhpN/pk2NnGIAxG3O8VuzTahekROXq7y4TUxVsh4/\nZR1SQaJY5NSSKF6vKuewvJyWqDi2kEkPP7z5e5WmNrQL6dAIETVVZbhvjTYT\ntcx3ySPxWluTna5HtXtOZaDSCVYdECS9dFFL/RRDxJY7TmJ6Ub0yLtCSdrYb\nEyrD10E1/vHUq+UzFR1dxt/bK75KbgSnMM2yENolycJpIAbqo31P+7qecquu\nFmOh+qehJ92HJAOtGgW90KUHbF7z4ggALSh+jvRcMj0tdnFpmOt811UiZaf4\ne44rE1S6D+B0COg3eBKiMsBka+HtpqVBeKJj4aSUIqqZlaspFBOqs5YMJOIT\nymVrjX+BkP1wIHZMKnKvPil380qXxkzIWEjWqmZG62UUqcKbRJ32FibklcNV\ncoWkAsklHxXr0ZvyS4kvggczHQ2u0PnDICcp6z4LqrfOCVDINb6f8Q4nFk4j\nGL2KTuibBpXv3G3VVp9KA6dr9dan8XWDWmNxf15Y8rMGcn5yEH8OcnpOG+bw\nUv4+YiJhVaJaJyRMMqr/vm7WGdEHORsg4IZGPPCv0YIy8JmvM/cWaDvOndB2\nswTaJZuf1F4SK/ZmYN1PdD/JdcaPwyKbN6HoJTHMdy1H3q/n3DA4IzfLRzPf\n1Fj5\r\n=EeCi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChIquQMmfo5oxvwJsRno8hghTzSfW0/AIhNzg9ioAxEwIgaiu8HlO9GIy0xk2rM1P1vJHCzK2FnyQgq0qdmVwXj+E="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802060634_1533190279498_0.9814498291480338"},"_hasShrinkwrap":false},"0.19.2-20180802092318":{"name":"@atomist/automation-client","version":"0.19.2-20180802092318","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"0f5bd992e3003d3924118860a2b705c03db8755f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802092318","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GdZ/o1gSpW/lVabMSZIi9Q01LvCdVAfZtQ3hErEGeyQCJiZx6SY9pgK7fxlrvcmRotyQ0AWYYERuj4Nh+azi/g==","shasum":"2a866ce20f7d78ee37ae08efa6028d83763d9745","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802092318.tgz","fileCount":788,"unpackedSize":3496730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYs6YCRA9TVsSAnZWagAADKoP/R8uf/ufVpO8VxpqwitR\nRuKV6+s2CUnK7hagreP6QnN2bDR14g78+/4wiHQNedeHhcT28cCMDaPbAdsn\nai3tg95oYMAdLAZZPMSq7ToarcQMEU1PeL//vyyqwOz8lJBQ6s+O9g/SORWu\n3lIfdC1U2Gn4lO7wrJvDI6xLFyDy0fbRgDWLRrGwrSsiVsOS8zzc3PI8ME29\ncA0HW9Y0p+z+oUvuJujxDal7pk6azmWbZ88W7WETDh/2uDEOHSIGfQ3b5jT6\nS4BWV0EjGoze2rQyKVZMBbLxJ18qSDoZHDOegPBZ5dWWJcsE85b6HaXw0Vpq\nXmSX/p5SsND+lmhhqKmIS50hRBRP6C4lQdy8i/GkhabsZCjRiL/nYiUokSW4\neqFKcnAgretJhZrUY7qEnqsKdIBln/Po2nyZiUMOmfTvdiPDtzrMffpWqgqj\npxhc8KJ8D3/3uJsT+Z6RF8QtOfasAI3Td1pqmMOZ2/+NyFuXSF4pKbIl0QbS\nx6g2Qm22Hu1tGCOPh10ALdzb858AoEINdaMfVJTOHc9DeeFF1uIdKaM7Ia0b\nkhROKr7f/CQ5xm5Cx11XacffWuYdGjK1e50WTdYUEXJFDMYaGofpyhyyb2sy\n94BaxaOKLFttQBgkWP8vfSUFypXN26jOBLDa3mJ5Il6hmEMfGa8sZi8o0FIs\nxF+k\r\n=hMHm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnXtNbnDyzQZEPjFVA46zz9uVWXCDaGSPIzvuFaqMd4AIgQQ9fKHo1OoJA+VfxxJAaOCMSrpt9LQ7XoHg/RnEZKp4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802092318_1533202071464_0.37589498652363385"},"_hasShrinkwrap":false},"0.19.2-20180802092758":{"name":"@atomist/automation-client","version":"0.19.2-20180802092758","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"e8e54c96d98b768d857c986140fde65dcad815b7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802092758","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WaXzIpzPVzb9CYcF1QHnr3T+JZC/VqbKTN1Ktkg999jbcoz8j8Z0f65ulJEGDo+uLUEwzk3oaYYlJ7gSiBfeWA==","shasum":"ac571dd220842b55747e53f3e691042716014192","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802092758.tgz","fileCount":788,"unpackedSize":3496808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYs+5CRA9TVsSAnZWagAAtH8QAIqOjCBxuI3cKghyYc09\nks7PB/DWdzIxkn5bfPgYJJAadAYbMu19tKnfo/5JgXJOXC8eR1Fsdb+VNT88\nCA7+wR7r9VLS+v6/3d1f0URCIeoCvxxxd5tV829i4/XCTds9N01VgbMJNvEZ\nawaVRjcTAe2MEmLyHdNASawQwHttTiBufXG7BzBKyHKIrI8hgr8bGEv7RUtk\npHxX4hVzjSySok7BjWKdYWV6f2gemdAm7rBJ75B+rIwg/sdwZSGPccllLBBt\nvBeled/A7izQ7Y0400sE3EEFeCU192BB6nk330rZwRz0o38QfYTBHnlPJXF3\ncV0RSYrhO315bh25IFFWhqgnpYaHc8tYeNdUjg76ntkrLzEH1K4wq3C/thRu\nwjffqwkLHUYrd6s0+yE9um9Md9u84d+MugoGs63apJApBUnfA86h8dDmjkSL\nVKIfaahsxVivm0+BFJ17dki7OoZX6oNymobowNDCFVsIzaAU21aw2HVAC5Dv\nLpc9b7077/2oi11QF25cofu6jR+gZ2WSMTC8yoQ07H9wk/VtwH7LjK4t/2ME\nYtLeAY8s1aQDkYEYbEAKEmQKM8A83diMpK3oaMbSG+SRE+tIAwFHWVUc0qTn\n3bl+QII660tv+IyrF+F6VYeqtEuXq56hCdpPUhvxrPVK4UrD48YHfu/R/lF/\naoko\r\n=EYNN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCffpsoR1Zu0k2Qo26DVcS3dJyUNL0p1OS1L8o7l+oF+wIhAMbrHfbdaPgkwWKA7w1NMOD9dnL99At+HQeup1gq6TcB"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802092758_1533202360942_0.26185520637844983"},"_hasShrinkwrap":false},"0.19.2-20180802095618":{"name":"@atomist/automation-client","version":"0.19.2-20180802095618","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"e87d60150df0b1c65f3790af3ba3fdcacbef8872","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802095618","_npmVersion":"6.2.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2wpcqYie3yOaCWmMRjWpWZ9HkWf7cq0cBEQh7YrbXa5/votlofJfqRHjBmYwyaNb2rXD3JO0Z3QX8fhLLvIMtQ==","shasum":"fbfaf03c6ac4be8c56b371f6d4845bd5ff22f91b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802095618.tgz","fileCount":788,"unpackedSize":3496727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYtZhCRA9TVsSAnZWagAA3soP/1v94a4LMXGNMfbFFEiB\nlMNakDThTfFdkWoV5BMWym3YPzhfvy5hvj+CBv3yMVhKWIsH1Nnyo7NeRaTJ\nOF43F4LApIwzDbDZBDLjkG7J30g/8NHZOuEcsMLolRFGiK00hyPrikDhf5IP\nDJnBz0JUBri13vByioQIjd8WuX4wF7B+cN1Q1O0P0PzOXKW222xxrMXWQ9Nq\nIzv7h6HmBsiYmK9LRWKYSlnzGuUiKMK66NkiUf4wzwDx8w/aP3up/ijrekHi\nVK6+AIZISM7aUvDoLGiRxWW8NJb7lf1pUE8r+l+lN8YbH/GMXQ1n7zYFUN/K\nwnrRIsIEQEjTk4NLX6kJOWz9UNfTwe70zXdvb8mSrgJlHqAm0/jWMBAHhrSJ\nwnBqtEmkOqaECZKh1v6MmofiqpW4f1QZ3Osb6cg0Xh6eSPHur0WB2wf9u0Py\n+4IBJTJKOATgUukHkXLAwtjoCOYi9JgZVItuNcjAfVLlpQ5GIgITngEnVbK6\nDCTJrC6I5MMx7wo5F2ctCYhTY/PbD420b66fPql07h8ZYlwWYyp/yt5s5JgM\nGhh1XopTgd3mDPsvzBajYn+lW0F3sOaeKNPCCnAPb+9RBP/tYxbN8CGRm3ue\nnxJcjM9LGaNoIezcqyJBMSosIjbsBX8a0k6yr/tS81fu+U2MB/kCpGEVFihb\nU1Up\r\n=Qj0n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZYrkMd2fcHr1Lg9z4KPFdVnYNyP8+nvtNRm7zhhtelgIhAODySQU4NcxKtr1GeH9fnzta6RFLZdk4E8z3o8KIognD"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802095618_1533204064737_0.9112822058799126"},"_hasShrinkwrap":false},"0.19.2-20180802110107":{"name":"@atomist/automation-client","version":"0.19.2-20180802110107","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"6774cf8379906f45725609eaa9c56212460e4fb3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802110107","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-YhWFp7Krer6lk4ty5oxQ0rML/EzwCHwFX0DWACD4kJ9gt9ISSyahBCbiSlIjth8KVP4DiiVNN3s/YIfo0XQeVQ==","shasum":"0026c1477a456bd4241d48e3a0f8874f7f78eaf7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802110107.tgz","fileCount":788,"unpackedSize":3499109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYuWkCRA9TVsSAnZWagAA9fcP/3snc/arnEJIrBCYDbPc\nMrsdachgRXTJQb73/+MYQ3oiKltEwTg2NP03MbgrorvozuQkAYATnt2BCawq\nRX9llb3GvdemcXVODWL+A1ENEkFuv6S2ayQeLQ6RYAxiOJwGfMe7wIJqUGTo\n92AxorPKHvfAczC0Cm6SxlbqpmANqv2zVfC99wH1XYahlH1ZfUtg5jvRJc7Y\nB61C74m0fiB13A+tD1sy1P1TQyEonONguNdwx2lfn9+10k3azWWl/dIChQMA\nH1bodSzAAuYDZ8RWj9WYC7dgtKtM8bU76JN6YAham52ND/HOz5qWHr7Gvtcy\nkLO+VMYoxh13ZOruBJyg+QelhNMpX/Bs4nfk1xlaqVfpmxOEjWteKlNX8CJT\n72mE2WLvaCIboJFyLga3wpGLzcpr8k2xnNH3TjbvVuEOXg+FnDlEBUvMBseg\nrEdndlBLircszS5cYbWFOi9Nymr3NRF7qFbUW5fKO8jm4bKZq1jM/TlUEf1M\nIVXTaGmk2JkmKBlPtHPbjkI9ZmOCux8ED/+cd3zKzNT8268V51HaxgzPg3+w\nJ+nmOx/EUh/rpTJJMy2H6+JzP1Im+gAxvdZgdYE3tcU9AySGUmX/uujnnxaf\nKAPEGaWBDaZmOYIh/kaMvvroTXiaEpD0LAK4Sd51UaKBGy2d2BVOwyvSy/u4\nwVex\r\n=A1o5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFxABkmCzZ1zNa0N7FUoZwUpT92LcTuGx2o85bEnaL/hAiEApBPZqe8yliIXwazCeaeS9JoW1tPpaDEJCQZl6rV6VWY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802110107_1533207972282_0.8702361922481479"},"_hasShrinkwrap":false},"0.19.2-20180802140457":{"name":"@atomist/automation-client","version":"0.19.2-20180802140457","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"3d37557ce99cfbd9d09b53e86af014f536bcd883","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802140457","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1+hhCWAiOc5T/3te1cWRSV3LHfzD3+oeVjzspKlWjrGqB/qqhYy2SNgioU7IIYH9MCSK2B7YJJR749pX4kK+Yw==","shasum":"da71a34b209e14358b3517614529f117495265a5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802140457.tgz","fileCount":788,"unpackedSize":3499261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYxCiCRA9TVsSAnZWagAA1VQQAIV/D99sfd0VbZEFadKE\nGZRBppkX9aeuVr4MqRslPrhFrki7EylCtFUfGkrIHzEej72XuPmk0PBD0y7m\n0PFxDn6x/zGxJ9mdkrjpZ3XQ36xAvkPlzL0k8ZhI8OEkM2/Z3XB2b3GqPv2Z\nQr7eaf3F4UHvaDDMcGCI1X7WAF8RTLZxlEoNuaO5fcMtsfgufMvgnj1tUo0l\nTxC/wFrtiDIYjdeWbkm6Pk3O5n2htwXbDyeHswgYGtt+qFmc/riEj/+JC9Rb\nyJb6R1TofQB4TSLedjRki2ckDtseqdEJ+dhaL7E2VtKkzLinJO3TSxgWQfLa\nvEpVKjDMUSjPDr5qRrNZgY1a0Isb3IIKA3Vf4MMhXUzj+tSKYiDAL74cbnzL\nFF4rB9TL28vYKyrJcOBdcRETwXpxu5Jshhe5gNrO+v/ihPtaz1ik3WDQ2PsI\nKH5u7oOc+XZHdZ2CiG5ugTls/0FYaGHasiNAum1SFugWsQMbMr2rc84zjWKQ\nOaZUHRag3jQ18CRTTJUKVAFDqiSles3d5LDg4BtTRy8I0UuomtoSHBZecHCe\nvEGV/NSDh09Bi4PVJMh2M0evkR8GwYDHJ5lP0adzxVMbIQkQPGBJNxw6S8ut\nsATLu/hpAgyjdFpGgkX2ai7YiM/I+AfrTLONZzcuxCMsLJ7foCtczJdC3AfJ\nqvxE\r\n=7Gdc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwMwxmpDv2q+/9QIn1vthx4CvPxT5R8mCZj1ZJEyflgAiA9K5QSSHNa9Qdq9AL5DM25aSUDW9Y8Dxije7g28XZphg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802140457_1533218978133_0.08545977040627362"},"_hasShrinkwrap":false},"0.19.2-20180802150457":{"name":"@atomist/automation-client","version":"0.19.2-20180802150457","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"be3760a6a1aede504acfbda3f98ad6c71e8d8799","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802150457","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7vr4TbZ2VdOQA5xTI3pH5gn1AfeP21Gt3Fz42d/1qH2Yvln8/57XAhgPUo3c/KB+a1QOZTfT27F/GzFmagtTGQ==","shasum":"78169d9175f48b8e8e86f6e7085dcbf6a50f434e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802150457.tgz","fileCount":788,"unpackedSize":3499768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYx6xCRA9TVsSAnZWagAAKogQAJHjNoa703TQWuB6aLR+\npzpGSW2NVm5VY9tQPAR3Y5vzU8ZF9OSM1iIE0dLN4U6H/DdvQ/23l0I2wCpZ\nsfF24FXIXI5sANArtVmkLFuM4ac+3Jqvpd5QwonA+o0UqS0WXkjNQrfVifv4\nS6qr83DFqW1mOZg5I4HOZM7JBneBy/ACJaO/LeV9kq8lKfZ+ORhKaCunSFMC\nKiD2E4IPJUiTC1UNDGc9lgtHvj7F7vp78CuzNjBskzHdICZQjTXe0hcCIXhw\nfQaHZjRhCbBm5DgdwWamRGwdAn+1HCmmG4y03jzxH3AdHD860tUAxvumjIll\nq1cSuEUJKsUbTU9djvzLmaqkrHX+2Wqd0doxgocDkU3arx8YO8K/yzspnpyf\nXyBMNAUgJZaGzN9g3SmO66sEuffpBYC+0yZcp5qhwfLmPUvVYcxpXVyHGmIX\nMzDZtBTtyRONSWsOqH0kPIKf/V1LeToMicxGqIFZsFTBrMhXAtexsprlXtAr\ngjHVFV+jsZu5OOwoxpVyTPmRToi2TPP2n6yBjIZnPzt039zG5BZBszfI3PDx\nM+ZPst6VDIS8EBasM5mdUzZe8j3s40YdjdBC3/at18f8Hp8W2fQW4XSocKPz\n6ycGMLDbXjrvJwS0avvigfrN9GzC2ll3fBCYnDF+kRQK0OJR/SnwdvsuTpMS\nQJRu\r\n=0mof\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2mwtcLvuY/8wDVL81mh9jp6UbnDvPVWxNx1tDfKKbRAiAJTBJrsGhcf+asn3+2iUz7+ZHtsMHmulTYrCf4Zs21dA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802150457_1533222576686_0.48015135410782106"},"_hasShrinkwrap":false},"0.19.2-20180802151323":{"name":"@atomist/automation-client","version":"0.19.2-20180802151323","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"f99546fbfa67aee07ea4aad857fc408210e9aaaa","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802151323","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Ua25HflrpkiWaRBIk9vH5PEd9R2uuks+jKG1rALxnQ6yvI+BHxG+eD+8dbdO9iaZGj+epQb1Y2VXztrHHgYnHQ==","shasum":"1f0cc1c6e9bff8506b4391fbdbfd82b44167c18b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802151323.tgz","fileCount":788,"unpackedSize":3500137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyCfCRA9TVsSAnZWagAA26IP/2KXOVZOkch4LAmx0QeP\n1tpf9Y75QQ7AdzMce6CBi6MWPhNnzcUj6hKB7F3LRu6X4S4kxIy5NqcbJezn\njQ9aHJZiWLZCSYSqweoYT3fK4aDwvHJs+L5OEOx1Qex5GKhhGKoIH1YHtkBx\n3hkyUsCIvMThpTQlvxhfTczyZagRasyoA/ziBah9a66gImnn1pAdfghhZWFB\nBqRaoS52qBVwueY5czt2HNcsZTEsAIBuhxHAw3ArBQJUiDdFQsVINgnzckqj\nTJF2CBrONNj5I1RDDxQ9erS4NGu5oKMeqNq5qBvQJJwHSt0AbDsuQrRZIBAy\nJVbqv8qcmpSJgk0A56BZ83Wjq75fuX/UWJ88jPdVFFAt148yKqpTHtaANJMX\nM97GydbFdXgvBB/JnVwIxZOS7TJfseBNa9erXxx8aK7WAnS/DKJIWElJKYU4\nEFcmScDBZ2LDaG9KDFzFDoh3c1BR+J4+cw7ch0AKRtfeFfW7OXxx1Qc78dgs\n+z00AscMKtU2QpbkDqfdp4evhDB16lQ9cdGq99aTv0l5mCp0+odr289WeFVX\nUDLd8HvZakuajNI5ur84E8iFlxI2EfjKU3SsypURdNjnzUm+M6gdECwABOPA\nsC/gDs0geh9+pamX/2jlsfJHCYMuWCZ6YbQRgUSIcz9v2a9XOfVP+yrsdDZ4\ne21G\r\n=iaEY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDrouwTeGoqT3CX/uMNOpvQ4CDhjfofmeD1AHscEnEsAiBzruCVxWwYG6HjvYmObiyA0k+6mctU2ITqdpUxzV9mow=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802151323_1533223070668_0.19920725556823315"},"_hasShrinkwrap":false},"0.19.2-20180802151801":{"name":"@atomist/automation-client","version":"0.19.2-20180802151801","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"1ccabbdb0fb9e182ffb55ed0b7c0f254bdcbc481","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.2-20180802151801","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5vb3cdgAuHxnqRuCsvZ1o5gbnAJOZOk2pQ4pXtw/mq0u9e+7cwVcmgFuDocnfxBI6inMjHV6tLhGbloZ6/WYiQ==","shasum":"8a880f8b7928dab6f0ba3dc4244b63e9266f7031","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2-20180802151801.tgz","fileCount":788,"unpackedSize":3501242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyHJCRA9TVsSAnZWagAApwsP/A6CX7rtTqNJxPP9CVxZ\nOt0KFE4gl6U1FJNBueY7msGxxFJyv5QeWBwwnKYCJGKjgEr2BypbyO7svBTe\nMjhPezRqyW7TKfzY9LaYoz/03jy+EZevNhb+pnrxtvTaUUpIU2g/PyL2B0Qs\niiaZMn5bdyVl+hTE9cxPW37lWaNZkfOV3SdQFsDFvt2RBVsGUYSBTdFRBEJf\nStGYG6gDZfALfYXNVADzyojb10nVSTj9+k9+/xsnL7UftQpSuuEbMPv3yFKO\nuUqDzqlaa1qMUqGz172UWiJopUQ5bbywD6KJH5Kp1d+VwznSj00QgvljcSxV\nI1HwFB9fTsyKUycB1p6+ljWyGBPav8YoakN79lbwnDzZ4p7SS+0YHfqeUmyF\nmZzu6TLWayCwu5EYJE7JdnsOWdCeROjsWFCsibdUL+cNyVcJLb84eDXNg2+E\njOV0tvZcvYJGCxqG6GpTjRc0QBfEsBAXLHmZmfBW7CPqkv5EAX1UJkJ9E9Ii\nhLbyuVFCwqo7MzfZbMMf5GKkrAsiLgicLNcNHaW811udbtHB0Dp9/YuzkPkz\n3o8YF1YQM0XNlufCiNbTWIh0Nxb1T0d/I7uOteJUY0SPJVtTpvcMVbMgJV32\n7UJ4WVSSBfrSl0nJ2ZcAdTP4BThPcx5wqen8aG6r8Zx9qDLSov6WzyGcCYVo\nJSxY\r\n=oSr/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKMynoeP0AOL5iijHFNWQ1j0D/Xqv5v7G1SeBurb90gAiB3wz+L9gXjAJfKgrFL5CvmAyQTXxb3rBFjidk9Y+r8dA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2-20180802151801_1533223369388_0.2475574325561003"},"_hasShrinkwrap":false},"0.19.2":{"name":"@atomist/automation-client","version":"0.19.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"1ccabbdb0fb9e182ffb55ed0b7c0f254bdcbc481","_id":"@atomist/automation-client@0.19.2","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RI/DU+l2L/jheHnthkNQgxua5q92E0nYiYdkgmgiIeHRqUwPfP2vTb8FEknT61/JItTARRjMC0/Ge78b/uZwxQ==","shasum":"ec4b166ec4ba43c70b68269f7ca72541905e86c5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.2.tgz","fileCount":788,"unpackedSize":3501227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyOlCRA9TVsSAnZWagAARjUP/3lk45we33LvZALLTE7j\nFqNKyYszf55GKmdg4OFQc7KwKObRSR76Su+0UYbwkhpJKTz6SXkUPzmPXRt2\nF5eD7063h7eVblSAo5REnJc5O6ODpeVmbhNlh+nYbfv5Di1VMCJ8WB1scJvU\nqhCpPdrClZZpI9DYsdO4fJu4ZHp4597UGUU8g8GqVUN2YEcL74SM1fj6UHu9\ngcnqr1CI/WKfwnjrqV3jP+t59DSl4u2dWshS86m0X20VahZqaCVI32U5wJOH\nk+JTpg27f+6mFbhNhdi6P9y2fKeMsChqOAAyZyX9WLmZKO1Bf7S52WM3qQnC\nWZTEf6+Tk/SKOxvUPPFp66jQVk5LVh0cr9HHmUZP73DMJcoZNOhktV7wlnf1\nBgeDAFHgkXAQaPk9y1OzB+RW4Rl9BREr3M4eg4pNrbreMISZnmBzg5yqARW3\nKrgIS6qp7gm/kuPV4dmp1lq6NK74B7SbRKVRHxOG+3Ko1evZB6/ZvdFhJA7j\nq2euiNFT+CRMJI1TeygmQhEz59HnxYgIpCYCiTZIaFRZqRE9QhyeIBXA4Edr\nKhG6AG21o0iel1LNK0WNAnzz7KC1kqRsXRabGCVA+Ba7q3GgpiQeNZ9O5zjF\nSOHX1EfM3N22mRxqQLSp+Up7RO/8GHKG20MbLFt95oVpdCJCy2NgJuMO7S/Q\nqxwy\r\n=AsKl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICuv0uXI66OfQqxlgM+eE/HUzkfKyhfX07OhjkG6YE2aAiBWc1lCRr6ax2cOXNdPgZj6ka3qyq4dy0lFohkw4XoflQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.2_1533223845333_0.006532368988009241"},"_hasShrinkwrap":false},"0.19.3-20180802153147":{"name":"@atomist/automation-client","version":"0.19.3-20180802153147","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"1b0c387b5ed98d9b1a8c13c2345204a406112eb7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.3-20180802153147","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9Ei/ErlzVU5TXM7R4ZiN+9Oba/jImt0JXErHce0+dShRzjdp0ctd5UM96vWJ14rRIJmmzseUlfP4mBUQXJWUGQ==","shasum":"da9048c3fbc6e84b3e7aeea32d49db90310d43df","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.3-20180802153147.tgz","fileCount":788,"unpackedSize":3501341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyUACRA9TVsSAnZWagAA7egP/A+5KT5LYujvnlSHr2l4\nkz7R2wKF71z2Nwkvo8Jl0EyilGYI7TSDO7vY4f9F7POc6LyhAO/qwAzgfteG\nKRUI+hupRQQCSQaSgfAmgxckx1qMkMY6jKSOsjpDUzfdk1fFDFIuOWAKbTu9\nMSGv3/qev32L8EtRM9pZlUPuxT/OiscSnzIGPrYkTnOfFkN2BzJOvMCzMNtj\nQJfd6ytRJBnF2Ew2ni6nBa5k7PRMegekvDulg1hpz0zQAmMRRhgUc6fkg39A\nzmhQS7tqy8rzaHFD4KRTePxG1eFCuLGNXbN51Pv8DlpXPbtNeYoB5CXOnPJC\n7GM2Jjk1QrUQdY7nXKFzdg66NsEhBe0lca/S0YTNwYKN0wgMLUua/B5TG0K7\nSCJ2/pT0TXQz4hj/uLffogjWD+Em5GZ2fl+2q0HaD6B/Ee3zSj+zlYqP8n+5\n111Z5Thc5fdv7iS4KbNjJ7ZIIMnR9DgsJl4B3ro3xLYMnazlpY2Y1pSlLR5/\nP2PzUTToNHIacf5HtGGSg5eqaDf5j4Kg5EakkMC9LsoJTqwSfaWlqLgZOa/M\nVLqnMaifYJwxIIQOxV67OTIVI/VMEMbPiD85XTWj9ku7JZlSuFJi7PtPPo+s\nSej26wr1EDkB/8ltOdO+Ccf709LJGLnozBlHH0hiWWEVDoexTI96HnoWCXmB\n8MI/\r\n=dYpq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/4e+W4gFILxgwGt4I+L4zOBAbnJ178Mv4Wpb//zDrEAiB9fzC+B3nfkQActFQ/PQ4nL4bK8uSTWkYXk4aEdiUlJw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.3-20180802153147_1533224191391_0.5330897577930775"},"_hasShrinkwrap":false},"0.19.3-20180802153303":{"name":"@atomist/automation-client","version":"0.19.3-20180802153303","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"42e19cfc2839638338ee44e06fd201f8cbe93ebb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.3-20180802153303","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eSP2wooYlJJUXqS7z/912E8juritERQgmOQmpE9Iz6hLIrp+fub+fWlfDwgM2/SDMBTN/TPok1h7NR8rfCCwdw==","shasum":"9796e478befcd0eb2cd95a2bd585e01eebeb2c1f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.3-20180802153303.tgz","fileCount":788,"unpackedSize":3501421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyVDCRA9TVsSAnZWagAAVkAP/0T1z4p/irXFAiIEIrHF\ngnhFXGj2QaxUAYPirut5kMq8mWFQ1/XJd0JwzmOreZJlniz6MBtSE0wu4bzL\nxCnmcwiYi03jErstj7tDE0VyUvtTON+I80VOH2pqz87mAF/A+ggFvuANzWtX\nYbDJoGL0V9+3AvhoLvdAbGtdgliFQLdJV943f8DV2mArXLgb8PcLoqDg5hKy\nLi9MCqypjGyiQldkWXwyI+u/lWL5mpkWepQhMOP4P8Nk5q4vIPgyqoA1FjTF\nQxXQvhYKBDlaFl6wu1GnLtpf2Hjq7Cob9In3WXgG+RDB8qAPKYyFbJ4sgHhY\nZqpePoXDSUNd5+/ZkGBWKxw9LVWED0wqe+3W9yq1Bj1Iy43zzUvCSs3PpCig\n60cbSc9qs7JArnmpLi9lG+KP6tBq3IJpoNXEGRMEU/bA1idI1DoxBN9ygQ5j\nV3KzFJi4yUQ50TWK/BlW3zg2MCqKJfU2bAKDDAiZ3UipoKgbmnsTFNLgheSt\nedY8ooWNNDfwyFsLaTMPIUN4cSd+35okH498qGOaxXzq6mt4VybxIDlTNvpb\non1jjU3rwBZAbbEKKtStiFr3A0LzecdnsfNbyIFceXvJfHEifKuKjI+/2C8B\n87yS6vcYSSoV0OkE1eV5Mo8H4/InmGwHJI+TBD86mUGAxQs6HkYOw860j8du\nk7o4\r\n=n3xK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM6Ra2ox5k/aXGFhTfONP0aaKju5eLYsTG2T8RodIVmgIhAOxhDHDt0gQpxP3WhHN4P+KWzf4xnkLwXo/JytPjNM2K"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.3-20180802153303_1533224258517_0.768775475413614"},"_hasShrinkwrap":false},"0.19.3-20180802154222":{"name":"@atomist/automation-client","version":"0.19.3-20180802154222","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"1a2f2fc96c4e8c1515d92d6e7baa1bb1adf1ab29","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.3-20180802154222","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-k80uT94UQQXxSnAxEkkeIdA23/GE4qFMLDXFaO5Aa7/trW0rdRgxt3qujaMDmYZ+ZDu3nSrgztbmiT8bmyoFBA==","shasum":"d53b55bee9973db2ea2063e1908a1e592370c16c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.3-20180802154222.tgz","fileCount":788,"unpackedSize":3501508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYyd9CRA9TVsSAnZWagAAOu4QAJ+ZypIQTH3Fo+1LC+po\nSd2TlcF5kSsiIPBZYfuHhLhX+/fD05l8FILfFvMk8erx1R98kCsMnNQLEX+M\nLJvixYugukPSajZbbDUFFMIHEnfBUqLGQDzm7bdvgeVU34nAcQiP0pL/tdgt\n0XcHxZ/PCYuDW4h+nXC5GOwzijOQwBgB528E0Pto/tYsHc+lv//SOhX1Zv/q\nNwR1RQU+C2GxNxdKFThgnllHybaWDQsjxqbzYykrgmCXGjfPPPz7RZW+2+j5\nG19CpJnYw+aeZjSVHiZiepndg7Hh/i0ztSrKqqFO0zDATso51U70vgTErBXq\n6bjN7ZbXVRYPfQImypvyEMDrcXDI7ASItHLZzvr9yfrWSGV40Vr5O0WM4CUh\nGbKBFiQj4uTPX6mMZdt1j0yEcFRSbL2kg7YPtkhi9uDJIBMcKInSCzFaHMZ9\n5KNoW1Z98x9IwP2othQYpR3r2jDU9YYEDMswDCtqFPFbPe2E10p8fePfRdMw\nVRUtL0FBY79o86wzoP0NCa+gJCwTw/iCglW3MrgSvb9M8eVnURpdpOnrQGfu\nu1IASBuEOCeidu+vPEJMlkCfTZYps5erE0AZ6xuYudu86J9QGAUx8ZDi9AXf\nc+BnKf+E9SyXN4t1zxYQuHb9KMQTd+32LAWM6z6SUU6jSRJ0JyU/5y8h9SpO\n6xhV\r\n=2YTP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGsOL1lLwJ3yCYyQIeSOK9HmF3M3/e5gsQUm06g2g1C5AiEAmUkjnVhQAeBD8UDvs5hOEt+uqtypylrmoG89ma1Ju2Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.3-20180802154222_1533224828453_0.25202172008480384"},"_hasShrinkwrap":false},"0.19.3-20180802164929":{"name":"@atomist/automation-client","version":"0.19.3-20180802164929","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"23f924d2e89ce6419ca569b5fb27fd1576e15587","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.3-20180802164929","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NEcLmP5cidXvXw9539pw6ZjH9OIkEXN4xMrK8mlkwGxn6nFQxKGdjmSDcfk0J5iqaCrWzsR8iooDVZ9denhOlA==","shasum":"55fb29b1990f69b51d683a4c6b151a6c000f6732","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.3-20180802164929.tgz","fileCount":788,"unpackedSize":3501688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYzzWCRA9TVsSAnZWagAAsUEP/1TSvHDtQp7UvPBSE+fK\nfei+Q5AUTn3kdyLl7b9QxHyVXVLtZYoOvq5BevjvjW88xK0Grd65jqcPIZsx\nXCAaeZ1Krsy73J42PlHU+tcrXxXEYKe4N02qrysF3PF4faSoVOl14GlF2dyo\nRdg5CAyP9A0i4Ce5mxM3HeEK1xJXeJipxmAAK0AHoBoM/oVJsmeexl6PuI6t\ntdtG74r4CnFJD5Ta7vjBujZ90p3i6v82PEl0RWtbImkeSa2sZJ418VzTCr0M\niNwI047G7j4bpyjhM2v+in/wh6xGGZN3Sh68uGBaPVJ5Z0ngI19Wz+r5gTWD\neoI97TGbp2fXBZNbYc4yG5MaGANG83JqjpYKzdz5vVu/ACfW3COCu9YneIzy\nolU8kU599GV658STG30NVj43eRs1lDXd3944y5YqskMLxG/T0mrCkZpaCI1Y\nmOrHKMZ60R9jVvvXndPrzKEWSLt0V6VS6OZkmZE8MGJ2nyJEP3r1a83Lv5kg\ns0EoGgFq6UfcVf7UxtlaL2weqw9UndhXtaV0qPl5PBbREXvRjdwI5HTZk/sD\noFHYz1rNcNM3uRyvtaUR8vw9FPceVepF6sQcJTmI+2qirk+ZM5paIhD8Lgt6\n97udd3c2++hnlhmnIgwKfVrYScq2ssLVISp8EBWjaqufe09kd+IjchrOtTlP\nfQLO\r\n=Pamj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2k1jRXON+/hC6wrnpDrw0kFxLS84LmBCDEriEq9HC0wIhAJqszyCNEDRQuhQLNsBg35JUAW8Y7jFjhHLCrKUrX/Wf"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.3-20180802164929_1533230293633_0.8903621069082861"},"_hasShrinkwrap":false},"0.19.3":{"name":"@atomist/automation-client","version":"0.19.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"23f924d2e89ce6419ca569b5fb27fd1576e15587","_id":"@atomist/automation-client@0.19.3","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-E7cALqDWds7jeufbuP1UQ7cnCQVXLOuwVokmr60J7SyP7AjGhfccwxiLaGAqnZAIK3+n2lZ2G6Iy/AzCi3nAYA==","shasum":"b7fe20ee05a14fe598ab33816bdb29b8efec2ff5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.3.tgz","fileCount":788,"unpackedSize":3501673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYz84CRA9TVsSAnZWagAAao4P/iIZTws9KUKZlZVX7mGb\n4NozfgEJaiVFJxB/SfqSQOK83lXXjw4w1iPgXSLx1P/JokCOtbcBngiZGrRv\nKa794Hrw6L5HlCJ5scXCVoABBzGxqLZ9n/GjQJlPStksjhZxo26Cefk+Lk4I\ncspFUH75KaH8FNAoHU8nZ3M3Ca22spdsYH50sDoNn/HIDEUNmeERDvMr5wFG\nFPmsvPjyeNd09TMm6F+QDBV5JIJOJhr0TB6IQlCAN6bg9jmWqOt2sIyPxOKm\nLAjHt+VnCK0ODpkafAVEPMH7hS3BKyUnDbQOF+/QWRb5prf5RVqIEkCaN7YD\nCa7TGVAdSMqVZFLyrD2GEbsN2gtIZoTJ4GBUgJtxPKFLpRmfxmKhPgurQllp\nqUxO9D1jZ84nKLr2EHCYlWa8QehKftZjVGkqMP1rOWM8nBM2eKPZvu3u/fZl\n+XmfLndDjQb2sSoViYtMY8oQhI4wiDrIyLO5Wk7E+6DXTsuOMsHlE3MvrocU\nqU/dTFYmgNFfMsytFnUXMRxTwEFkZodhDl/khLmygiaQtRjxfgSZZL9jM7hR\nVpaIoPqiuQFFGULb/HPs/blOe/J+0gWdufb9snz9aO4cmv9CgIme/Nxeg0Vz\nuagGCTcJyvhZM9LIqfAxUl1vrx6Tq+fd8ZcDC0l5j7ngLKp6PcxCCsMEty6+\npQSA\r\n=RxMA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa1/wsu1vDlLJBWx8pFLehOl50jHSQa+W1Ax+w8inSMAIgHQAfKgQYmmMB7jW3M9Hh8PhRpTSS6y/fO0wzMxiCHRI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.3_1533230903772_0.15489365739418148"},"_hasShrinkwrap":false},"0.19.4-20180802172930":{"name":"@atomist/automation-client","version":"0.19.4-20180802172930","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"db847c44b547bae8f5721c032d2d36169af85cb7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.4-20180802172930","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8vp22HAVUZ1jpMEpWERMw6laNACyfGsuYGS35JbxaY0bb+Arzu546DQadqqQ4btrNCuipnulWAfuu5Q7tyYmgA==","shasum":"0e80756543676167ac7067bf23771eb350afd5e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.4-20180802172930.tgz","fileCount":788,"unpackedSize":3501787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY0CRCRA9TVsSAnZWagAAlvMQAJARaZ0J7ZITYbjFup9Y\ntmRKE03uCMaIVpoyuYCWX/GdvQHsUaA0EHXOA8GM6Er9YvGtoN89UqhJq6bV\nhyxrMR3Q4nGvR5VQ7e67rAYWl8dSK9UVuvVW2HaWr5xP/VJdchhduQNWLSP5\nCDVPro0oqbkokh334Q6iCwOETU2WCBb3wKYP3jOUnyrPz6zJA3eHiC6OJNCE\nJhXX3e3dC5QBnzhSaJqnrwbRH5s7qRURr1gIbRfb+V98/i6bn28GdWwOct79\nZ09fzLFG+EEVpUwzJGAmDVRa+QdAIkR0y41zvq+wfRnJDynguV8FXSsaSJew\nXipfNuN6HSJyJ8dWojBy7SzHosI54eZ8HBcipwrnkqNGIwea1CEuo0WDw9w5\nprEzZcAT8j3MDNRutQdZ3DcRfAlvjLcrjdflFKULk9eSDa3nraVsBp8sj+jf\nuKfZgecYtzh/WrHjPNlKLFaF1TLCDAYDwxh7tiT7bVIUkfX9fNX0Wzco7I9W\nYBZh+kneNyLPwwk5maptZ8RLphGfFLhklxn1BSGGsQQ84dpBTvHmdfIqPiT/\nPTAiB2x+HpYXjyxJ7oM71VXGCv1xb3lSdYp0xHsN4A8J1sGQVeKAFwrrbizD\n2G/3Z1OythpH6gzU66LAQgqQF24mHTG1WMGWZpnb7LhLK5XKjbBwP2eUqe3E\ngj+S\r\n=41bl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkska/44K9hdGyN0og6jARKLbf7TTyfjJPGW81LIgCFwIhAN7OmToPf4je+2Rq1vX3PbvDKLnZNEHpD0VaCE6/lMVx"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.4-20180802172930_1533231248583_0.7612492956691783"},"_hasShrinkwrap":false},"0.19.4-20180802183906":{"name":"@atomist/automation-client","version":"0.19.4-20180802183906","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"d0d2e490b46bf9e42f79641ae9e2ed7638bea297","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.4-20180802183906","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-F7EV4HZDfCt0bNmptPBkqt4FVt7cA+gkOY2oBcW/G97bH0/ROu4NXSPTMIW19C2RoplKYp5gAtY3l+Ns3p2Jsg==","shasum":"36326f3ac241776e78a004e851704437c69f1367","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.4-20180802183906.tgz","fileCount":788,"unpackedSize":5284644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY1DuCRA9TVsSAnZWagAAlskQAJJE9d32DYYrKcp7JQd6\nmYbxlZVjLlrEC1iJC/z74Fd4JDz3LwwC3pI1nZHN3szr8lUET5/2l/7se/6E\nUk7/zccIzqlpcRLoPzsPCNQmRYhq+INc4pt7DAOJPTKYKpPSh/8pA8UpIE9M\nVjaVfEZcndWeVl2fp6k04DSJ6oKM64IeIN4lQBHQYYOH30UubcbQ+XiG2Chy\n18yAhQea/jospo0sX9uF/SbYuinsE9AlXPMVKHZc846nBKK6UVtjqcDrWRcY\nRtrzbGc94OsN7UCOwSZJuaOHrXIlvK6fOS1qqmLOU0ZERzhG9FnNW6sFC/ci\nKz+APWRl4PVGT0L0weP7AsVnBgStnhUGv7zO++SKHLfrj/TuEW188qoIT158\nkElwaoOq7ISS8l+eGqgpGO2FQsNa7rhVLywLBzfGOwH4WIiVqQ0AM96NXV6t\n2qqtpEsW5sm47HAd4Hz17KKS6bWhbVTZ2VzW2E1ZzQ3OiUOE8Uxytyks4ggk\nHRZ2mjqaOMItHbmuTYFi24TfQB9qB0WRvvPKvz8TBb7Ucc5RC+WvuXc9SmBO\nl+kUy+3fscq5S1rsoSV9AIpMtqUybkItffqtEsWEcppUrtjmxPT8Azo+akvF\n83elOy8FDR87gcPsKFk9WbA3yZ14bFuaOXnQWDl3TJj3CUmxFAn+HSS6a4yw\nx4uL\r\n=8THe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIETffrbUcW3MjVooP/x2JqpCK4s67QCy+Qi48uxEJOfoAiEA5TbjFxMHVHq2X6IGmv2MbRbfODC1ksHSl5LnRAIzSsk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.4-20180802183906_1533235438202_0.882620057212435"},"_hasShrinkwrap":false},"0.19.4-20180802195721":{"name":"@atomist/automation-client","version":"0.19.4-20180802195721","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"a7091a0427fb198bd6ad096ed29077223d675a6c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.4-20180802195721","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MHnCM/Y8oSKVVSQH87VR2dhRLsevtYCD6QN+YLGVV+T8Xn8QkYwdhwyEgUwgD9vIw48u4zEJ1u05xPPzp/aKxw==","shasum":"bbe42e3634c20bd7d3fb1582afd0ed592e8569b9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.4-20180802195721.tgz","fileCount":788,"unpackedSize":5285148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY2NKCRA9TVsSAnZWagAAqVMP/ji2BeLWdRFdWDyMKVB6\nd3gyp4zCkdlZnU+iAxx0uLYPJEkNN8XJiy5863+6E2khZyR5j+zj8Ref8pwt\nYq+4nsmCVeTv+EJRrm3rZMHr0DDpUIj2pxhkD/6CFgaWPf46XNh6xEKYknS+\ne3o4MA+btA14WO1qFCcjyoIOJFpB73TVbGmiqR982Q8SVABCXYAIErjaKPQr\nkbiG3DAp+EEUjrDST4ui0iyxr0tJSpZ43aS0AHPmoQP8ZYrnRX1Av1erZAuJ\nMGp2lB4b3+WTkPXCwwUtFUmui/5tgr4bl33vgrYdHLLtn80J5zkazLTB+MXZ\nOJMlaY80b8vtNUsmaXF82F9JuC7/g2Tpg7z6/sTqtb0bJCN1ukDVpM7BTsZo\nFp+pEFKI/etCymJKKBnA8XxZlwGSvs/i2DWZg4Qo6XJNFbrhxPi+SN1BGgC6\ng+D+UUpwpiVHkX68OEM7HJlGNWqaPSJnIvNH6pYFmKh+jiGqtY2I+3ZwcYSs\nEoyFdkkF6t5cHY+6K+8CO63T6mZmGKApPXNhrd46x0W1H2LoN9tsLn4LD13K\nV6dM3mnfmVwIfrm17hJfml7bk1DBjk52aF6eRhceORZtfsFpmcOHh0JQq1SF\nBT8PP/olZ33ViQcxkZYY0TxUVRdemI/tPn/ant/l4Fb5k50oHK7L5eDaMTcs\nto6C\r\n=pOqh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFWGXAEiKQTp+7FwfM8Qske+lKJUqF9fhOd1sFGKfReQIganWA+6Ko5fUCP+4LVXC3lzFjBA1Shzl2FqPlD2txZeg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.4-20180802195721_1533240137594_0.193415609979118"},"_hasShrinkwrap":false},"0.19.4":{"name":"@atomist/automation-client","version":"0.19.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"a7091a0427fb198bd6ad096ed29077223d675a6c","_id":"@atomist/automation-client@0.19.4","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-u+L4L6nSYEco5IN89pnSLn8xvdnSNLX2P46J4n5ASDzAAizx6cIgC1q4L310GTRyNRszckjlYoDCULH8ryt1lw==","shasum":"43508f3bb30815972e86717136aaa0cd37a45309","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.4.tgz","fileCount":788,"unpackedSize":5285133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY2PHCRA9TVsSAnZWagAALX8P/i2YC3zf8jO2zhKKcUR+\nUfTLMzazyBsuA59grhDAzvEmc3A9Dttn723ixdbm0EimdgVsdUpt9N22nzMJ\nwZ/XQ3uVCpyG843Cp3FSLkA6LJp/oHNt0AYTesX2AmyigSMBubch7Sxox4li\nrT9M5FOt+YF3ty0voUZKGkm1hhBiZmHGbcylEWDDbk+s1xnc9tbsRrxO/9vD\nhoGSkBC21p7vNqURcX3sWxa3Z8kYBCCO890gVjIeAALHHZ5vmFpDUHN+Bm3c\nUgxh7HWVeQ2ScSxQOxZQvPNUUKZ6vYaFKQf9kJgS7ni3+2y9LOibfCCBfv7H\nzEunhToRmyNyc7mo+1ErXYcQkAnquoQCGwWMzaB/NUrwRZfqkvECF4QiZU6Z\nB97a5jZtt1Ux4IXwEK4LkngUYZOaS8KtuFtm04H8fTH6WepHcSu642qPwIiE\ndZSCkLjVilyNZsmLuSnyJvbqyJfbAdVP880joyaRGYSqyAez2X6P++Ysc10N\nujpBnAOGJJc5flE95gyw3Mr9fFuUGddPZxSKzc/dimqM+BRQXxyAyYrEs68+\nJuvl5WyPaNOa0vpPYWF2RQWHJqGWh0fzHvt3Ofvg7xcpEcJYrgaJeG8eYXGo\nlFbj+q468ynCdGWlEpan0P3iODazvaumMIQJ5JG+Az91S4gbcQ34QLk3YHuu\nEPDs\r\n=fvk9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWo0UMy9NaGfMovlU2VuXqCejAuPb9tisIEg6yXrz5fQIhAP4rqTQxo2kwOICFmg0WVy5MmK/i87mF3dphOEiJ98vH"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.4_1533240263093_0.669296576487922"},"_hasShrinkwrap":false},"0.19.5-20180802200539":{"name":"@atomist/automation-client","version":"0.19.5-20180802200539","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"0455f99746caaaf93b4ad2152ec5b00a6f41eb27","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-20180802200539","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-his8DnsklS6X6gQkxlcQx1hPX1hW6a01z9+gq2KIWEphTdWX3zgKZS0hLRblJ2oddSB/oH65iPi1POq6SN3UXQ==","shasum":"b719c56181a231b6c10cef3e88aaa0778e46f60a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-20180802200539.tgz","fileCount":788,"unpackedSize":5285247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY2U5CRA9TVsSAnZWagAAZwIQAKPvpY82CNoI3lSV5wDT\nRVN5yjSP9PBfJJgSNWFKSPivd2akolFR4h4FY2S6/fgnvzOP2+e4vomEG74G\njm5GQre64hndusy15VVfBTACNNC8+Qgi7sQndzagDjwjrTn1/MZnEJAB/QP1\nTiNf9FaDRIT/Ns9IhQaKj991vU4JJdzh2+q1+tZQGD7Wk/JqGW/8Z32211RP\nVH9bPe9uJOBoH8NV+s+0ANTX9j09PipWDJ9KrPob+B1mAFzSMUpFEq3QXCO8\nT/2UKaunPiJKOHD6MitvG81lOBOjkh6vvH6Z03mrd28bDpgUhGd5Swcdwm5S\nsry9w+Uh7i1xIBNyPowVLj2bjdP0FnPUxv0fSvMOy8yhInMfsmWrdQWDVur7\nv+2c08Peh4/C6AB6rImCvapVpRjlEPLC6B2JvMzB7GZbYwm7mtJX6IPK5iZr\nM1qAMidZ544HpX+RD9PsLT2iAVtagIMqMAxzrtMFK4qelweBIo7bLmO1BxDw\n1T6ZrZ19xCSRBCwJvDryl84bxbr1E8cNFCZF+qYmshno/CHwN8dXCXVopeRO\n7IQdVqIpoN+iWTQZShFo+Zv9CVk2zi9gGTu/16SBSTkKSstdIN9B4xvSiW2t\naHnwMPI54nxP9D0xyrs/P0V6IBZMF9UHhS21rcKZKCDxAIeQSqa2oYWQyUE3\n760Q\r\n=5Pdp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC70tNuns9hYbpUFhGqitMp80xYZYjx+F6N0P1FhEDr/AiBCNkhzRx3CWzOWGlpTLIkXNcrtDhQAfEVo/CVlND//Qg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-20180802200539_1533240632470_0.7051829161537437"},"_hasShrinkwrap":false},"0.19.5-nortissej.editMode.20180803061052":{"name":"@atomist/automation-client","version":"0.19.5-nortissej.editMode.20180803061052","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"6b289bee57c5395039c916f740939f0d7410afad","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-nortissej.editMode.20180803061052","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-86omK7MsXtUsFQJnUCN1wC4MR19Zw8i/b0lRC+YwgaI/3aC5Wk2K4TnWXVgiBrq9kBLy06WSY6lOxGjkCVH4fw==","shasum":"f1dfb3918101334a49d698dc904f0234e6172939","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-nortissej.editMode.20180803061052.tgz","fileCount":788,"unpackedSize":5286365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY/LjCRA9TVsSAnZWagAAuVgP/08zldSttkDLCr7rqF5X\nsmXBT3CQDHqYSk04TMnn7T3UhNC1nNtjxfAKpHNgBbUyBhyuq1vUzjm0XleB\nuUAOUnMjhx68Q26wCe3jgyXJ3rcRbS8WGS3bkFosh+fR9Gp3dzpS/catmrzJ\n0/ph01ll888Tk1YNEgxSns1dp6cfrSFB5FTYzj4F9kqAL0qyN7CyJ7fBStOk\nQQwLnIO+bdRO4I66dRFlIEruR4rJmiasHrstOPSmdUoetuHB9hBgmWKUHmXZ\nhW4hbmwNBN9wGDNNv/cIg9EE9qS5w6xkuvNEyWM5omvJfjmIi0XlrlIzWXZ2\nGMevNI4mBRxA/0huq2w6Bcf7ToyLw0g3IPUdnozH3AXFzjPv8TIDPzVEjafz\ncpD/VMaiOaN4VpO+OPJsVTZ0aft3ayDFsMCFDHr81F6t3WfYtzyE3prVTjPT\nw3Y51+A6OZMgjCl7rMmNE+py2ZS2E/WwEIWu91ga+rCKLhJ/8hyGUz9d7A+3\ntQUxPrX/sBV0kMa9kyByu9gEm9byATjM8ANEvOiY4n1ykNmu3RmDMdFKgW0B\nBjqBVd6o/4lIB5KCH9ItP/Cobda5a+1PL/oFzGs7teXXn4etK1f+6rul5bW4\nsn3rFbu7v+81D5BVRY3qzRErK0Nk9tWC07dfqt+oG9H4074ONlmvdjZSPIO7\nF4bM\r\n=GTEg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXft1cxfS6jUrGkLTO4PksfPaDYrx8PlVTeNDQfu9g9QIgdHdXpvhMFpoMX0iyDRPveq8Xop31eSWaOntaxS/KbZ0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-nortissej.editMode.20180803061052_1533276899101_0.8650607595145856"},"_hasShrinkwrap":false},"0.19.5-nortissej.editMode.20180803062423":{"name":"@atomist/automation-client","version":"0.19.5-nortissej.editMode.20180803062423","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"3132a1e4e9d4f81f75d3788f0580010a4345f769","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-nortissej.editMode.20180803062423","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rZCDoNutGQautlwufJSmtJun9KmoEXcSW0UMmiiOFAR0BOug6W/QE4qpFnquEawl+1BKYP9Om3vD468o3bVVbg==","shasum":"64d43688790aca99d3f62e71b7b7e3b5b70d0644","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-nortissej.editMode.20180803062423.tgz","fileCount":788,"unpackedSize":5286596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbY/uuCRA9TVsSAnZWagAACGcP/3guH6Z0M1Ls3fCi7NVJ\nnP9scu4Pkbvv6TgTPCCXGia0kmI5INHfTp+npTz+GVDr8I5wPUwhTu4Wh0pJ\nK6Za/pIeDnbAvnZomaYb7UluVhAOgulATylHbldj1tbDJxzOR3aJWGZlgWai\ne//xF6NOJJLrt8KQzE8qTLKNvddQnlBOn+fhB6ftBQaCwXwDKseWHi64qdY6\npiJBYZCNfEXlqw/JhvqtJ0p8So7HsjdXPDbUFk11Pdl0EffqA85peL4KD9fN\nXQWOH/+MLuWa49Xe5wadXDVk65Z2kca3tbNZrZd8t2yzVw8V31oDXZy7IWGb\ngWc74D2bN4icFJiCWYq+g+mMwKiOBwiYz7dKRgeCx0L4ZAzZXSpO0wJBg29j\n3JZsPltvmt3bEYiMJ+3uXZVHxQrvuKBq8g1vZDFIELofa7q+NiXPL4Wu+ldk\nHXG5zpe1079Z2s83EXc4Dyly5ey1Oh6h9Nnj8U8hIMfHqMC0VDBcWVCzxnsJ\nkqnau/zRvcUrIlaAnzNnGj1hKbpXnd3bwFE3XL5LiMXTsd5Ni4/F9BslLcDF\nzmI0VHHpogwgsvSuE+ps9yO3xCLMExLxnWKsUvcNvZF2VOKu0wHV0DSmR9mM\nt8yyC9jxYg5kS0FoP7xmuvSw89sBfCFerM6Fb55TS4Ft61nI5KfSqtMdAuay\nTq3I\r\n=+llx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYp+jOifVuI83EVLk8+WX35Xtyrsrpdqa/IT2Q92B3nwIgRbUE7uyqcmeToRoRP5jPXqJyO+5pTFl3bYOZVq5W13A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-nortissej.editMode.20180803062423_1533279149867_0.9093156705234526"},"_hasShrinkwrap":false},"0.19.5-20180803133438":{"name":"@atomist/automation-client","version":"0.19.5-20180803133438","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"367975ed37885c7045da7648e992b7998c9425b1","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-20180803133438","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZANPdFByxVe7rDLUerZa/0Thbl5EmjUMtjL0bMTlMXGjBRTgBkZMR+0YbyD4JQ6V9693D3TlN8Cx4LXR/fqEWA==","shasum":"b6ab67245e9fc17f552b598797c09da221fa6eb4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-20180803133438.tgz","fileCount":788,"unpackedSize":5286123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZFsFCRA9TVsSAnZWagAAKUEP/151U+Icr14tmmQQHHVZ\nXRcbgqvy2AJxWcprida8dqYRN7ttXtuzNl4qXKTVvl+XAunI+4RKStMNhQ8v\nUMLUtUmlZIWdCrI0vmTgsAJqRJyEhgZsLWulxd/x9OnPvnDHhjISvRW/Mq+t\nRXSWe+kQR/Qj2c8wg08bbY4iWtrHevu9QlRiSk70SygsOmT7nJ0vO4me5VfH\nB9pfj4+H1Sr48VXriXIBJUrAgE3vbHteKAufloVCtgrLgi/SWnWv6YJ0dwRm\nHOnIyGCyuDdDeGV5XezfrwIg7duFxWf17BzwBrqwa1pl/i5IBAtu7DfUOryv\n75gSdsfUaEWF3+Uxh91pquY39rFNDCutxyzBPK6CIbPcrmfm7MNibsUx8VCL\nRfRyTqxLYgbRjbJ5KuOcrO7E9Y1pkX5+4ZAU+lHViUTwvf4nj7qo07/UVfzA\nraDot1Mbr++FZNmjgEf4TrNWqMI0aWblyXXFRPKBJU94pnHcBDaU3pW7FP2S\nI5CL7grh5Z7p2ZUyHspxwa92cZr+2yp+AWVCFv7eZla+IdppGF0vrhL1jsSm\nGkKgc25f9AGl6+ThefjsDaHajk2AAblSKICsw+YbXY6dX3S9UK6XcPqr2lVn\nLOSLNlLB+VpDh+qk4z8jzMicrvTgtITxJbVMFakvItfEGkCriFou/pt8UV4x\nhFqc\r\n=SgoS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICE3uaLRGZ303hMQE2QjOGWQya/jk2bih2KIllD1m0I7AiEAh1fTvITFAtlhVYubHFnnZXaD7F06my98Xgvz9RpK6aE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-20180803133438_1533303556794_0.1391903387900919"},"_hasShrinkwrap":false},"0.19.5-nortissej.report-editing-errors.20180803211622":{"name":"@atomist/automation-client","version":"0.19.5-nortissej.report-editing-errors.20180803211622","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"b4e43fb198687a85f4e53e19651472e58475758a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-nortissej.report-editing-errors.20180803211622","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Zhh4yr9DNeTJSNIWcCmU+2mLRittbNrnJHPJRYiLOJI0aocZGQYfp0bNt/kL6uhilEYoyvlegFcDcZBPiHQRjA==","shasum":"f24bb0404855ba5803c0ccfd9771d6b52c6f4e56","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-nortissej.report-editing-errors.20180803211622.tgz","fileCount":788,"unpackedSize":5286449,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZMc7CRA9TVsSAnZWagAAQ1EP/iA+Snjtt8N+cgryGbT9\nant9WnB69k7vcwgcUqh4XSi4958te0inhLy4z/LrkObV9xlifxXfyQTiFlRj\nLhGu6Ph4gkDC4wO2sJFqi6ZpsJuJdUjE5TK/LvM1TfExOzZ4zI6XHgvEoA3J\ndfGhJoVV9aXwXDkkzs2qa3TvR27B8mYH8i1bfIuvQR8ur/PsqVBgTLWcaHnq\nxtYnC2P73/lrR9B5bTCKky0qJiQrpjFqDa15pz8CVQKVUM8jN1BhdcrYy1Me\nHz7kjvpHydrSHjrc3alzptxIMM6r1vainVEwLjQPeKZybOgrcgWyBQJscLOt\nIduYw8joFPKcVAh8w/BVP3f8e2mvKAX5q+luKL6B5uKbDiQ7n8Yh47xxOeU2\nqTQ3hQDmV1M6G/rcphcj68RE9odOAiLIXfoqo3Dep4nMqlhTnXx+UxcNz6z3\nibHf3gQiZPtR/jmZPXNohLQK2jddqzPpv+07fMKQ3sXgww08kWINz+VFfYIS\n+2OrVJ2N4xiELGtJRAPbyJDFbYINyKi6xgcx8R7eReInZYFLiXjQbL9TkvZR\nDzMwxeY5QFnLEhQEtPDAtXXpkYlJ7+j5ba2frtlP+p0Up4Ux30h3EnUVR8Gk\nMKV2GSGVwHnzDKmIt1VFuFC5a3frkemS7LH0aNHGCAli8yBfTu+U5RYpBPhU\nzaGz\r\n=cUFH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFMGpU4LTBgnbjVjdBFTIpxrfTaHjetYMEjiWp751YLQIgXcHNpTxZN8ebOtkIHgCwsWeITgja4sKabp7/j9j7qS4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-nortissej.report-editing-errors.20180803211622_1533331258973_0.30135128316799875"},"_hasShrinkwrap":false},"0.19.5-nortissej.report-editing-errors.20180803213716":{"name":"@atomist/automation-client","version":"0.19.5-nortissej.report-editing-errors.20180803213716","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"03fb55cdbbc8086087c2fe11433ec032cb8ff5f1","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-nortissej.report-editing-errors.20180803213716","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BMRczzTxsYRQ2Hp3y3xO5KRwxMrdSauKps9lD6CW3yX8SD3qsM0FgIdm7YGtLR57P3GJ4H0Q1Vx+dIKrIKMqUQ==","shasum":"9d2f7835e84acfaed3fe87ac8dd0d682915c88b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-nortissej.report-editing-errors.20180803213716.tgz","fileCount":788,"unpackedSize":5286638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZMwXCRA9TVsSAnZWagAALLIP+QCiiYyA0Yk8sxKodLNH\nnUre+EMzMr0uCisAe3AxTA75FYediP+diIGPL7d/jRyUIcIdvCUS+iVRDXC8\nqDBOQoRojuUMtsKXd6X9JrYVUjlDruFQWuPzdHc4aBOrwOfgIYhz8nzcLN/8\nuUqfA7K2RZu/uECnw41q8NToHtnw4mF3GyLGMM7O2VJ3xXwLTffd5E6zWu1J\nLmoI0t0StdzUJAyP/0CRnHwO053KDatuXLSqV84i70OfusF/2ZnS/SCJHpGO\nHssef+wzZaHYjsYATN65PXA3LBJ++9I+dTNTh+MMhs3lpsUihzfRlVP0iGht\nXES9XB/JXXkgs0nRyavwjmjn0P0jH2cbIald2nzIKQX+t22veCSqbNlmts02\nk5xdF2ia6FasYfqhZf2HUxKcAxfLGPlUobg3P6bfVFAHFc/9/cAsKHkWNkt8\nj3Rx/M9epc/lXcd31Jx5SWpwvHMeZthWImOjNLwxeUEUjWtmEO4u06thy94R\nqltFBdHJ8NPxsFyPWu+fxIuPgKP9GBERPUU5oF2dta/NbNfa7943ltBIkWN2\ndD5xmcukqJt8F02QOtOMMTC7+sPDnZ2LrWVIKjAUsdjHnKRz0lqinbYy+QwZ\n/c/EcxenYvRON2k09V9vQeO5c9Jeo8eqCLJEqgjTOuvX5mh4Auhc1r/VbDyA\nwI2+\r\n=IgeR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwn+Bf753g40b54Xk0VT8a4e8OU/ydxvE2zFu7IPbRZAiA5dzp73mCt+txaTM7SUd8XT/4sMaiqIfZmlDjd8lBXLg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-nortissej.report-editing-errors.20180803213716_1533332502600_0.16437273145142695"},"_hasShrinkwrap":false},"0.19.5-20180803222129":{"name":"@atomist/automation-client","version":"0.19.5-20180803222129","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"4ba224b17223481c1dcd250676adafe913f2971e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-20180803222129","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3EWVjLAH5SuJ3SQSr6D0S/Ei8CZrt8/1NKD5dGrydBzgJ7HNRkJJVu2UzGyy16SxKHA6uarmVdvLREKKT9bxyA==","shasum":"ac98a8fd648486e2762826f06494d8e053827903","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-20180803222129.tgz","fileCount":788,"unpackedSize":5287453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZNaJCRA9TVsSAnZWagAA+PAQAI7zUJ/uUZIpzRPIGUgl\nRNNbG/sscB7XCMDIKP3O/TY3BJmMK1k41CfNKOpD6e3cbI9KRcjZMJXIFGdp\nkVtop/nLd045WD4tAIm7G+mN5yfa/uiqJWtcK+9gDezrCEyoFvniAROrj7DX\nOHIJ8M4CeDXBwJKFHSys/CjhsRrtkpwg9JbVH8/fjF2l7SLIPbZFFOIf/Tam\nLPp9xWKZyzY2SUh59A0IqKxumj/V+h173DTLxh6iuuyP1MuFna5JCrgM2PjZ\n6PQHDN7NbrHFHGR6mTF+JGxtiCHfFrbrYPrEfRvdOXKLD4CIKr4Oo7m5Jwbm\nq7vdBiWAwnTs6F1mCvwDO80SjXvJLV9DUSS8qaL9zqU51KHovoHic40Y+l/W\nmJQ1AO4tz/BAqRZFRtxjiAHrpZG6Malu8BJyxxCGm1wsFvWMWzjoxCJgEco6\na0t9HZ7LuVY9nKNAD/M+LRUWJ+p4ttyk06AiqbEqPv89UVBH/U1Z/IsXUAUL\nyWlM8P9tUXG5ZZJQcyMw1G/SCFFbPWDZ6J2DkRJyqeksxSz4ySmBFtUYOCbE\n37o/tHjeFRAkx9mvxt2NPqoQ8xl3ITMg5YsOQ1xT60VTCTYrpHYWyX43LFJP\ncqbkutP0tPtTt9e6t+SnHPm4p8Qgrd4SBuQrSP3PkQ+4JXt5CnqtPlxB7p1k\nKmSp\r\n=vR8w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXFPqXNI9fB/Li6/G7DMBANbZP1BVKqbDtUY1hCagDDAIhAJoLprb70L42oEcQTn9rDAM1X0PoavkX4D0bItaKs0Mn"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-20180803222129_1533335176378_0.11393945671044481"},"_hasShrinkwrap":false},"0.19.5-20180807011450":{"name":"@atomist/automation-client","version":"0.19.5-20180807011450","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"824f9bac2fa183d313444379d6bd7414317d2e64","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.5-20180807011450","_npmVersion":"6.0.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7YLfMimLgt9Js05fjEqv5+MYupfLwXE1F5Z/an3xnNyAd0OviIVv73CgAMXKCXAfaXbB7JCFqmq0jce495OHAA==","shasum":"cea8f8606c36c2d4d748b62b23400db573253ce5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5-20180807011450.tgz","fileCount":788,"unpackedSize":5287333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaPOOCRA9TVsSAnZWagAAn3oP/2q0THyJC+UXeVoXo1u0\nNf9Oyz9Kfve9IxG50Lpab2Q9iM8xMdsXSiVFcMazNTNEMdN29QqrszjpuE6Z\nvs6ZoxESGrPfI3E1IZuGsGYKpS7AL/ygKpsmFLu3oNokq59N5PxBiNlAV774\np356lOPChAGz/Ka5apmPz+RL9vmbNKcf0TGrrCzzDCGcVt6IbPsiupNIO9j3\nYBSnVbZZBmi/PL8VdyhZvb/Q6PYUx0O9IvJp9W6+tq8bDPVExLWtAT78LLlo\n3HiKStPfBA0jaCMhcuoDtgusD4EZx4jAbTlBpoJStjcLff+ofpAeqFfcAsa6\nm4WDjyZMBR9TOPKf3nVgEdRoIDVliWzN6pcrsx1hlpYWQmdQJ42NzW4MBPgg\nngjEmkZPb7MHmRqyStrgsZbVoB1FrHecp0Yrex2FMC1xnPAkDk16QRRA6UvT\npXvmLv67vqLtTt5tnfelcuA3XzIoDuz1HZ19rkUG6InvPO1bJzAffKwvYT2h\np/uKWstLtIbjeX8zNQ2Ipbw4D0WLDKr1xnIuLLkZe99EDDFHxQTDeUBh9iy9\nndgF2cr9SEhZyY8ejtdcEBl6X370LV0o5iTyVybduCBOXQmGo/evGnXS2h+G\nahoLoUJ2mxMuUMIHc7MKSvT8TAySE/2qCd+rdK8DiI4pspWhvFYpHWz/+dhD\n2mYV\r\n=J+qH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDBLCKDK7gALjpG7WXXAIU05xwHtaNXJESO1VMJ9KINAiEA3WhNzQZR1Vt/5/RVmrMJshBoxGK4/SrsJpiepmHJkis="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5-20180807011450_1533604749565_0.15876648354290568"},"_hasShrinkwrap":false},"0.19.5":{"name":"@atomist/automation-client","version":"0.19.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"824f9bac2fa183d313444379d6bd7414317d2e64","_id":"@atomist/automation-client@0.19.5","_npmVersion":"6.0.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bf0vGN+Ccin7rPXfg0/bIy5g4rWP9/THJulLy6a3pCL9BQomCDEWp7UcEnzgMHSojFSAnW7Uj6qFwOiE3QWV9Q==","shasum":"3180683c6be95054f0bd94e85231974afcff7106","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.5.tgz","fileCount":788,"unpackedSize":5287318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaRRTCRA9TVsSAnZWagAAOY8QAJCBWiFOaVrmhcWsPbaY\nSq0yiI4j7DUE1gF4co/ioq8V8WIEyRTFc1avB8GLrh7SbKNvohyRzkhFG48y\nX3dRVashgWoXTrhkY7fkkPxaW04xjuIt7FICqIEx+wmGj2PVyg5wNhIQEXwX\nNAs5MY6wl0jQkcb63xLtSxnoPmSqJtQQ9mTKLXTFkry3Yc6LHaT1GlSoVTMy\nADYO2rbzTzwoDDTmG1cO+Lldr41qjnS4PC0W7+8XA5NFa+7XuR5sQRk/CoHB\n79mnGfjYpBTif3bal4MXjK/f4wCB0l1AdqV0sH2TlFkVp7EidUuo8yl5fw4I\nEBm3lSCU3NIihlDCWf5O8YYLTTmSN9eLq9i6setMqModJjVLGkvaSdVQdWZO\nKxlUK/k15NcFX1XgXxhm0UsxVfV5/Rk1Z80QJcKyL/fHSVbFZjCwGscjutD5\nOaItRlhOqMA4HITsxU8CQSuulHv6ejdDhSNxfkoTt8VE/pzR8hQreVXG9xf+\nm6zVCVjWVfhwOCZ8FTllCYnTDFYUYug4qGRB+34TBJ9B67xg8eSrlQT19Chx\nWQi0aUXPWHYo4eB7bMVHmRVGuFGRYUQ8Rhzij1Nv3gkwQPmPiC5h/M80+2KC\n3tz5WlBA9XukwhmrnNEXl7HobPmRai+0OLnwwAub/SIynNIZAZaxrMAgdzp6\nrl9E\r\n=o1YO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBktGigroNjbx+RP5MNmFvsn1uYXJbrebljeQpKwkVVkAiEAmMB+Iaz18nKkUSUGLQzMD/7AVUaB9imvEM9wmHHolek="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.5_1533613138569_0.5206336414600916"},"_hasShrinkwrap":false},"0.19.6-20180807034215":{"name":"@atomist/automation-client","version":"0.19.6-20180807034215","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"64d6fa9e0b9a9a6ceae4026f22e912d90e25659c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.6-20180807034215","_npmVersion":"6.0.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4la/tzcNcxXN6FSF2DwwRLHX4AuGmVkBrdrpQZiuuZHTVWQP2P5ohN1NlTvxv5ONsZZQK/0eE2vMuLKvJSm0Mg==","shasum":"2fbf2fc48d13a3b39a843dd092f1b94fee7feb70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.6-20180807034215.tgz","fileCount":788,"unpackedSize":5287333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaRYfCRA9TVsSAnZWagAAVHQP/jkHgyHYC/mIGbaxTF38\nClrhEA945q69k3EEVPQLwA926TB1jZIx47Cyy1w/UkrRC5Vz75Do3VSIxJ0g\niECSjQ44nKrPBQwcNN7d7ZC8YpzNBE5rnXO4tcswf1ohSWU71iBzdyriHzed\nXVgCu0QfPrgD7cBhDnOEU1rAwOrp7/neNw5tuRmpL/JMLHijPCPV5eeZAz5Z\njNu0ym85v1F0IJ6z9Hlbdgaa59TIJkrWnieP7kR9kozJydqN/+Ftpp8dLI+t\nEY37BSGAoJEUrLr725M9x/U7O/pmmMJ3f1311BQvfIWeZap5xqGraYS6wew3\n6A7SNrocXdKlivClilSjmekzHtouOK41UVUbfhJ7A3lLaYnQpRA+mxb67b4b\nWwyEGaQm9BKz9j1r/FC5iK5qKwYVU5yIzJ25YFe19k78YG1+HzMMoOwVyPae\nyNaRL5p9FwjjM5WaFRsC0/+EAYSjhTAfU5Acksh7vPDstJDhhOzaQz3I0Huc\nybQrnjYIB+cfQzJ+hjD5dieuosxkYCJvfPtGEIrH21gRhu7grh45yHNA+e01\n5kUn9FxWFIGLbL5NW++MkZU9AdqH5Wdtpg6t0NwhZgPbBgFj98sxLJxyJeBs\n13akNpnzisnHfKo7q7VnyefKamPAOQwfEj/F5Y14OClcehW05hLejqGlbZPZ\nMoyU\r\n=pz9/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICrvq+/I4oOutL/eO3GVEXJo12+i8/1drC+Z8hRB+FJbAiEAhkdhyMMWRTeGZbk1a+ElhJzynY01HIXr01ea8eCfCl8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.6-20180807034215_1533613598969_0.2386348987430249"},"_hasShrinkwrap":false},"0.19.6-20180807113642":{"name":"@atomist/automation-client","version":"0.19.6-20180807113642","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"https://r.atomist.com/SkY2_gHYkm","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":"9.x.x","npm":"6.x.x"},"gitHead":"c66fb6668e4f144030af1ee09402e7e4e1dd7f10","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.6-20180807113642","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Onu9gnZKv5O/OLgV5auNm7IZsA3qZzVDKoSldwG0w4Jv3hKWjhlflvjLDNz7l6f1jvOXlXA6DJeETICe7VTejQ==","shasum":"b35ed01601f3ffd21023d28fce6a920bb1e31624","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.6-20180807113642.tgz","fileCount":788,"unpackedSize":5287509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaYWOCRA9TVsSAnZWagAAGq8P/jj9LKSsNgcMRNLVOfxr\n3TnsiLlpUp1lhPyFjDU9k/+HPB4fsBQ/4jglZ2PoNulFNnyUga99ldFT6baa\nC2miyR2mbzwM0VCnQUgNwaZLcw2ECjxxGij+AGED8eb2EtzfMLIt1LWyb4FW\nmHhgKmBEPJufh7ccp9MD9U19E2WNx1/NWKoCee20VZWYnokXAt+07Qz3jGCz\n1NFymVLnd2dmNQVjKJJnzwRw99IZYtTFUN/Olf2iIeIZEWqvpJJGJASqw0vS\nYPe9UbMpKC/CzQyRL9RbNCcBifPwrWi/RGM9SuNji5NqfB33S2C13YsSn/0H\nHmdpd1ifa1sQKU8AdauLNzcen4seRJR1XVwKkO5SSwTQT/DGKR+j++qxLgti\nHDIjN7xh+wmfWFqmMd2R6VcHTju+PmoRjPmdbtCyxgo0mClqJ1oqQcT4Zb5U\nFx1Bs8zJ1mQAKnqSTDLDV6TUW44lCO87C9FLqfHBxbZ+Z6IP82x7fy1k/RMb\nvJz8w/yBNR8R3cfnKKZs0b70O2fJ4Wtmo/O5bKFsgqlAD+DQMr7L+KzbdTsR\nBBxD2P1B6dU2rXsK1T2xrJbW6msVelZfMPSz8S/4M3c+FNju4q8c22lO+65o\ndV9Mi84NpHfLVMs+YggOSuJERoq08wcFKZFvR9wn8cb3M9GV/r9QaB9X26ZO\n8iX9\r\n=Wb9d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWD8tkK66zcBVFFBHSsePbTy+tM4WNUme1ciqRyDBx1wIgFOZvfNeHzhgdUmKTYwgTRoJtYvyUk5WwoClxcNjf+/g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.6-20180807113642_1533642126130_0.09484061886989181"},"_hasShrinkwrap":false},"0.19.6-20180807212037":{"name":"@atomist/automation-client","version":"0.19.6-20180807212037","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"363ca6216a75d7cac31f94bd9554986e5650d9e0","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.6-20180807212037","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1+zdgmYbjhcEVKXGCWHlH5kqYd7hh9pfEvqe5moRQOHeEoSKR3YnIPUubGP6KuRlsmttHxEGiEOvyhL5JvcMaQ==","shasum":"fddebd6ef3f6611e9d9bc0c0a2c43e21a5227a3e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.6-20180807212037.tgz","fileCount":788,"unpackedSize":5287472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbag49CRA9TVsSAnZWagAA5WsQAJdH7tqQdmDdUA89A3k9\nhdT6Hu1IJI7h09HfP2ciZCx39jEmkUfjusyTlU1vzJR6xHg/VIhhfV+RYe6U\nThIR24oFL3C3qIneVO58ru2TjSxo0W1DeknqcZqw5+gLKF6SlFYbtF0o7Uoh\nC+NyszugeqIVZmo2ELYGDxgyCH8gzp6bbyuLRMQigTP8ewgrWSQwsEQ/Rvqj\nJcKM/MWQipvyaY3IzvHkhRAYRPxwVpW4S16dFMcbfntEd/Ao38TNolxMvwvL\ndJ4tvFpt5hVtNKegDWKGEYiXFm0OwbnNV2XeMkeMBJ2/iwynJQh3MYnpA8eA\nGlzKYNN+94d58fEdnc20Cz9EH0GW9sx7WlN3GQ2vfRECs8y1kNykKP0RSsGg\nDFL/anqEN0vhA2coZnW/In3FkQjZcEdwLtqGvMx9P07dcQAyK6blHxrSOyeP\nQ9iiLRcfnYyQWMkm1P/eTCh/4l6uBKWicTl2OGzMuQQVBkbdRRrfrLQ+exrF\nWgnj1VJhKqc9lq3/YcElLCy+FI5NYhA9WEEudQTZlJ2PI02IN4KKxp8+AAz8\n50oTg/E4J5AzmLAm2l+bfjo+9Isn8YxFBfu4klL4viaF46pUZ8Ihl2Z5IGQG\nsCvg0J9ucAojN9cP3HpB3VRfJQod/8ABEwyqCY3MUCljGolE6CxexerNruvL\nnXk5\r\n=d7eu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWmv/YXYc5/b7cT2eNNoZLlkI47QoLV6T7LM6EjqUZ8AiEAizekMSR3MGTWzSKBhI5HXScd1e7qLnRKtbNf/cu26Sg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.6-20180807212037_1533677116841_0.29178422432154094"},"_hasShrinkwrap":false},"0.19.6":{"name":"@atomist/automation-client","version":"0.19.6","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"363ca6216a75d7cac31f94bd9554986e5650d9e0","_id":"@atomist/automation-client@0.19.6","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MAIapixCNg+L+b969zpLzHom/apjYjujd/uM2ney03k5fGuysEw3RI5aajlh+PQKqlHA9ediEwsBbPfGkFA/nA==","shasum":"28c7dee11a7b0f79c90ad425733e6a22c07aff6a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.6.tgz","fileCount":788,"unpackedSize":5287457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbag7KCRA9TVsSAnZWagAADM0P/2Sd/0CyEkiCjJlF/jQA\nKSyVaYQHA9AWyMF/ledtApo9/0WP1ilB3SizTy/K2nLEZjHGop2onejgACGp\nxklz4E1Oem/ULyr0sR2iO6VqwcU45xH4k1Z838Jy1FYzJ0kan5YEUS43Mvd1\ng0j3Kj35K6LO+fTFUnbYGDWiWpfhZ5LKMmuq3vt66YHD22FFYakxhHhCNbXS\ncTmyj58ECf0oviAXq5hxbab9vpleQdfiiEy27SCqiBCmIRf8A3n4mf0T13+H\ndJ3brLi3vsscfanG2UCvpLialljhoeSA32IkeB/Y0Qqu857u42m+VcFUQdke\nlzYhzSzDQ2ufMG6bUp40ZLWKOontUg1zFmNxTxVm2l9dQgPzVZxVduCh6A4N\nu5lBjYCG2b+syEX1ZtYuxXvHTGQsVy9GILO7qiFPkXRDuBHAOfHYvC5XTUZx\nmzst3iJsD+AlpJAuqhCMze67fAPlP74ET/mo7JlK1Dkx49h7/NM4Bn20W4VQ\nPxmpItjJvzBFgMXdm29txbWAMRRMYj9K3vienRxca3c3sHzAFQJybPQBBRVS\nHQKBq1rUp/6jE1mG7ssQHe4zqVcwCM/Ek9mHXiYhgoo4BF7YSEoJe1ECJ/2N\ndvMYrdDRFXGGglUoW+7leucTdWqgRC07h2cU/QAUBSCiL2WLNBrwBLtSz7GV\nggei\r\n=Nl6r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDj77FBe4QG3EWaNWClGELOWFKwLcYkJMexv/vbKjiAvgIgVClm5HeLIJ5rw2UWBk7Yb3hxSdHMT3jNyOBuFuecTYw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.6_1533677258355_0.3482930159981794"},"_hasShrinkwrap":false},"0.19.7-20180807212849":{"name":"@atomist/automation-client","version":"0.19.7-20180807212849","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3f2cd263988cf330a863d3189f39e63cbe2cf485","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-20180807212849","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eV4utVyNYHK/5S/xph7BHLJxlsd6yLzddARv/MqKvqFCvm7bMO64N8mlINaqmImj68JxwXyA4g+T9tznbvxe7Q==","shasum":"2cdcee977ccdf66d5265bc0a172f414be82eba20","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-20180807212849.tgz","fileCount":788,"unpackedSize":5287571,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbahA+CRA9TVsSAnZWagAApeEP/2kN/OYskY1+K43+QHqI\nizLIZQtPgcJnziBSr6iOUpO0ET5rY8ZidK944/vWRLWUxbLkWAtKh4PT1pnV\nli80hKVsjZqAhN8V490rHOGkcFwKmYYJj9hq1ts0fWQoeflwY6YZUKXdwhRe\nUE/D+I2fuAIQ9rLcjye1A0VSoJBqbHBD1p8Cuf9PN+Hpr7h8Lnqm4+dMBd4M\nusrhoNsAJG2WIz5CkhjNSxasm/h0ggo/j6jLjE1IwD+MZlAMV4otw2c6CBMB\nhvmrjYbjoqUBQdFp0CI3u5vubJA5fMP5Ei/J+PlxBaomZOCe47U2NPCLxpoq\nPH4pFt03/EPjEvKQw+c5CZ5fN8PHGFrr6ez7vFbqn/6EFHciN+2Lguk1ZPW7\nXoIoQV3VyL8FrzzQmTxlGu2Nuw72bntEefl1UF2ik3R3adYFPO6o3urH70ut\nha9UyUd8HvMidVsTLibtAFxQb0dO57QRLh8f3zWmhLSQ8m+Vgwl/cGp1BWnm\n+nibu7GpB2aRl+V3H161D1dTmG0BStHIFqoG2J/ZR32wSY4YScslPRJnVz8u\nWasL2IONLeK3LolqZbBlm7h3/19aQL9q10nsWiXpoq5CemJRwhNx/mDi7cPB\nNyZcWT1804UogmhvPtZg2XdMXStd0xesz9JBOkC3okhUhuxCFz6cr1qj+vmb\nuC6C\r\n=t1WZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPgm/aNOaq+5ZsT6nzBncxcv887RhbUBSWkgIaYqwi+AIhAIiXE7oqKu7fcR1jyDz/YRBZPMRPXLjmrkSAWfqqfJyR"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-20180807212849_1533677630419_0.7239162362714653"},"_hasShrinkwrap":false},"0.19.7-operation-name.20180808063209":{"name":"@atomist/automation-client","version":"0.19.7-operation-name.20180808063209","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"6d1a5b4d689631a61a1ebe706a2e8822070df53f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-operation-name.20180808063209","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EUPWtiU5eq9fl4wF8mVQUcGJMmp02ishmqao918++3+R+1eDXR9OU656cfxbcSlWAxLN2LJNKRu3Z1pYwLeBQQ==","shasum":"8dff91f6c7d0d8399e32481375f9e28794c58f50","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-operation-name.20180808063209.tgz","fileCount":788,"unpackedSize":5291592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbao+eCRA9TVsSAnZWagAAZ7UP/R6GZ30GZy4OdMhuzB7u\nTgyOIitJsGubmFd/XO3cRrlvC1q5sDFzuZzOuEXUDjaGSOwSQ/Xn38lgkF6i\nB90vFVCLGWC6rRqJHQJQfl7Q7HBzPviBF1Wv24dq/FYMQ+eT7d1o0D1EQFMG\nNoIzjkRDyQ8su9GyGwU1bRrpadJI0SWXevwdIElZqTzsgzuc1sDcIRgJgz6U\nMRtwyYRtCjIgML+PBeawuiS3G1Cywqezv90BFAC0QyHeHe7mD3iHVeAdiChQ\nfxVGSXIQZqKiZtrTTnPcyfFQpY6G0BMnjIAafKAGHcY47t4dShbv/WUFXog9\nI3cpxydlMFaInC6ki3a6691MsnVQR1VgkByuZsvJrPnawFujfYmT8IbFIl6z\nb0FBIRhgT1CX0RWewEI+8HQW1qYeM8FVwTb+0ZbNExq6ZgbAX8uk8lUg1etF\ndStFmejLIoiA+1XVOdRKJ1x1yTWpZ/P2la9Boga5K+DwWtaIZeektqulyiqT\n2+J/uVoqrXhK3+sWiEylL/G2WasRR0RU0CAF/V80xF/465/HgsxUGKnjIorb\nyikgzz61HEk7WcdMYGYLU0UYkrJShhi7vC0EReApKDBjFc7YdH/RbO3IihhV\n6pDlkG9MxV4zgyZQHptqp/qXIMm5EYtjPjKTPUjc0PTNmUoMjXfurmslr+ra\nAEdy\r\n=BkYa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKt17ZaKN+s4KSXi8JDt8BkayM41AP7V+O/beYfX9P1wIhANxw5BOH8m4f4ZYqfOZGb0ZqKAqDPe24vEMD10kxMile"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-operation-name.20180808063209_1533710231303_0.7232465818836025"},"_hasShrinkwrap":false},"0.19.7-operation-name.20180808063643":{"name":"@atomist/automation-client","version":"0.19.7-operation-name.20180808063643","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3e4dd1d057be9deae307436c3c358c2ab0fa931f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-operation-name.20180808063643","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XpAaf8YqrOS2eN2ajnIHchY715t63IUaifY599IU6qoRNvqnsnsQq/BaT/LtMUDZLg6o4b9bPGWwH28JefFweQ==","shasum":"126411ffab9e4991be205f97977236be0009e400","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-operation-name.20180808063643.tgz","fileCount":788,"unpackedSize":5291764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbapDLCRA9TVsSAnZWagAAP1gP/3FpaX4X+QDtdDMEMF3h\n2md1HcNwCxrqBnUxm2YZagkxADY/ixpos0F0IAqgAoj81BRpa3czU9LdfeFc\nztI8f8FOYcYiVxxIdnEgH3s6fGTqKvnuBBdy4DGo+NUeVbm6AaWCJOdlMuN6\nU0I0d+iiR6o8kcYq6ytOY0nwJCI95fHwnBpkrBJTrxcijRcQ6dYwoo3oLslv\nwefvbZ0VXg4zJRVCVUwPM0Mvon3INYQii3wrq4fG9H7CESMEQcQE+PaZwMuX\noflAnISk1Ibs3z/649x7EmGz5AWWUbescEku+FXogeID5TiSOLyeGX40Z/c8\nI62WeGK8p+8ki8g2Hm/XFBCJA61+8AU14sf04I701o7wF34cFXhqI0iWDgt6\nc5nvI9t3yQnURCn1JJX6Lt2LCktcjs8+HSTJqGhP3agCWenhVSW13eUDyjWv\nLSv2IOftwhLFNYa+MctQ8XI/htQG+975TbFZMz4tRX9I4V9dhe7tkrWdp0JV\nMdUZNfV5epVHsDlPJl+FKgnbM8fxNknqHAn9AVd0YOOqc2KIUzFEzOn0GKIO\n9yGCcwx63YBseSxsoksMNfZ3KR61+Dx9T1R2MHzVg5WuPO3iWn/8Kt7wsh24\nMaHb76H5lXuzUH+yx66T1lArCrFz6WfqwXdq+EO0stGxxYitrkHSEFbsUfRq\nsbEQ\r\n=S44K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCS30dc7d9jByfWvMHiWcetdNDhZP6JEh/lz7Px4SnZ2AIhAMVQCV4IO82DYyjnTj188N/X7LwPX0WmXgUamQx0xI6+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-operation-name.20180808063643_1533710538938_0.040374158742618294"},"_hasShrinkwrap":false},"0.19.7-operation-name.20180808063931":{"name":"@atomist/automation-client","version":"0.19.7-operation-name.20180808063931","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"cdd071dd63f875ebe733518c50b6f7196f72c78c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-operation-name.20180808063931","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-00py5t0Pur1CRj93pSbe7CB2lihWcvJD5a1GbeiaDISm41S1VxMCRnDfFIuBNueHAYQnbce1e61FzqbNEseaQQ==","shasum":"5ec36db6ec578ae1a120b70bd2130796deadcb67","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-operation-name.20180808063931.tgz","fileCount":788,"unpackedSize":5291592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbapFfCRA9TVsSAnZWagAALcIP/i+Fgi7dbdMpJUMRq+K5\nad8b4UjpplQwdIOBrQUfODBFdWpYe4JyRcxRjQHJt7lto3fM3I0v91rGx2Bj\n4e58Sbif3gBbYBSNCvR8XabdatP3/pvwc75vdMwcxwb/u2DgzfJteMO6gLWn\nmJOyQPAD5YPoedPe0w+LN2afMUCv9MRvWcrncBwxJjmX91I9JesQ+p5jyLz6\npUl5x27WD5//UrxIS+Q0X+svVEqUA/zu4JwNexkhbJhRAuxXClUbsqJvvlcR\nQBeruY6gKSzB3nyxeBQvi4i3hKrCuv/Q1kT/iC8A1o4Xsa63cPfI/+xTw0cd\n3bY+FHbdtNoQXs5U2clYvnl2Ps4FKollIUXssHdgD7Nm51JArG91Dvs/aCfU\nAdt9vFfVH3faJWMlbfAzJqCWvsEx3py5InqsaQw4Iiz2W1HruLUiLl+ebMah\nyoX2zfczRnODP5NrG4D26KNR3qjrsl0x6z0mpfDfFLm1/JESP10QCCOsFKop\n1aMhoSvLdrFV8vvq6qwOnc2IwGbIcAG1+bpLFnFsTxtgn1A6/hW/CO4KN43z\nkUReRxJF0l6QGuHlbVREjZzH/5+WhLJKq2HpSxV1vgMjPz3P/0gj8GjFlko3\n6w1RclHfm9jcbH9FKs9Zd+xfsgAd/tAzN5a/Oj2law+fr43L7XXvTh37U1Gv\n9ui6\r\n=0eR9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqz+V2YEwjD1d+JvE9T7pTmA/8To+kPUJb72EA/gYa+wIgbI1nzEnADn+z25JSZt+LFVw6nI1KHNDra6/avj+5a3E="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-operation-name.20180808063931_1533710686944_0.6860670273557647"},"_hasShrinkwrap":false},"0.19.7-operation-name.20180808070417":{"name":"@atomist/automation-client","version":"0.19.7-operation-name.20180808070417","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1b5f4b758497fc8a0ee10a7f2f6fe0b075619e92","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-operation-name.20180808070417","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uIazFT4NW0SzSZMAkHbDmFWaOmEYbEqF6BrEX3VpWkrt9Yw8UUaxzICzVjrr2pNOcWE0mAQ65PwJNTKV8EO+IQ==","shasum":"8f002dcef8fc45dda55575a8dc4edfcd255db1e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-operation-name.20180808070417.tgz","fileCount":788,"unpackedSize":5291592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbapcPCRA9TVsSAnZWagAAZqkQAJrNck3CL2nL+Pb8TT/Z\nLWxsRFm+GZ34KbTdAzPifK+5AN3jwZJLtI5+WYBqqMMjQRDKb3JPpm+YdPYm\nW0V4A+ZDIVUPRknmDb+XacqOSEJBjAuXd/0OJsrER5k33n1q9bs6CSx+lWvU\nTz1Qn8COKGbvqFYYnMX7NjAOYv6/m4HMhAQCuXztZAPUfNdDGsmkPgPycEaa\nXIXQgFJKwh1Y+Wp+3X35yeUaTXBNTY6WCIrkKc0PFFlYgxOTP80FOE4gybVi\nBHEgAe++3I+sY7qOoXd94Vbb/vSoO3RYmGSUSTMLUERVYPJzarwt3YU+xl3R\nhZF5+XOcnxlmrl5XX6l07JPx+lrpnTVpTQbcoNUffZQecwpTKxvZmnDRFc0f\nj8C1Je6S4KJmfLRKvCl8bwfuuqxJ2/3UmQSnLOQZmotCdRWaFif5McsLU3rP\n1Vb+cjplJVRy1S05n4m5O1Bdlqavshinab9nHD+iTL06SkLHE9yAa6eh+2Y8\nPWd3nsT3hb71NFWh4dpxiXoY1ki23btsR7RnlaD+9PP3uHx7uAGyJketDY8L\ngcMVZttA41EioRbxOmIFqvExVtv+MKpfwKOJF3pwBAYvGPavA+uoXqtIOrNn\nep94BOu2u3JHW/teoG6J99DdXM3oC6NyLjariJrkz8pL4ITIRui2V5F9/tg+\nQvrO\r\n=KQUO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFe+cKYkEn92Ow6Y1aSX6eIXnsiiauZLlAd0ok6zTbkzAiEA4sX0I7duQ/NU57ipZfCla+9SaIT0aRFasXTZ49ASvv8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-operation-name.20180808070417_1533712143269_0.05655580520858172"},"_hasShrinkwrap":false},"0.19.7-operation-name.20180808164635":{"name":"@atomist/automation-client","version":"0.19.7-operation-name.20180808164635","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f280198dd1351093b260189ed3c6ed07a0408b47","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-operation-name.20180808164635","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NzVu1gEsWe1V+8gjv6bnF7TF7d8bx0LP04BjXbacjt+vTH+QQ8R2SmKKzQoIwDDWFDYhOsO3H/EIaReWcGDLig==","shasum":"72c4b958ca0fa0c004823ef94d254e2b9d4dacb4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-operation-name.20180808164635.tgz","fileCount":788,"unpackedSize":5291651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbax+FCRA9TVsSAnZWagAA1TwP/0EDnvs0MrAMBtahcgD0\nX6eEVDRjkfwLbnRpk3SBKM2v9Ge9pPT7mfCXfDzfIiA69TeijKXBcmuoKSZ8\nWiA32sgemfnJ+zXe9H7mUWCPluG8foxOP9B6QMpOAI5UW7YUayPBGWEAFXF3\nEFVl/zkpWE0rBgqWCre30tReHACPTvzMQc38fBz4+jkHXboomnaaQTDHtULK\no2AXwDWykvpO2owCTbYW+n34wv5odc5+PkNXV28y+ZrOH202wHzopfJnMf47\n5stX2umaFdTsjyCzbqku6jkWPDtF4wuE5K/aB/AKGCWhEXyiU7Iia74TCTvE\nz1kdYvpKIoZzJU4UmbSmaJRgRqdkeE8akn+rJTFAjuC3Nhi7Q0a6vXFFi4bJ\nZPerIclRfT2QDaLuNBr+nKzW+r7lrZp+gDClSBllPys2rZge1zH99BzNgKNH\nY2oqcgIC1gwMQmL+F7s7aPslWzJnWdzo8U07ZDsjIqsXBB3IC/AUy52NPobN\nIKnoCSqKZ1UZWX9a01W5P1oK50B2QDqJ2Am/pjXzfpACjlM6ZnKjsHiPu7h4\ndg5ahkjzzScyQZ4mXoeAybou9Y3xsLjyf8ZZgZsA9rlLVLdrXXn6WpgbMxf/\n7oklveyAoj8syGU25LHsajwkiNBRsxUpepaw0ngGNSHOAZ9+14Ncz8U/dwFt\nfoKG\r\n=+xzF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFcuCaX274pLIp/jCoX3OCT44TuKXqWHmXvNASniAam7AiEAyVsT0LyHkAJuejYoZ63I7QjbCmEMTg/UFs6LWZC2kfA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-operation-name.20180808164635_1533747077420_0.7911319362111859"},"_hasShrinkwrap":false},"0.19.7-20180809140531":{"name":"@atomist/automation-client","version":"0.19.7-20180809140531","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"92447cf5b54ad2f6006f258d3649a87dc79c78e7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-20180809140531","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9I/uqktQyi5C71/bmAAytgOXY/z+GHS3WJyFNAfN/7a8+EJN2A3Vivg6UPGg8CCnGgfo8ZXDWdRcNbMmiX9JLA==","shasum":"7f782170e1027ea153d8040dbf6518c56ad7b590","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-20180809140531.tgz","fileCount":788,"unpackedSize":5288861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbEtDCRA9TVsSAnZWagAARPYP/RwInRxrv3iaULATb9GQ\nUEiU3HJRooWqoR2+YVdZwsrqciQAlcm5mM3HxgfDRNgA0fU6+FjQ9SpkeJ02\n0RgfILhPx2le8lycIOM/Od9Imxmfdwyz6GdQfEClohJy05IHBjrXzdnFLP3K\nsog+fVUExLF9vT9XMsE5T2odKe1cjohuLkejDEFgMHOpfZG71z9/fFCfGz0i\nSHGIhfWHs1DTh2ibZKCAabMSWUWidOMp52XBoE1eP0vXFWbuZHVyw+1zj/Ta\nJ8+KvIeCHStm6Xc4nvPay3IUN57pFPCKDC7L7IMhzAZGAo/vbdFhR/CL0rzq\n6XQf9Vk/RYjaOYPz+/8TkmagYhJyQGcTcDJLNNZivcPS+TYjqKAMLZPUJLkP\nt877jpbO9mjZR14n0qCD7k74LXvDR1XyDq75+B4V1n8kydtrlfw0gm5/WsGP\nfeTvhHEiaz1lJ87IR9iYdXgbwU6gPIv1EJ+VHNyh+IrG58UiJjDMaUlTdxKc\nRv0jkBaPovjTKCLLgVVGfTwV15/IP8lOLZ40ALLCiRacCe44+kQGFUMGx+uT\nTlkt5rZ8yE7ypDXC4whBQStwFQlr9v/aNh5/yIUMz4OtSDgKKYm0xs5xr/L9\n67+lcz9H8MxA20Y8GT1nxxFQVj5GJ2mMv2OmMcJWZwsypmKrbgrcsEViEAAR\nTpIh\r\n=iL5Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFut5MN+lEWzS/9HKRILKo69Mq2GdmgMNdqxUjbZVBGuAiEAiVPT+ee/+V+M+Rt2PBIjGzfWvSy9Cv1mQ2nmaKSTb1Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-20180809140531_1533823810510_0.44242347845776364"},"_hasShrinkwrap":false},"0.19.7-20180809141155":{"name":"@atomist/automation-client","version":"0.19.7-20180809141155","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"00407e33844e30d706d7959ce474c719dcc43ea1","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.7-20180809141155","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sku9ZDU2HyZjK1Fo7apqPi8CINuEpMXnIMqhmM5vMlwBPdDAnvxXAinDWwWCYf2VLTyisHUFyxEeJnWxnNlwVA==","shasum":"3f1e603d664cd83046d3acb6c4318ba92e9b84b9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7-20180809141155.tgz","fileCount":788,"unpackedSize":5292926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbEz2CRA9TVsSAnZWagAAHjUP/jvgNdSm1A3OsEjo2JuX\ngGWCkTTLh5zaqx3ncg4SJwws9bbAd8m5128i9SMdUpDS7wxcbrpwDMgXS9+m\n0epFXz1YAn4u44VZmBuSxkxh77UVUskMR8jnlpXMJudUhwOaltH0IqXbgILo\nLB+zDFlELrUkyIZEXVWwti00nLxJE7ke1DRxZ0DYYEf9sYddxT9iO5e5jWYB\nAtThhWaQqv9RutLB6bB7IcFpHODqE8zCZ7+pGH5bset53m9Tc8Idq2L8GSYL\nmtUHrBrl2UqUeRmxhTuFZJTDjkUP9lSHPKyO3N2/EFnNVNXpqY81hedOPbci\nt7ElIIBtkiXSfcYPaXvwfTCMkAOK+dsVpyiiiY1sXBZKg9809BUhURpLnsSy\n7Jsa7zfSwomAD/YI6CoPUghjjuQ6g9/wl0uqZJNMdV0mK8miWbGPcyUWVQOi\nVWV6BkxIRywv4MLfsY5tQtInpjeWQNu5cMNUaqQWkQy0x+kk+ldBQ1Zow/js\nQ4hmgjClJaZPsFgHqwQB6Mjo+L1MivIA2F54dvDXueWwN/ZIyYw4sHD9QA87\nXWuxmk8cwF+7y7ZICUgGGR3hjwSnXQA4KZJdL2dfsOoabDgwe6xq7ZF96ZNq\nlZLl+4IqK1mCodknWuzJB+C2ZrkmSAcMLWV2apJJc2EisrxrMJ1EXXBZ1HaR\n9YX8\r\n=2Jmd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyGE1wOD6r9HbEJohidA3aYLHhg4IOgDPchR3F6cQOugIgaaEKiEmgpol1Q6iACySId8WoDy/cfIsaE8Axb5hvt7g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7-20180809141155_1533824246442_0.5577176015532301"},"_hasShrinkwrap":false},"0.19.7":{"name":"@atomist/automation-client","version":"0.19.7","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"00407e33844e30d706d7959ce474c719dcc43ea1","_id":"@atomist/automation-client@0.19.7","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CZ99VeVZU4h1B9YYY1WHD/xDXoXbGxmsnp5AifaOvgJX/t64ipINhpbSZZQtflDUyuL4UXSsdwHT6kLEXMjwIQ==","shasum":"919307f26d64ca6159a5274dc162e4852706c460","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.7.tgz","fileCount":788,"unpackedSize":5292911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbE3ACRA9TVsSAnZWagAAXuMP/R+pHFJoGe3FTqM9tMYJ\nqoQdeh0zXTYJHJ2TTkohUPwB/24mX/4lo06AZkX0xcEFtHDUBzAIwcK5pnf3\nQXKUtpsGPv9TsSAU0hO8SA19+ZohF5cqxVXIZqqLRYfTCepBqpq9b9+j5D93\nuzv3Y9aEcWMFZBBKD62T/7fi9YaW+1v4AD2eJIG9MZBwH2UzCEhGoIte2w1Y\nfCwTr//KI1lfaiAYa8cOHIWC0VTkzlnEXKScOghioCPjElVJpbqNopJgymH5\n+/K2Dqn5oDmSy9lTE+q2WlfhkgTtyUfMNF2oWwUQJsB/QwDnKK/jnYuFDpJy\ncnwuCsP2oTFJrRbwhrcwj6IJ7+2TPzXFvCOoxEdmWW/CbHbgk11qa94aVLlb\nkcKAd+N8qj1evXDwL+QLDM+PofGWSNsUq8qolZiGaml1ud1hqV5Llz8NSDjp\nRdwj1sKYkKBX9S2wnaD3rFLdksQm62Q2B8SfRj/N5yQ0cL6tK+/3Ykh1RiSM\n31O21sQRGdGuO2JfOLr/7fnJui3FQdJ8NWtQHe+tjEB+5EK0f4RuIjIIRfmK\nEhe/V5zgyoRBppwTNU9mB/yrCoUNGGvBBxmtSNxj81uVecVvimW0Dex4Lekg\nM4i6zyowKOpScU10jpfRluOs8Enc5DV0NCGsOcE+744Poow32cysDT/m3LjS\nM51G\r\n=dwa2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHh7B3YLqL8JnJXji/TscMKfdhJOHJIcmywTk7wou6dQIgLipYjlonTyIowYRspsvqel6eXluxWaqhkVreyce8vhw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.7_1533824447806_0.4014873263376"},"_hasShrinkwrap":false},"0.19.8-20180809142157":{"name":"@atomist/automation-client","version":"0.19.8-20180809142157","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"802b2858aca7be91f94f4e9718f3747b76fe3036","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.19.8-20180809142157","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4E0yg0Ri6Rc4sj3qgK8Hf2WKcws2qHrkQsJJU3u8v1d+lAF7jStFv8K2z1CkHZQd/arzybPjqiXBxogvgTNP0Q==","shasum":"a10644ec8d4eaaf759da3844f2f1b886547a6bae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.19.8-20180809142157.tgz","fileCount":788,"unpackedSize":5293194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbE80CRA9TVsSAnZWagAAIVcP/1E0/+prKpQLCrcojvgy\nTYU8/0M8mk2u9eo7ujcuS0TeN/MhOPV1qjFsRrb7Oz9xuew9x1qWIfcvEoD3\nh8jObTOjST4VCPW0C03VTyvg/TWhIYROY2jXbGnMJG36oi42+d1Pny8c2OYX\nbtmYIAk2ShcRc3aQMELmKBk43QAI3KhVWTrr8Gs1olCdk57u1pDbe2xxHWg8\nX6Va0oB32H9KavOU3fN0lB+WHx1WdHC1tFixXH+nxLFIOGLeYhsVuWsGcY13\nv4y/xDdcnyDG74GYSlp1I+Qgb6HRkLTJBWIjdga6zN6uNMQQVVqDIXyClQo8\nSsZs9oVc2gr+GZxEj7aM9VFiVoPYIL7Pe+QzOthi1q/YYts/Zb2karfgoBFf\nUpCZUssr1i5tDPxx9ThC1gP9MjIS7rljqCIgskkvMaQrXHFbYG3Enrk44qcL\nRrIx+CmMzEAQuwrV48GDfCtIZqVbeo7KDSDyktGreG4okiPnKRq4Jw7GKsGu\nh2vyfc646n91tqrr3nhrsfus/Pa9vKQn+ZRMVkK7FOWOayC4hiBOEQqLbwd1\n1Tat0iq+OD82BbGIiR8Di9CqqNRVo1/RUDskoAiBZjw9uhmxtGc9fD6r+OUC\npCh5nPxD2QdzOADYuPEkTW1irMsDV3FT70e3pHD8iOTKCa4lyCae4SkuNTUk\n2xE+\r\n=Dj+c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCArTeoZhpb1aPJHs6HEojoVgWYfuhXlwW71+ZOuayBhgIhAPMpXhGE7gXMiI+wITU4aSVP5pvIE9iqtUpIWeiPoY+E"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.19.8-20180809142157_1533824819562_0.23648098764724335"},"_hasShrinkwrap":false},"0.20.0-20180809142545":{"name":"@atomist/automation-client","version":"0.20.0-20180809142545","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"dbf59b56c1e117c9054878c953bed7559d37b09f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.0-20180809142545","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qNiFlakAkU0p4KY6Yt/hMyr0hn6S9t54nwaqAHFN2+IeW1g+9p85Ekqrtnlu53ywZKYXPCOHsN1Z32lIhQU1vA==","shasum":"a55f162243e255c48d589aa773b01a6e67443215","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.0-20180809142545.tgz","fileCount":788,"unpackedSize":5293194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbFAQCRA9TVsSAnZWagAALIsP/RZmiD62H0NGVfLISMa0\n3DtAWlUYmIJPkZhGqH4OukdpsUTeqdt8fRacZ4ojqC5EnRF0GPl/nevEz6H9\nucrdEPNCjGtKTykD1LSqOFo9AoC+PG5Kjf07t7N3CvKwX3x+URQ6dMdVKHaM\nIvBXVVB41vPgLk8GfrhDq2h2/1aaAOYncp+JlT+saIXXUsbo9ATGwa72n29d\nOV0Vsli2H/eiwr2Cg3SFp0xm7je2zQikyaFXJqyHIe2EX6f7BT+8Oyc0KEEq\njr2MSTXBaMIMGrG25uaBL8/d5/t2gp/MjH+h4pXv9IiFJx4Pq+k6xi8l9j3K\ncm/cuAqClcmnTkhR+BVfn4ARDA8RglkmFP3huU8w60TzMK9VtH2+2uVISyNX\neEi7LDjpRXS8q25pMBptdwatVQ9ABebopAxLAL6NCoZVrH3QBd3SIi2tJoNJ\nJ/UMVVp1uvhjjZHAqAswNoJGtOcSJAy2obVpoIB5C3Pn8EbIjqNODG12P2ue\nGSoYP0hl7B11lQ5bAt7RgYvMy+UHRsFkvMfFnBF5sUGaJg6P3KjFUqKQL1VT\n7j5ve8kMWKiMRmZA7UX65Fi7RaFZohYUrzreLACH3t0eey7Esw4uIVOMHxN4\niJpiDv2QuN6CXLvgO52ZCcZjtWfgxvQoYaTLe95SEDYNdjEgERZXQAHiI/qE\n0+u5\r\n=6z04\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0s5g43Flo9aLiq9W936Da7jUnF2KZwSDpoGJ0DPB5XAIhAO92NgYjEDlMLx1hTIa/IX9I6U/wl0Rxs5tx+0fWvAwL"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.0-20180809142545_1533825039899_0.8705960928511385"},"_hasShrinkwrap":false},"0.20.0-20180809143213":{"name":"@atomist/automation-client","version":"0.20.0-20180809143213","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"86eebf2bd9b7e05e3fde7ec83c6411168e6a7bb4","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.0-20180809143213","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-07tqShcrzrr6gUuPRNS0Tu3qMod87YslpcS1nIwf6idgeTaktameSyC8T6RcrIyj8BfjfhStcf0k8GmIKGLF2w==","shasum":"9ae6e8784d8e0cc1cfbb6a797d43579f4d0d1736","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.0-20180809143213.tgz","fileCount":788,"unpackedSize":5293194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbFGYCRA9TVsSAnZWagAAZm8P/jro9Sxz4X3k+xtQY6Kv\nbLYlbNf+rW9wTY3OhYmomYQvm7iVAjTmsxFtZOn/uWIyiNgFRDuIivANwPXp\ng6A1WgWOL/8W4UpMUOuwQc2DUnORffo6pjUVEj52B/uiXkTynO+z3hRnAAgP\ng5yJ3msmsy3i7CfgdpCYS66qG4h9C/8qFoKOwKWuUIayjtvTQsum27dgonoB\nX4PEfBHt7odhRH9dQj8E/BOtiRbj9R8NHl6b/uCOgTSLlkAp1CgB0PrgNs0P\nAmSqG2IjZBCkWoQheGuY+UPqcdx6+0EnIvPTc6zBDBnbQKWJ/37Y8psSqb6l\n+yzuGK6BlYcwhkP6WZJ6PgYRHEQNtfclfPiGtt6PFqlAyM3l6iCUtjJHdFer\ny3S6nGgLPNk6nf5LUu7t5lQf+n6PFXMF2YdiuNiFZUclj9njvmT7I/mA/4iL\nWtrHBkLm6kK1GmuEBcn5ML3bdsb68MrHxU45KcvnsNYFqw+3898GPLplknu3\nZ0YkbFHbtVeKWW1wN1ahcA7/gzhulhCTPkgbd6J96Pr2Gf79FRo5OOHsS26G\nT7bCFHqCDxZ97HQh5FIj1YfwMrar/u9BkYXFkl9JOtrdUvJfmJSy8wikN8/+\n3B4drU/6HO4ATBjsyz+/7CWW+qldDDjad+9+gXnOsIo9L255DQ6FlNhk+P0W\nJ/Ko\r\n=I42/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDw5HCZj9BJ07UfRGFbaqvGqOwsHSIBuWxKT76LDBbPCgIgf+We5uqG+JwiGJkKoM/uWgOsutYw/8ip4dpSiXUvfr8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.0-20180809143213_1533825431528_0.6921169171823967"},"_hasShrinkwrap":false},"0.20.0-20180809201011":{"name":"@atomist/automation-client","version":"0.20.0-20180809201011","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e7edfaedde7cc8bda792b011e94e5bfe8cfd8200","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.0-20180809201011","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-o7u/BKNC+Vbfx2UEuQwb4QY+kM8H5bABRN0Yd+F90pBAv0RKrKE0/QsP4s+cNjoG37Az7W9N19oDXaaDljB+tQ==","shasum":"92c8b8f8a557394f2df395c160ffd8e60a59fa08","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.0-20180809201011.tgz","fileCount":788,"unpackedSize":5293341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbKDsCRA9TVsSAnZWagAAl4kP/3f3BOHX5UF0tWD6b34Z\nsr5Rr8xGK6/UqsSRNKh46QbEU9UpVQPah+v238uNgG1h9OA7fsvbvBQMPDc8\n4yLgyN1OXNsuYV0YwDvNnkrHtRpf5s0i0DCawCQ2zu/NdRKqPqyEgzo2Gq4j\nx05YB1qm2DWR/aCljdfRWDbq7tH12mfTfGtVcJZs6VzgHtEncpMamrPPK5LX\nOOdMUkZSSh0eGWhY/wHHM/o0dPeHI5WaKGaYhlMGkVk3AgctXpXBRSKIId+4\nlcBX3zLZTP/yW03m/S5OT0QMAqc3JbLGdQ+WJa0DtqaPWAHQ4J0e38RtsTub\n2sIJ5e6xEs3FGLS6IO1TddN+PAtf9Q195LXuzzhJO4PYqP+Oh3+cRAKZ3CAc\nuyw+Q+iiS/5oiETIeRARBAqSvselfJKQF+JfdkVPfGYcOSF37sC7RPE1FjMz\nhsEGhrzF5DC7EYNDQ0JtZcETWJvz0yWVmPZ31jTRiZUJnsWQU3HS4KgV5e4l\nq3ZGRx9w6svP0pr14uYSXNzBbjo/i5M6oPDOgOjHDuCrPlqweFKGcZ8fWXHf\n5Wt5RQajtEY24Qv0CGZIcUASYxS3/e59vkdtOpmGJbYe3xfzkAw6N+QPtHwv\ndZLzTpvXphpGv7XXnfdF72rnu2Mvn3SquAoEW0p1Ly6+rByjputDhpY9pHnb\nwCQa\r\n=C6PH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjEtoVoj9iL8+uwmgCvf2DG6BbTjlOsgwzNrE+FOPtAAiEA7D1cVkfKPf8L1alVl62IUzNPFrF8pMqW/lgk9bCB7K8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.0-20180809201011_1533845740299_0.5017545232827585"},"_hasShrinkwrap":false},"0.20.0":{"name":"@atomist/automation-client","version":"0.20.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e7edfaedde7cc8bda792b011e94e5bfe8cfd8200","_id":"@atomist/automation-client@0.20.0","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QSro3kSNy+s7crDVUx3diV2vQP4YLvK0snqiOrIekH72pWRuwyhKF77ggWv/0gYCv/cKHVByqvjViLgII1/UCQ==","shasum":"462ca05d0395842a7303fe5a0a04199970dfe0b1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.0.tgz","fileCount":788,"unpackedSize":5293326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbKERCRA9TVsSAnZWagAAb44QAIxCazjwvryGG5CpPND8\n1gBIb0i6vCUuXxtl7XFKnsqQe4T7IkLO9pCOcojfNE1rDhh4jZ5hUyiru50A\nTIhbi4E/6eGakUF0Ay0XlXLmepYoiAKW50wYjbIuNtP8yPOG3EDboBaDfAb9\ndITF8+7AG0seAO+4/N1z7EiV4eKDMtCKWYrQtiKZ4JZoX1TVD16VxvxtR8CZ\nZft7Hf+x5mvJ1EbnOuTT54dI+3F0nRfGrQDFPXTkZPz1Z3xQshPF5LI+v8U1\n6VUL0bkUXwj+2oR3VPKDqEXQIrWSLu0p52OueUUhPM2CYx4jrOa0SxqQyQ2b\nZHqDK7EzdcGABid1GM31f49kw0+psK0rARe8yPRD2bfTS7gmtHa+ebf7gBCH\nYdYSQkqRNlpFJ1ysbnxjAjk20fBBwXpmZUR5jIGw7FkXvnmg2j72Q8sHQxCp\nRruxy5ir8MFgeQKpN+quO8ty8Uxk436KzJq5detRoJCjbSbiR46+OydUM+9s\nhcjOHMG8ylDyEAJRHsJDje0q44r1jqs6UKjfvBGagYmSdRB6v5igIL5Bfi7e\nHNIdxDNkeu+xa/vxeSXoNZBf0J552gKRMHUsS9DQA6qC6gbWTm0T3w7SaOil\ngSlURN84jvEAy6jY3bwYLpMtqBT2meTTUA3HrnCLv78WlQ0Qvy46sBvoJM/P\nESdd\r\n=d4ZS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMV9qChg+AiXy6xGPpCtaUOgXnoTsnZowNXh6Yx4txbgIgYkR+7mJiMgck56Fs1fpBvw3Agr5bJwmahgwVj5P7iz0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.0_1533845776468_0.6976217567219427"},"_hasShrinkwrap":false},"0.20.1-20180809201733":{"name":"@atomist/automation-client","version":"0.20.1-20180809201733","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"81dcb2dd0a725ceec3aa5f2958c26f5ff71ed0f2","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.1-20180809201733","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5kslT07VlFnd0iHAWxupmXDnrI5x5UDP1jY6TRW8TtvccTbG+kJEcezRm+G6j3aaNISjRat8FYwBN/LIfZZiPA==","shasum":"11770836a883139aab489786a430edffb7498d2f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1-20180809201733.tgz","fileCount":788,"unpackedSize":5293440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbKKcCRA9TVsSAnZWagAAAVEP/3UZRNHDi6nzeHPuHlfT\nUz2Z4e3V3Xo5TY8x+vE6zkAqgnepsaT1UJghYXIlG8bK5tYgrQ5H/BChWfnl\nRt4y3JrJKZ5FTdBi+miUY2X8YbeuUZdNHjuoTju3wTSLidN5RE5HS8DOTfxn\n2qmlMXATZwXi/4K5ul+Ukt+rzMIm02WcCUqB7CPJNyi54vrNfxL0eAigc1W1\nKtGZ07zCItpEUnLNDFNUoaTarnFhwj0hCNVXZRVgS0ZGLW9KwEPC8cxJycEY\nT5l1QrZWM3kT8/VojnJyK1GxjZOI4QlwT00wE4DCFAlsx7h167vEyyavYcRK\nlK2w+aQ/kjiraMV/WLViabZ3Ovkg93jY8RbxNf3eVSVbBcG0RFu+JPKBDmeT\nDB9VnKpcgqUSS6bNL9jsWJvp9QzmJ8i5kzPCJZh43AnIfpyG5Kszejx2dHrd\ncNNvYbYhYCp8EJUR8BSo4Kl7e/rVoon2f9G6BFcgZzaY745YTzTxvyW8DSeE\nEgKF3QQGy6eYER9hiD/C/U2mOaRYVahiXkdBncQBHdApCZUjrcNJ+5A7bK4e\nnHwvHNsRJspaWc5E/C6m+cdSfJMDoy+ZVgSCHgIQV7B8TNZHT3SDUYWdHvTt\njIM8l5nSzkVhmmoEHxxlOLoVI03zRCFPbErbH0IqVAH9C4uxntmFgpEOTOrl\nRCii\r\n=myXe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBO8SxjooF/g+fdWtqd1Kp0RCYFopqATWF7OiNoHuyM9AiBQzhvfxlPtZ1djDh1Aw81z6FI0pKt+FaaQIEKGYTD04Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1-20180809201733_1533846171716_0.5021613369124549"},"_hasShrinkwrap":false},"0.20.1-20180810085422":{"name":"@atomist/automation-client","version":"0.20.1-20180810085422","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3e96ea462ed215a9a0956a05df8c2de01d512ec5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.1-20180810085422","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4nq4LRQbBj9WoCr7eqBV71XtFIvH9KrYUsssmIsGBxCKmtwA/C8PQQFQBngGidai+ScjPbc1bVF49g4fa3TR1A==","shasum":"a9f786542c4cd2e18547be7e80318c8e91656b70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1-20180810085422.tgz","fileCount":788,"unpackedSize":5293440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbVPkCRA9TVsSAnZWagAAaV0P/2UbN1F7Q0ODUUEKnqPJ\nWm5OkX0yLbm+AyGeXaVw0pletTtEPgBjzwOm0AHkP9HdvqgmEJpf7utuofAX\noBvaVhzRLZy7gOlO5hOKpWMJCy7HL4vQZhE3nicpHaqX2xE32luQUOjgOvK0\nW1VZ3vQ0bjfloldwBP90ToG6M7S++N2gu0zdctTakzPV5bOF70qjhcQbYvwQ\nTB34DRIhfUqSheY3iUNiJ2Zq0UsPwQ4ewO0Rx2rxRIkjDE6o9vps+oyqbljM\nGUHn4J6wegX2GRoX+5aO2B7UBmcN4XXoGBYPfzgi4VQ30+OlFcqF9lXckimo\nMsQk3xs6AQ3us6ZVQKll0XGkCDEiTGi2cLnjxZi19TUguQBF27Qfj0XRKNZ/\ncrzLgySyBarN3rusaHBMEnsB8R6UaZOtiQDljES+EE0UOJpsbKoGRzR0x0JX\nNARdDJP/UxyXaVgov3tt3aMEvIvI1ZYSX9uF8I62c+yO6dXhL33QxmIDgZOX\n2f73qjVz/YEdl5CjrriPdl7saj9NtFVw9Pc503RD6EnUOwvycUYtUa3MFNiX\nzL0ygqD5VWj99fmbuAICyl9YIhmhd43aH5cU7PgVFdD9iz8kOu/RXlbsLLz1\nAWP/aqgb24AEcaemGt69QzIqXBI7YaTN1JfMeAEk5MHLH2ZhA/Ne0sMps8EX\nWwBQ\r\n=jKc6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFaoiUBGU2isWW5jre/PE/XXjtWCDiAYHhMrul30/RLAiB1XxUwT/NAsYkr2vmF1BGTE+5HepvXz7jCX8qMYpy5MA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1-20180810085422_1533891556371_0.021040585566801218"},"_hasShrinkwrap":false},"0.20.1-20180810113728":{"name":"@atomist/automation-client","version":"0.20.1-20180810113728","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/retry":"^0.10.2","@types/ws":"^4.0.1","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/mocha":"^2.2.48","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/yargs":"^11.0.0","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b33672dd794eb9e2a22cdca01aee25aa9c63f179","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.1-20180810113728","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fKWIAE9strDzs4LjAmJf2tIuUIOuq3R1m6TJp/7GYH5ZH2hkmwn+AHMX2g1brKkvK0RN3Q5ZtKsbhFIHNRMWRQ==","shasum":"d65e747f9756e3f579c7dad40579db8d31d71b74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1-20180810113728.tgz","fileCount":788,"unpackedSize":5293532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbXocCRA9TVsSAnZWagAAOJ0P/jRQmU50pb9QpsYR8uWt\n5vhaY30hLwesDNpjKL8XJm44l7sU5UE5qUkwEhiT6uFEKtrFxcJNHfzqLOGz\nnUfKM7ti+m6YQ27ha7TGZR5K9JGw745BlL8UDOhgugoZw9+QKCIKWxrow0GX\nIAKDuOYZBGd+BII8iE5IPG2H3bDV/42fO1jcgsPJsMZVgArXVRu3inpCGX4u\nht9mlh01IsOJ4s6aCLp4qs2fKs83S0QNCBBMIOYG1L0a3pyD0o8mSV4DQqAJ\nTEseOrKYNvEjzYQQNGOKcfvjwDbV3fCM+F8mCOSHVtRwpj9w+BUtf3gg/LbR\nfLCCe+nkhrNiHx+oKPaeW8Zq6pjmHIcZZMf7ixquTUgN5ckdQPb+EyUKK2b1\ncN39zU4sW2W0I82b1bV+9XaGbXgkDmbRNRi2KJo8XUdhj1RPtrbhsG2J/IXw\nAIcg3peogtri9UgsPG0EaTwOIgrny6kn/Fnd1sIn/sLQ3oMCGTlpP76h6s71\nRYDePLrTedwj3MrDVilICPKVIb4ztPPlD06Wf5VAcgLvb9t4+Gg/uVritrri\n3Yr1zuHYaEG05IVEmbsEay/s6MYVT5cxu4KyUKbE3DsBd4b4AS0n4fvES3hF\nwo0vJR6yBRWdFPoqhZ24qMaIyfSfawTSXfmNeqGFLOyZGs8Pn/m+128j3vz0\ngpDr\r\n=PZkn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1lhi/5kXHzKwmT/PY6qsZQ+3fSuyB3sVMAC7M0loZegIgMJYBCcT4PDm+QxMsgqNgHPhsbR/PMVyNITDclz3Tq1I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1-20180810113728_1533901340363_0.5052171670994903"},"_hasShrinkwrap":false},"0.20.1-linearize-builds.20180810194909":{"name":"@atomist/automation-client","version":"0.20.1-linearize-builds.20180810194909","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"907dedd3a9447b8bcb03d367fcb14012721b8a33","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.1-linearize-builds.20180810194909","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tNDqgEEGzuj8b9ck3rEYRM9H3zyRzzOlZeAXNK6Snlp/NJsq+sk52Tj6TCfsdMaNDfg0ncPh1AWl3rmvJwU/Mw==","shasum":"7691a10c1163e9e41172cdf28290bc674016820a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1-linearize-builds.20180810194909.tgz","fileCount":796,"unpackedSize":5308772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbe1BCRA9TVsSAnZWagAA8G0P/1fghyaFK5x1JTJBXsR6\nErG4yh7JgzSW6PLVEzPeYEr6ZJaUxPUofvJsiDpWnlNcz8JxkvELF74AFI2Y\nyz0B3SVw+h1+byg1qAaBZk30dXa2u+15JL3tQBnN1i+bGJt1Zlr3GgqaoNYf\nI9Qo8t6tUeT3IjmFvMdQn8Qexgd00ptRMURvb9MtVrzuMUQlCT37oBXnq0xQ\nM3HpvLpYPitSf77ViZFUpmJe93ac30u+HUFN7XYHfPz2gMu/Jhcuzy5cDndd\nl3Gzp5v1mC6nqfLi2pSSYAsPQTBxRt7SVVuN1/I23fhTkMGhw7jnWlVZ41Vi\nZkSwoJPY7dSqk3F8w1KG0E2Bcsrc9PNEXJcvlAlbPRsvkO0EkJvj0VHEfR2G\n3QUNVC61Jj2sEpVtDO0iII4Le8k36vrV+oebCMjPkgH92G8mQe1bGVeQ98L7\nCGR5QvtzedCh0m8krxAhcQwmrItirGa+HGudfsR+rj8WU5pKtz7BlEyjLkJA\nZY3wG0AdmfZJGKDm9tec1pC7zFN/mqnor/4s2TFa8i5rekJY1OEez9+L/SIs\nkeIjvwsbHhdFPlqmo/HoV7BlRURtGdDy6lmn3V+5UrtSvNkQvb9c5/RJhGuS\nBtBXc/ZW/xT9XZZ1m0GWtVptss9BdfN3R3Ny5Y6jUN50V2QmW7R1dZs3ajYK\nDbJ0\r\n=GOMd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz+IY1ESQC6yZNVz+fErIGKxBORj6wUrWPoXS3xrFdBwIhAJO+vLBCTq6Uyi0o7LsECqrZn1EMHrfkjfe6tlTtMTDv"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1-linearize-builds.20180810194909_1533930816943_0.3823930196213854"},"_hasShrinkwrap":false},"0.20.1-20180810203849":{"name":"@atomist/automation-client","version":"0.20.1-20180810203849","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d42b2527d47b41b3fddb6b9d9fd2f3d92d0ca70c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.1-20180810203849","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-i03IxAbCaxiZvsealU9H0QiY+ms9FKNIy9ZGlFpjJmeE2aOo46HaYTy7vQ9gRzKA12oij6HILV9Lpcaj8c05JQ==","shasum":"5305c5d82b809932990b57e02b5e087751953cfd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1-20180810203849.tgz","fileCount":796,"unpackedSize":5309067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbfj1CRA9TVsSAnZWagAAwLYP/0bP4SHly2jX08laKVcY\ngJ9uDNhNE/9Z2swQU6RvVeq7XUmynZ25sbnIivSOwy6X98s/M5ju8ZGQ0eaG\nGT4LgrGflIh1PG/ilipcQlDmK0yE2SrxU6xcZCsMZjLK+V71z6NLws3tM+7q\nwKwTY+3UPc6eXShHZ8tmw1L8+220qd7PAoXQsR95YbMzZ8Et1cW57x1V83Ts\nCFXURSHe+z8prZvYsZ0jkBk56AIV8P8NaKIQlE+kWrNWtb0TNTa/816oiDwO\nLZyi3juLx0vf0rN3wG/wKB2N0g4J7HX1Jb50M4nNp3ycSZCTc0YBlTKk+nn3\n0R6uG6EQl/sWqUQM/9U44uhXDIxAn0zTDBNub/sNJNLdW+ncMrQdObaSsdIG\nh/l40ATmwReKozBxTRsDXD1drWKgkBA01EHlIEzH8oIMH8mBvoURvlpaxDoL\nx7bqfiCDktxpo2aayqIZLwISflhi6VHUAC0v86Y21YmmzJGLCY73gKIdirUW\nrEYmLbo8lfsOHsFTXTFsiY/i64GkEMf0k+/+CsyUwbuJG+/SV4helbtjb2ib\njuWNbBCI+l1myvN3GYJT0xj8pfJve+SL5j2s2OLy2AdXHkswQUFlwnPrnnYf\nmFp0OALEG6mrfQ7piLODFrHEf1w47njLhVAQIkXtQzdt2bTbd72/hd+cavwP\nnu53\r\n=nYup\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG10bgrCZh3PO/khe+AYZVJJuRCNlPLs1KLfkiFJCQmPAiEAu9ZjYrPTiV2BZgeIMG3nGNbYqu853lXQ673vQJhI4qw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1-20180810203849_1533933813320_0.8859543618092827"},"_hasShrinkwrap":false},"0.20.1":{"name":"@atomist/automation-client","version":"0.20.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d42b2527d47b41b3fddb6b9d9fd2f3d92d0ca70c","_id":"@atomist/automation-client@0.20.1","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-n8n/dFesz+if50FA9R1gkIFSTKpeRb/wJdxwkxNDmxHWbItvS/rIstpmQr6DEusXlGhbnBDtT0SQvI6nBjsCLQ==","shasum":"05120a5f17cf10bc727b2c2ca2ed1b7a7da445a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.1.tgz","fileCount":796,"unpackedSize":5309052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbgCACRA9TVsSAnZWagAAF6oQAJqDo4q7lBa7OcOtCpcR\n0xaJd046wqtmLP3fYftoBbcDAoN75n+bcMPljYjF5rxJRJpQmstffXL2gAM+\nwjjUzqCVHDjEVgKkO8NAatRTwWckiXRR68BGBv+UGaauYCBklYkSCO7WmRAh\nLjja7KUUt3OblNoNQmNJXu8DuADi8qqAVYFNnAGNiRhXy0Dzu6+DfPhsMYoo\nSBmy8lqymO3gPgNW8Ef1dpR+3XzroXPoTR4XaAhDfhOkIDea8+1eymXa/Q0m\nYLGmml88Q/xgsdH3rVmcZ0cL++b1a5D7UMeNXL80XagU9lROGr2t4bgQROD+\nGsGBBYYiF3L+SX2Itd68d3qe1xoQBHYN8D2vB+C+boH4TtHEnPOdqIMAHSFW\npCpb70Tpv3yBlwKa/D6jwL+RK+pzmnGZ9fN04tSTHkJLjIYCdcEhnBBh5Rrn\nVT3LA7+LKxgIx4Wgbh7NV2Fq6q/KXdUk8Gq75HGtEg6zHfhDbZQ3Us9Thg2w\nsa4pnTyq58vVb/wWYC+kNQCHdQZAwTtUbmAg1nByb+KU6PY3Qg6JWuGlGhw7\nlth8DBwIiIIB1frUyXBnED/I97ML7igU5HxGhuCeZ4QJuTnlXjT2hvJg1d6q\nghfxdNGnPxwILhdtvuX6grgTBiGWLRhbDGdND8q2bFWtHZmWJ2c6lnXx+O8P\nXk/j\r\n=eVxx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBza97rXnWvBAH/wPh6MeH0x0NSJa3qs0E+bVZkjmwYdAiAXvz1kLNQjpObaF6sYt2+I1SALo4z3CGXbSt1cOr3vKw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.1_1533935743397_0.9847864612037294"},"_hasShrinkwrap":false},"0.20.2-20180810211649":{"name":"@atomist/automation-client","version":"0.20.2-20180810211649","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"28251dfa65ccf554cd9d3c83f881cf72c9807f47","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.2-20180810211649","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DRqlTVksiOAXOFhVTb7A/v5gtWFGGmKgTHU8CxB6Sm+f0KaRW4Ls4nU3B2rgu6DewEfw945tp6r7yTciZsY/Zw==","shasum":"7141c55b56d70c9da1478fcd699b92e95f86d8eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2-20180810211649.tgz","fileCount":796,"unpackedSize":5309166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbgHUCRA9TVsSAnZWagAAyD8P/ioQKaMb6hZW46i+bAqf\nAqz6hTFv3QSndNvMo1nTSgxhhSChGFvsfLalgr0ehnnMz1NXO8+HQnXDzkMy\nx/YXoR2fJ77C0i/3Z5YnDCxcOmJ2g0cquRJjluoWiLFSEZON9lluDxJ2hEND\nQ1yDckAj30r9M6vklJ/vzoh4Z4Vas5niXuSuZ8/q2cPYXMci/pKgEL4Tbou5\nSrquEX9xCMFgdoNbne3hO/VAY2eMPKS6oXlHnlekLDK+0G2rZ2k/Qw5NsOmK\nOhqjhzAuy0psNt56vWZ8kjW4EKKhidORQXmcROaAUWb/Np4rXpbu1xTzQpqN\nDCmK92KEON1A1y2/+mEiifmw4Xn54uQyxeNN7tI25UdwrDsasycHCPZzxlcd\nyEUg9HURhqxcZigF4itI9y5sqhEGh6sl34FqL0yjEanebl35E1a79HwHUrvF\nAtD8F4ONrd881Dscq/f2+dgrNPSpXUIl4+yZZApFeuVz8QsisPAam56jlFQe\nwQoupZclpKBjM3aTUNGUK7PfTzOhVDtHi3w2qcEvsasIESVMswjuPz0pIzvy\ndFfkUQe/uMUl1mzvLwFojgIPSlV0tUrKIpDkfQigTAfGIgSNQePeIO1O7tDG\nls04sYvuUYuk0NBvdOFF4kYorYCaNClxNdwxv6didS8gZgLdvYHpbwoXhrEt\n1uik\r\n=pLS2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD1MTywVnoSVz5YNN/9U9j2DlmoqCnq6cSr/LaFUK9sgIhAPp/e63aYKcOtQkosV3Gnh63CMT8SHZudHIu0eLuMQXu"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2-20180810211649_1533936083644_0.15943944544222188"},"_hasShrinkwrap":false},"0.20.2-20180813155110":{"name":"@atomist/automation-client","version":"0.20.2-20180813155110","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"8a30ceb61b16bb884019a12ebeeae9ea7f354d54","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.2-20180813155110","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-b2AgrqokQ3hK0rGmlVh50U1JRok27bP01a+rClETo9VlUxGsWDKnuRQGF8L2V2dpySSxRjiXjNiSM0cy2LwOeA==","shasum":"8958ed6564ff0463eb39eb06918d32aec3c20692","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2-20180813155110.tgz","fileCount":796,"unpackedSize":5309167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcaopCRA9TVsSAnZWagAAjmwP/0uEDL8tYEpvbX5T6T0M\nF0eCbHgYizo3FYBEXoSReHC8xfh5I8g0iFCLpHWjxxZKY+7Psw9aqwbFq5q8\nS98d7v5IpyZ9eEzjZMq7d1ckhsPvTNf5gVEOtP1CBCZEH+0imgN8fPuUlzpV\nmkfqO3LqGyjW40NDJ74UN24ECKr2Nj/1f3fwWstDULy6baO0E+QVn01Dm1n2\nso3IziCwkLhFHeAbNd4d2O3XaFUcbtiPQow2TXmox56C1xNs9x5H01mZFdhV\nzH5bea8STrmvhF8/a33nZL8SLkH3BjdTQTjrnQSsK5ho/mkGgrg1zhsutZyl\npvEYk5k5wUTqpeHgk6iT/hcPfRCFgS4idrtytQg6Y7wrBTdg0SxmGVr2zrdW\nVQilrtsLo4n3HSVwFpryDK7pBmtk+kfug7HcHQbhYdOA8zoViMUVV5sRgOoS\nPuU/tqoQkUXoX7xmWmUCYiQOqkqveS7xgqQr1/aj7O8OvNDKpl68o428F9st\n0a3Y+xGfKWCSBAacIeRuCCz9rIVdz55qs1YHjumTKhX/SlQrYbN7LP/1h6/o\ncAjnKyPeWiCBsMvkloYsBh8xHJQ/fIvuYKQOzInLBJXzTDj9brNsnMvB+D0O\ntypWBO/W/fxWtBLTlrNSKsoaBHLkE4D/rUiawrwMWn90D3NmQw/V9RbOVT1c\n5d+q\r\n=ENJS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxvRaeRmrgu8KwXWfDAs/67CJrEc+vwAPtyUnec7VrJAiB//eqUuTWAVkqcFLuJN5HfMyPBSVyEQI0AcAkn+vESUw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2-20180813155110_1534175785313_0.1046769452680103"},"_hasShrinkwrap":false},"0.20.2-20180814132020":{"name":"@atomist/automation-client","version":"0.20.2-20180814132020","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"ffaf79465142e537fd35c590b6505487bf6e49bd","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.2-20180814132020","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WTGmKHSoBnJpe6Swb9hTPgRBxQeZdaSqxWYo7cAhTB4AyOYIPjpEZYvgY70PNz66CAARUK3veMqWj/dWP8DGPA==","shasum":"693ba26d9bc969e00679b7f00bf0ab3418d5fb54","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2-20180814132020.tgz","fileCount":796,"unpackedSize":5309384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcthQCRA9TVsSAnZWagAAHKsP+wRMf0vm1CDt66HmdqwM\nocszHrKhZJy4IA2jpRIPXnT0lFWq0hPm2K3qZdAH3eIpNXrT4F7KGWoXxm1X\nJZjVWUbWBBpCUJcgnPJtppurVJfI6ZWYK6DjSxf8a3j9BM7DG7Wz0EFnArxf\nFE9F4CdZJOOurSKr3lZtMcLJ+7wXRnWMhOD4Qs4mApNzESj3ETwT5WPQYZMg\nYmCC9YBhXGb14nbbfTZaworflmGOHDxcrSfYKV//ZQnDpsUkqlN3Zzs4Zcoe\nUWSqkcxddRtNDn8R6HIO2CSohVw45zd4fiOMu1nLjmXE9JDZoJes2EYCbduR\nK/JWeFC/8Hr0HWjriA15aVqaDzh66/9iyvVUWKtTgtSITc5v5rnQLBBCzoDZ\neH/6xp4eqYOqvrn/4rdQoKQk/LyWVlRGG1ozO2aWOaHYAa0LGcyWGvDBBKPV\nF7dhFfDECiMlTfu+iT9r3/zU/DNmuk45pP6x3y8icEguJTVJUWevKDy0bVN1\nEIrfAtYfUAvjq7jovFZuuMwO+x9RjDX3CGsQf4yny6gZ3Bdi0E1a15sHohFw\nhqn/SIquNuxQZvTLeeY4yDmJpDJTKyMyCXgdV7dfHHfW/JbIcgbRvABV6QRt\nBAgi4GwlgmqtCdHlb81QqW2NN7yeKZsvJGjsweIXLNa4BQCgonOLPJJLYjjJ\naX1G\r\n=UQAe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPGPuEZSrfkXHwG6HxoZ26Na92NsfVCtiCnwZUMIU4WAIhAJ/tOnwzYETvHH+ZygVxIH8LXbiGjgwF/rdcki5I+xAd"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2-20180814132020_1534253135155_0.7693830164796791"},"_hasShrinkwrap":false},"0.20.2-cross-spawn.20180814132336":{"name":"@atomist/automation-client","version":"0.20.2-cross-spawn.20180814132336","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c011c9dfa53cef5f10eb3244a7616e4888e9fb37","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.2-cross-spawn.20180814132336","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6Y8DJcRXmwZPjwBC+zLYaQyHdsLtAI1pGHYPJxu/QQCrCf9aPhcdk7/Hp/ZeSH1WTTRQ5e7e5NKLg5FiVJeSTQ==","shasum":"74ea39ad03fd39fafa511a89f74c4e25f1c60a0e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2-cross-spawn.20180814132336.tgz","fileCount":796,"unpackedSize":5309807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbctkMCRA9TVsSAnZWagAAT+IP/R0MRamZYR7CR0bN9vBh\nRkbzCtWO8FepPtyAt3NaAn8+/KQNy7HcCLJjsDhoTPcfgyUoeNbpInMfdeNl\ntyJUh9gIT9WvUgPaiTg99Jrv8yIFFkSF/FAEAabGLvgYmQgn9tIDNBDoQz0I\nu2DxaCHlhyCfl3v8A5BPj6k1+UIGqKOZafZomkxzfFJOapQBGzmr2pdlbvD7\nOv4j2tUy9iSOpztizvY+iLPvxEDgiNpkr77ouw9JChp5VCBmO7LGlRkYEK7E\ndYXqWtejSz1A7tKPt0GuV4Llfuh9JhQITAR8kFllK+gL1v6ZSnKksdXrZhxW\nABz2Ia8mbVrPxKvLUSyvZnKBbzMLdI6Pfe2p3XCuUDafBMGSE8UExi8zgz0Y\nwVXx0suKBQI+zYJQMfit6yl8hZ1mwYTbXHOOU5P+cSnbu5kdiEt/tqYU9vBr\nQEJvOBkpp6xPhNIUnbrHZRGP37M8hrcVGw8K7QQqTkeVYJ59Fw22fAw/fuPd\nYUdnxN+eGUaG/ibJiZmnsCNzshomS18AIXF79ltNstofthKLTjBhI+Vn2OJY\nbzymU1/ymHPVSFpM/VhlFGxj0nNTOdpmuxcA81YNohYm9lvujAqW7Uu8MFN9\ndYPt+BGBLC/oKICgFK4MUsvLrqv2c+q126mygydCtonOXUFP/hxRGkFzP0IY\nRreN\r\n=V51x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE8RYu/nSOOGMDWly0i9KJlYYVsvcaPgBQ280b0T8WlBAiBYhjrtq+MePRYoaBtmhSnBc/I458Xr3rNAY/ez2AyKkA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2-cross-spawn.20180814132336_1534253323457_0.6704488519007925"},"_hasShrinkwrap":false},"0.20.2-20180815145123":{"name":"@atomist/automation-client","version":"0.20.2-20180815145123","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d078368f2d331b65eda5455ce380666969f049b9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.2-20180815145123","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/vLPb5HbAy4lIyCRrcYceH+J9hlJWbZiFCoc00yzUm+6PFsk4xxVfwWNqfkNlsIDWZtEk+GK0WAp0He1VcuPNw==","shasum":"74f313b583b9f83e68a2ff183e7e717035843ca2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2-20180815145123.tgz","fileCount":796,"unpackedSize":5309351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdD8hCRA9TVsSAnZWagAA2acP/AwXJxrWIU7zwdTQexBz\nceKVeGCmx7RZ8PEKy6o102Aa1CxiAwxRuNQBAO/dXs2lFcG4EVXoea3ajzgh\nEOt9pWM7ykMAY99fsH6DW7w0pp1/WYUhTtpMPDGJLOi1D6EWW1y3Gd3pTw4q\n6orG9d37sMjINh3qB4imTuC9Nen6fi5R6u2xOjyllRjoH+uNPx/U8VbMUyIr\nZVXLov+m1rEef9sBWR4/e77FgqmEA/JU2OJSq9lFZZH2binYW37kAb1Bv3GK\nXv6oCRhXeUVUSbSCqL+aVDCFq7cKbYREXgjKBF2/+Xpxln5szVZHZmra7Y/Y\n86+90HCAZksck8sTIGg445w93PcCrQW1UDTrvmgEEkn2EgKYY7JZGAv827LO\nKM0Hwo3zCt9+po5IOtw8RZVCoYMmaZtlhyLWJhJD/wMRgg92ZYJ0qdPnWmDb\nrcYv11rHIaskFERm7cQqScPfsuU6rd+fI1hHtFAj0jTR96phwOGKJ6whRZgJ\np32SSxgNqWjoGt/0CSpNE4LygEWBlRE1/3BeLAutYcDdOOCDtKFyCLcI1u9D\n4dOsL5NwhDYonMMc33FwzUF77wGK7QoHmha/VNfAWvxFr68rtPxC5uV095HG\nHlKiiC1pPq6YJPivx/X5EbTQzTaBt26XGt0uFUjlPXOWr49yn9eDssp/oSxx\nfwlK\r\n=xjol\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5Yyyrzjen04XKDPS/keWNCCwBNU5DiYsXuvj1XO/5OQIhAIcYCvcixFuefBChpbHxo8+ga6sb40i5+ZLkAYeJ5Sqr"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2-20180815145123_1534344993600_0.7426632944428442"},"_hasShrinkwrap":false},"0.20.2":{"name":"@atomist/automation-client","version":"0.20.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d078368f2d331b65eda5455ce380666969f049b9","_id":"@atomist/automation-client@0.20.2","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-N7nb20jl2/uYuLnYykWDeuZggKwut1/EB+y+qbAaWE98Zckhv1rXDm6WYm9qMaFiYVgSPd/xJnZWy5/DyZqaXA==","shasum":"ffa3a6f7dfe8b984dafb71661ab74c84b1ab0fee","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.2.tgz","fileCount":796,"unpackedSize":5309336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdbBSCRA9TVsSAnZWagAAhzQQAJBPpB6JspqVUfDvDk1T\n/C2En88Vr7UAMPPjhfeBknspz/YL1TiaecwXkIJrwzuhy/8XzHieLohS6fsD\nR4kZoty1M/ygUHW+y20D8HtK4JcRDDKtFQYLuuB2aF4bkbq3SdsOciZY1j/W\n0G+hd+9wvqVovgod02Yxi/xH394raq4HYQfpRG2MclNlb8nrXdspjVHdKyTh\nbk+mDiJiyKVxdc2jRJsONpz37gp07D8qSl3jduBD7DNwjgqeRdsCsQA6+B//\ntJYpQDDrlr0YlnTEXLY3+Buum8zxcoNeFBBnxJ9ZE7FH7eTVEj7c7KE9CA90\nvFicsmogQNV+ggr9o8sXo43kZ2E3cBj4VDUm5X7yHWfQu/aW7CDG5YWxHP7h\ndG/85F6NR3qOgWdzaJc7qzRn45/VwEpxomfwnYoJvHtYtDPsGr3dTPiGzawT\nHNcadUg7h1M2h+0i3+CcJWGmg1W11U9ocR1XT1S7ayHOl8pciXAdtFp/pfBb\njEIu7ri45PAZSe/tVQ4WYn9n3te1anm8jmug0xwfOlTUCiMhaxmEUj3b8FB8\nHFE9umUMgOglWdMqEjmLw2pb9HULlmMYqyd11O6lmD50Ai4+TIFfQPEl70Wx\nQO+eB+VImRmjoJZndl1WIuqoidg7mhuq0vxgIektnwm2YOTZWGUmP4Y3DppI\nulno\r\n=mISf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIHZ47miOCliz6w+XV/KTFA0Y2Ua02PQ9V6xjOVFVptAIgM8rbvL6JwVeGylI4bgxYESM6np5PRdd9bMh84MGyhbY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.2_1534439506165_0.6030230934983951"},"_hasShrinkwrap":false},"0.20.3-20180816171253":{"name":"@atomist/automation-client","version":"0.20.3-20180816171253","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"fb08d6379762880163618301b93b785504867d42","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.3-20180816171253","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9YD4/A7MD7fmnzYO30LnZ8ULblYDUIdq57JvnAY0B38VyS5HPv0I/IEcNhgveyp73mdsLDb7Z8opOVyLXWDTJg==","shasum":"6495011422fd4fe63667bc73febdc3f36c3bf3a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.3-20180816171253.tgz","fileCount":796,"unpackedSize":5309450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdbHGCRA9TVsSAnZWagAASe8QAJFW5c16vfeQhTmRw7Th\nlt9CQOYJAKDxXrg/l61QsY97iV609A8WmjTmTnpgj6nV31QoF6Jn53i6vYKy\nN9dE3dZ5nceaED74WCCFnI8Ovh3Ao8k4myN5Wq2a53vQ196MRQ19PgcD/IOm\nKIFHoytyIzmwpt6cZEIsV+2NRcZwrWgjgQ/Xcw3MjU9v6tyILcEiIpHD9eql\nDLYMeO0xTo6xgX4yR/MLiC8m4iBdB0FZG5SqsuqXP2MTaXvU+ENSMzEiTDq+\n8umbPjyy2Y1qrfR9wKjUYq4oCZ3G6+kPMUwTKc9zaX3gaQ/pdAZk+PP+Oq1A\nf53537T4RZekx6k7AqULc+x93hagpEjV4ec4RuECX1K9CJ05LpoekMNg9Bin\nX9GU5lqmbpJBWnMUJnc3DbbelZlRVojMEm0HCcMX7TC0Nos0EpRYQo7jVsgM\nYFhv5L6L/ZiZfz2R8KYB7BpDem/lbVZUrF9ot8HUOCUB626VGbEt0Ogf84SX\nPDzta6JPja1iovpJIypcPoxEMcFM88G/0OV3InLoN4kdHukj3Pw6AERfRxdA\n3FGJ7BEJtuQS+fRC7ym+gukqNTuON0bjgfk0Za+HZZcIkSW1XGyB/hiSJp7u\ne0fLED3b/9MxhkkIrS3/Yo4xUyuO3wN6ottpAf6QwR9IYGsjuU6HjtIPkbTe\nA5dM\r\n=3dN4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFkfINxjLD2PPNZ7Y3NrzFarP/sssGWHNNUHP0MwrSImAiEAlBCgXl42RfFIramMLZSOSdQnAugh0Kl3bYjgrjqL/l0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.3-20180816171253_1534439877517_0.5756981639666006"},"_hasShrinkwrap":false},"0.20.3-20180816181405":{"name":"@atomist/automation-client","version":"0.20.3-20180816181405","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"4ae31526bf8d454a439e80f638098d9b8903523c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.3-20180816181405","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TAFpKTakkrRjkaLqfhQ529IcnzITM7g/f+2YNpKm0W9HKOXZTJfTOMLejDg5m8MxoWaiploBz8VwODXyo6UvMA==","shasum":"5b49894c368dd5c0c6825838c10c872180b355ac","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.3-20180816181405.tgz","fileCount":796,"unpackedSize":5309861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdcA5CRA9TVsSAnZWagAAv4gP/3h1JyWX5fQmANEeylrT\nMMG2wX9IzbXZlIKAcwAL5/02jGgTSSqI6etvrM62wq2QMqO18XPfzc//LiNH\n267V8yYbnsPNEXZKsAjQx2fYM6w1PC3Q8grYkSSSIZGwOE1g3mxOS1+DbNGU\ncTKuYzI6vnCkj04gRjLAvY66fo12yFfW3g+ESBA2Qff9wfA1xXDznjYdJSnm\nJiA2/vEzTTocsHm4WFKl/D5HMo6IFz/zTeuP4cAF6t0EoKF4OKz1cqeGqq90\naiiuAHE6y1+7x2+99UutcDdECNid9PQU4hVgw9x5gxLP1CQu5531rHg80bDF\nbheDfvEMX8Ulxre/bRXgRysHUeDaDkRG8S4HcPbfFJqonr8dQwi6rbBbCGzh\nbfzLu3r7cev2jT65EFyaw9YlaryX/pJMpM8Gx1s0h1bt4uaZQoWTnLQbb+5W\nVpfEIvtGsjGYB0wGn0JjXnYKKtq2peiTI3bM7xMCTm4gOap1ohxoUrbhn6Zv\nJ1psrr3t8ObuZXlR/AM2//9Ljyt7MVaJzeFfUhO3vg6A3ptptoBtQWwVo30Y\nr2ry6Q6LEH2yHgCKxNAlhEcH7nXbEBgg3W7a3oFZV4n2T/39Kyb6Y5RvzsPn\nvgv6aDh7bK8w37FI+P/fPdzrtAf6C1G/f5XUafwBIHjWEzVF63boTCLNGMte\n0RrR\r\n=w9bw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6y7rZX4t1Co/QpFH3IC/Vj1TOBBvz3I6OEwbBX+6DSgIhANP7w7yNvEBgMHBOX7sgzc2nX0Amp6A8OlZjdYs2mwdt"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.3-20180816181405_1534443576496_0.7956320964811538"},"_hasShrinkwrap":false},"0.20.3":{"name":"@atomist/automation-client","version":"0.20.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"4ae31526bf8d454a439e80f638098d9b8903523c","_id":"@atomist/automation-client@0.20.3","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nUrCtF6fMuBGntOorc3iGJ/AvpKJe0sDVvPs9E4np8SXeyCDXD88/yzyYrLKRS8QwHLAaCu5v3Qtlnxpcc8iSA==","shasum":"83241ffcf937e7553c2ce2b00ecb9dc2e85cb7fa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.3.tgz","fileCount":796,"unpackedSize":5309846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdcDrCRA9TVsSAnZWagAAgmUP/i3qlOAkSIXcwqtAbG0D\nVoeDlh15dwyKR5aWoo/3w8Pd5OE2pIF/4CCkkQMQ1/nrFncfcjug48roXq8n\nPpKLQ6Vgfkx+/Bg4BTx2VV+CRcTCJQnMZj9KX7+7Uu0MIMZXpMfWK78znK7A\nYasmzJiaDNpewbn/8UXiwrsCDF7V+FlBRz2wVqBL/fCq3oTl1Ox+GwpwbMN2\ndT5UDB9RRuKUqfxl35/1pqEC/PGTvo2lWQGDAkGo4D5yOflOzd2PC8lDO5p+\nN0Fhfym7mVSM0z9yjkP3klxSwKv1FE6ycM/+snEEfEJ2NQsiEeVzN6ysOZvu\nBmOkWaPS1JVbvS2ucRbl5fg6Eaf7CJqBHiF/i42Iyj+xgbEN7rjGLdO2EnMN\nKkBGW9BNT/ElmMHJMhxyZyVlEuMyrZDt5egUivXlXsc4JNtEK61uvtCMR2Mj\n89UxcCc0F6dkSbVzA9J3rSk9iIEsWW3etuKBst5UYO0jtS4+VgKsA8Y7U7tz\nGKET0Y+XSaBGeTlnGE92GlJe2Ngx2H9ViV/iMWuAevxL/x1N84c5OHtUDI4K\nMOequDZ0lPKR5oNYTYRmGYiqbTRFWNlJd8MaEO0pHMJtrnJXCo8rBv3Aaf4W\nVPI8mwlWVwzJEiMt5fGnQvnipNNlRi9yUMbLR5gV7tA9HYsSrmwLNGeJcq8R\n/eo2\r\n=1DH0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC7P3RcZ6KLhhO5ubfjmRApuY8nw+h2U0SRjsvJZ3sgQIhAPv8RmKb9cwDFyiYIXy1daRtO3AKrEiZGBz116Id4nb9"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.3_1534443754577_0.9901204035093842"},"_hasShrinkwrap":false},"0.20.4-20180816182344":{"name":"@atomist/automation-client","version":"0.20.4-20180816182344","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"231e5fa1e9796cb0dbe35b31e34a015c10a1e6f3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-20180816182344","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-j+ohGdOmNdd0adVVfyt5V9lpj9cB3332LEptmyDT/SgA06WpULD+cI2xc7Jj83EPP6+P8axYyy4MLFUhyXOO/A==","shasum":"913262e0cf366203f9fa74400137ca48e4080be6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-20180816182344.tgz","fileCount":796,"unpackedSize":5310088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdcJcCRA9TVsSAnZWagAA+FUP/ifbYaqHssj1bn4jOqZz\npOe5m7FBkMj2I+OFGuD3theJR9cCs5KjfUnW0HS56v3oLvnV/eIypP75Fa8k\nGtwsDvCCQbw2IOYjD8I14G/uZMD5OdG59WU3/Pnx6xtbXZJUHe89V0FB4kVB\nebKiByEFDgby47jy2uPFUCv9rnDKVMvfjciXjOuzrVu7OV/BUyaJfBhb8Dwi\nnuyF8m9X1KXEsPoTewu5XXuVJdFUQBjMzWH7HjBzL3DAq7FiSR2gJJALWUqA\nTU9ZRwClmgAV+Ho33hrsoCNlhRxYbjMp6rwSEAOKB2jO/Kr+mp5DIS+5gHAT\n7Rd/r+ohBuauCDMJigRIJ9X+qX4xyraUrI69srSyOIidAKDhQdF1r2g8U5TI\nZQ/cigluILGhLklQeagIT7Ecp9zrj2I0Hys3vAPzvsQ3HkpLvelUtsrZQp2y\n3t7seD8Ds8eNrZ4R7gyUeVIQ4o7VLmdPYlm8gRRL6alZzvqJ/HYtU585pKTB\nMVafHtE0drFqCFh/NWBOXBvV/li443fKTV4PeWVi75F6U6h+Hqyq4jPiwM0B\nnYIa4VPvqcTxfPaQS5rjByEnuWaRrD14YXP4t0HORSINs9g66ad34jnAApk6\nlFxps9YNNRx2R4BjwxkvFHMEts2TF6J2TYturULeNWtDftG2qTEGoci67A+u\n83IF\r\n=Alo4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXsn3Bj4EXlyyi0ryt2F78PHsvB4+C8n31/jL7uD/2TAiA511LMDpSVW4Ts3mIKgf0Ll0hbtnmlaWpMuYmuOFx2XA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-20180816182344_1534444124069_0.011817324644562976"},"_hasShrinkwrap":false},"0.20.4-proxy.20180816203206":{"name":"@atomist/automation-client","version":"0.20.4-proxy.20180816203206","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9e53e1960b683b866710ea79f6d09d8d2e82e3b1","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-proxy.20180816203206","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BQHYMWEdT+KtqSbCcSa8vG65AAA9Aia3Y/NyjZ1k78Cy10/nxjfIlJe4XNkEnu3eq1ZrTzsELnqNR5SXzZ6MsA==","shasum":"e8d8733c314389eaf0a47784f5d9470215be479d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-proxy.20180816203206.tgz","fileCount":796,"unpackedSize":5309997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdeCCCRA9TVsSAnZWagAAm8AP/j5u1yqgeUaROJbs86gp\n129+9btw7r/SxxqEKU5fF2GpeDK7q5Ixr843VIxqU+/UzMEcCy0OQ/UKvORU\nI1o7ESIXqGAZx5MoOu8mWjcA7x4MXACQARuYM8W9nQr+QMvVreVyYNFwhkPj\ncVExMkq7HLdr0xirnKrxq/yOJBKMsyFbLpASLaKLAD6Aiiy8Rwf8BpK8/277\nAuoZJ/pJB4pJ5/xV0oNdpAZLhoC8Ba8Yd9qZsx4aeKKIE6mSF7lNi5ioyktu\nRJMpEi9XEPTf5zlKU4a2jYQUDOzdKoyPhx1HeJzHpPV8f2wzWNUcpjW97gjU\naxmhGRVfRyUynCCbmO55fzw2foI6s7rE9MMrUB1Ydc0cLgH7WvgRlNvL4pbu\nSBY7IZycaN34QUfIJfhxG3ozDGHUQNJW/UdyyZ0Q2xe87LdNxxLhIbhjRljU\nCJbUk9KVyhaqaxRJPhiGqAadbvJaB0IIaVw2Nn8BflEBTvJb24qpBkJBFDE6\nTul7UtxqwIoKDnQ6kZfxEfsFZVw+zShZLaRmCH4w0TYmuZ/De6FbipogUMMd\nR2qbY0gLbENNMkN0GO01dm9ahcb8T+H82Ob3Oru/pOXW38Ip3r1owowO7KXo\n3KrQPGYPHiCFLkjUshcWK8eFK62J77e9gabCjNADdAC4i46IaIz2i5PP4CYW\nT3lg\r\n=L7iG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1MX/CVOM2jwm7klVhTR7NYeLetgkJCqU8OKU7ViDBSgIhAIyzevtOp6gFj0vMkl/3XxMgQKDz1EUSWuSq55HlbTKG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-proxy.20180816203206_1534451841409_0.9915881791644345"},"_hasShrinkwrap":false},"0.20.4-bin-scripts.20180817192728":{"name":"@atomist/automation-client","version":"0.20.4-bin-scripts.20180817192728","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"86625646b209e66a79f129a2652bf0ec7f75555c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-bin-scripts.20180817192728","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2xQxP2vEyk710zqtXBW/lS7N/mvgObDilH//FhR4poj7I1BZWEvtLJoB6PBr1MdtKOZT9pImSSA14u4cj7bzlw==","shasum":"af2a2bd4a84190a8a71aa0d17b7825ea455baa53","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-bin-scripts.20180817192728.tgz","fileCount":812,"unpackedSize":5330529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdyLLCRA9TVsSAnZWagAA0woP/3n5asZCckuKsntFaBHp\nHtLSQcmeOX8vktYFdMJKSRfnbJOkW0eoHV58ZC2XGWe2vF9tYcppVhW7GkDk\nEDL4AsKGghvGQ/VMfdlQc4l3fIw56umDWl85aNRS4ewPHfiW4yg/UpdKvyfJ\nRA4wBChXip+8hpsEP71VTsDYWaTAAsCrIiNIbtOGk8AsIEOPzzj460QW7CrK\njLiOgDD3jAsguyyaEvqfTKNdNq6jQ9BCBSwId+zb7SFwxwKNenx2wIdrltfZ\nEyUDm/gjfnW/vX9wNJzDN9qqCL7StYI7PU2Hw9TEggUwi0ARfSjc5wgkC11N\nx/j6rcwZjpujvaNJm/TJeD8w0jXQqD+y/p8MzvIM3yxumvPN69eDvL/f9OyA\nYb1i4DPVqtwS5eM3i9JsOrZ2u90T+hjOcEyIWHbAmS2AD5z4R7eRTlGHgOag\nHS7gZPcBtqrIBZoCFt5B/5gv7kM1uIo+GHwNJ3A7cq1LwO4QnPTuQ6v94XMS\nhu4iaCefcoFbtUoc0cSY2i2M42PrrnUgqv2PgMYX51iF72jldB/mBhNY4Ggq\n6xalAaMj21xVZvjsxNSCcqx3vqtIDW+KjDimaj4pWesa+tI4Qy6Ol1ral4oy\nA85RL6hY2sH3Z3fnC6jQyZnEZgvLjAM7M1TtruD9R3+y2NHnGbihQ014/z+U\nDNO2\r\n=alpr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRO7DqhtjFAoAyXbmpKFnpyyeyqiHMcUEMnjLFTyT5AQIgDKThGKbm5XGyIvaW4DCgdULS4JK0RS4KpCSyZ+rnDNI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-bin-scripts.20180817192728_1534534347132_0.37526374371137705"},"_hasShrinkwrap":false},"0.20.4-bin-scripts.20180817192952":{"name":"@atomist/automation-client","version":"0.20.4-bin-scripts.20180817192952","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d5468853ca67d1eca331096307b2339ea62a44f2","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-bin-scripts.20180817192952","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Se0zuiHPw/CNWLIp0asl3TJYDZouNFPraTZFJji9c8j+ZCeMh9nyvjT//n44fK21cZ3X2Rgr6Ymim2qYc816fw==","shasum":"94d0180b60c51c92820b9f620ae4b5ff9a31f639","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-bin-scripts.20180817192952.tgz","fileCount":812,"unpackedSize":5330529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdyNeCRA9TVsSAnZWagAA4tcP/i7JLrH0eZjyY93iPVH+\n3Mb5F7UTZgGZalYBP79bGJZT9IW4fW10ZkhZgk+D8qGf+BUXP/aIidMR4eEq\n3iJU2uihF+ecU+z7tKdMk71WMpq3zWEJ2iz1wwel2/SqpU5rim8MVBp/vAlR\ngqcKCgWvUKY4oVjQmLAoY/p+ox3bSHUDMHx5MiPZ24LmMHDlj+lEOX9N9XZj\nZhdgrA38Su5YQkwtJXfInoYBhPvNLMsC9Db2DMD+E0vWJaemZoMBtAOfZLq3\nU/G3CJtVMVZmUN1gR2NRrad4R0nXBfDkwSfsuniVT4f/adS9TNtxNOwr3lze\nqWqW4ZQHVfPN+2BHuQy/HwuNp/eZ7UIXjJonuBZpuJIy4pY30xrWdTVHLHAA\nfqHEXAXvmjaf2ddYzdvNtuj4o84UxNzhXX0NYnvmqq5hAejQCsASHjXYQBez\n/M5k70wm+PPYHX2wX5DalC54da9vA1yMh4Bf0XZsbuef/O01KSC1DsbnR/WI\n3gxk9f1IYV+wB+ZzjMgg92/tg/H8o/ZKzKiEQopuJKOFZLlPK9DxWMsnXSnP\n4vn8/7wn51U1Z+I7BlgMvgY7LUdLe6xWm3SX20o27esYRlznArY+sObU3mZr\nPfij/CmzVk1Eyb/dVXQqu9aLmV3l4Ai0n8QqX8FUXid6H5ssn9nRtfV+r65G\n/cVY\r\n=qWBO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGFIF5HdfjpSGaOrtMSpI0PnRX8gOQXS/8/IIRB4q0UgIhAJRvNjzCp6tfuZqy/To/DkgOGOtHbLu2IND4vWQSaSMD"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-bin-scripts.20180817192952_1534534493511_0.10508324614035924"},"_hasShrinkwrap":false},"0.20.4-20180817193509":{"name":"@atomist/automation-client","version":"0.20.4-20180817193509","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3a6159495697e019e21099764d744ed5421f8d3b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-20180817193509","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TVohtwO2GT070asexiekfNChkuuk9uHOhF1VIt9h1n+Ahy1Qs8bQJg1q1xXLSSMZ7rMqRkmWmq5szuQ4ZabDZw==","shasum":"d4df5b89acab628d9519ffe6a5b145bef475cfef","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-20180817193509.tgz","fileCount":812,"unpackedSize":5330517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdySXCRA9TVsSAnZWagAAG0UP/iQ/dYXGF2Av2vGg/eCF\nMmSBHafk+nzjGWLK/QmT7ZoWZiLKMtO7Jyc9l2hMnCbUC/Y8heSP4HBXmNS6\nP8FM67xn4bs18I0Gf0xrR++KrOoyCq4QcooQAZjBWX2oPORVWZS4YlX7GVhi\nNeXee094zld+LELmViHrWQML83fbHLKe+NuuGvuywpNRuPSC4YIMZFRiomG7\nJbgOCGYjXpiYOmGdiHw4EpliuZ/1DtZLyDRZGiM9iJGF2rIHKTnTPKSRcOWD\nt/8SplUG0T879PRdq02ZR0ONWrdKmm0EqoWTL3LFAl9N/ookWv/fn+thuQ3d\nsUXb8bI1RfwQUOin2eGE8u1v78JoRf9erPKwazc8VhtSMw3ExlcFyBnFHHg3\n4XGikxy4Nzv6VSRx7dtarqU7pov4iBRAvLdu8iv4zrVv0+pbwkjfG+AdXF8Y\nqZz5Hun1qrzBJ68UZ7sdLs91zmLQ1W5A3dfU5p9bS/GeqBlZ0KA9N1eU/vbc\nU1Ay92PGD+99yx5UWQPoP8cPhU6kUIC7RwtLxi4fwjpNXyS11ame+fm0oLAw\nRlBSj7BVvbALg0A0A0tp793tsrnKtMaD3pOd6KGBsfuMGovLPgv0MEkFdHi8\nnGt69GT/Z2AvkiPEAPiYcKBy3whCY7yDqHKd3NbMgLoH+3fVTVBlO3cq1/fi\nsQ3b\r\n=8T2g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6rhSOIKMPspgs+Wd+6mFOr39kMA4Z5MSkofdeOljKCAIhAPc2pIhPddM/fJ8HGC0fjrGsLSgAtsep9xnHqRpE9enQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-20180817193509_1534534806312_0.9359924008933682"},"_hasShrinkwrap":false},"0.20.4":{"name":"@atomist/automation-client","version":"0.20.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3a6159495697e019e21099764d744ed5421f8d3b","_id":"@atomist/automation-client@0.20.4","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-kZ6SJrKgAtxWfRCjuIoQvICrgT6fB2/envMKAqHpuhdQbq84jYYhrmk4+CsqDBNtNG6Q+x7JlPaafrZo5v2miA==","shasum":"cd21507edd0d3501bef15ff301dc56993b6f6e33","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4.tgz","fileCount":812,"unpackedSize":5330502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdyWtCRA9TVsSAnZWagAA4FYQAJ8djGMXebZwM+CztOLV\n0P5o0DC30TM1n/+W5H78me80QtLF2RKeN6lM9/mxG4eLwmF+qE/pw8kN9rnE\nf0hdHQ9TMUvW5VCOa6MjXYRF70EOCriGECeim8baJ7bK9IXcbEn9zPJADivN\nDM4s59NCCIivffSbs7o7RZTXRpMf0JEpi4gMGry/to8tYAgpCb7sEtBPWM2a\nMqjGcevw2BLIE4qvMYFoABd+u2kNo273L9lZcTT06AX9h5hG0/06H/RYNsN+\n2IobeF1nUC4CqQIbhGAOg6lfKDginqb/63ttPdIuUEvREBmQLL7jkSpp0yZT\ndjR+sWYkkTTAC2C8Mxy6ZtdEoWjf4myybZGYSgtCH0iN3KppYXTgflwnxhGS\n2lQE0ViWsGnADnPmnS1bRa3BioFjNsOjz52GW/RpvjifqI7pG1PWpOJlnJF+\n81IM0Y2TC6VeasUyNntxDsl1cEK96DQYhoBgKWTkSkQGxjJ7HTyHCvgPZSz5\nnY6w73hrAngPTYBvMUoDnOPGUkSWuvOacKGyP2wltcpdL18Z1ZKCgr/1Vojx\n2MD0eCZxQfjNzIntlnzp0A/oOQHf9cWF8PqjFN4oblTlB+11zz1xQnQKYxf9\nVjX8/VYT3tgj0onn0rx2t5fRzBlSZwArAc6SQQoxIQPV0e02FJu2x9lEwxEZ\nHMnB\r\n=xpGU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxQzNjzI2KntUXuC/LWjkSwKUWT5N8tIO0i2FSlqX5HgIhAILbyZvxXFjVsnMi+JLGDqFy+wCQ7ONhHXTVVJKRR6PJ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4_1534535085025_0.1668236579872886"},"_hasShrinkwrap":false},"0.20.5-20180817194557":{"name":"@atomist/automation-client","version":"0.20.5-20180817194557","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"94995ecdbb7f9b6ef4368ffaa72218dedfb725a1","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.5-20180817194557","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8RIrzcmFYIR7cO0qrDnbHMfm5UYAIFKIEHnrPofA7sdNQgMgl063tyOwvYly0eqPU8PBV+894P7ReoYcY9+66g==","shasum":"723a17789ec4fb692edce7813a4b28ea37df0ef4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.5-20180817194557.tgz","fileCount":812,"unpackedSize":5330735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdycdCRA9TVsSAnZWagAARIwQAJ7geaRfnAxGdDvvlA9a\nbQnj+CCuucxBbuPWdxGExA199Jb6GUFLzxmNQ8I9eSVxsCy694yJUg5PEM5q\njfrwP5trn9AA3Tr/+1QVdC4R6LN1mRSkan2WHvBGv9hM6jmy2sUwPSN34vO7\nIEfflkM556a1LdlilloDhdmlu4Mmgr1t1enwigqXX2T7imF8d43Oh0c7EtbK\n4Dy27icmK/hm4djRTB+CBcaVyxXZr3+2TrlS614bopoptrh56LG9UPjsEAnl\nahDPWP+Zqg5ZUw+HHISo7dVVUPxsN+EApBYhcQTcPSFdSfUQMKygcugBpBJF\n5wUf9ZSREo0YmdBKvHJ74QDlIE2ryK9tblc6mEaP2uzfSX+ieFF/S+dhnXZW\nK+LJc9yBNLclWzRYZlfNyoeiHus3QU0YNjHwppa8a68yFBr8VaChLpBRxwgL\nWo633ft3MElWXB63UGjrxSZiOX9bE/lx6y6IP9IdIUo+aFA5vXCCQ78GolY0\nEtcGrJFlC55wawyZkAF4JY8hys/thHvuKZNAkHskpv/OenS0UJwk0RULCwba\nLATKg5f/T8m1GgDxyNzmu3vkiVFINEpeNnvVpEYkybh+sgP2UBLMWqPi3IkF\nI0+7OWk6O0biHPPgxoj+qkfNg7tsGKZ8ckRP37Zjr39C/KRlGiKneWPFbIN4\n0rNm\r\n=SuhM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFmtWLdrerLB5XWZNCbmxcS4kWssYhWSMNml/06EJewwAiEA5sbX6opJ2NBvbqlzb0/qp9Xh+A93uXrIT4pVZkx/hIY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.5-20180817194557_1534535452912_0.8372456713993259"},"_hasShrinkwrap":false},"0.21.0-bin-bin.20180817195847":{"name":"@atomist/automation-client","version":"0.21.0-bin-bin.20180817195847","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"2d4d4345906369fec97b210c1308fdf71268f3ae","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.0-bin-bin.20180817195847","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gusxOIw75slM9zNSTsijfJd3OjnVjJ2nyHdMbk1q4UQXbRKfDDp/+HI97i78fDfAP1YdhQLdxb7QzlBI9dx4Xw==","shasum":"499ea26a523aeaa952ed2d7d1719b4487546ae77","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.0-bin-bin.20180817195847.tgz","fileCount":812,"unpackedSize":5330912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdyoZCRA9TVsSAnZWagAAPgQP/0V6Q6+FzbfGnY5xirpU\nbNRJKwqMnDrsMOnv2iw2ZRJFXVdlFYzR11rObP+KQrpBmjAsYjdKUYqxkGSW\nuLqKTufbx3Ba+92FvHx3/zaf6e8CHNoIDV2Qf1L9pQI01BUnh4PcDQXA9JXo\n1O6DwR1lLWKUiskaZFkAFYT2WbCq0rgFSecMc/e9J/sRCwp/MfGTFmDWBw7h\nU2trv9WcuTbzjh4DdZXbXLy1Lr6+bkyFLdyHOE+mDwsYpaIxmVI9srFHmEU0\nATeeF62Tagz4ivD323nWm+yWDmrzfoEHlxtxujFDqUDKMLET2+AfUMOoFyMi\nh/QaZPPc7KHBqQh8mJJMSaUg296l9TxN2zt/+362UMg/4gqp+WjkNuooh99G\nwKeqAD5Qv0Bz2NC3DRsvtIYCnLE93LL2N72Sy06ocYTLxDxSn3mlWNM836+v\nFfFDOCQwOR3gz1lXW3QX28+EiNRHbUJixLHkoAzQFlpkjgOHHXBNMOCtrU21\nxS1j6AFXVr72H3SGN9gUN839FjA+P4XzpMIa770fhRDS7kyTrIhbdAhpHIuA\nvy0+c5aNCAd3l3l313t3Jj9O3dfRYY673EC8UgBjiHwKHEpQC6u1J1exndrI\nrYBDK3mW4EiAaxToB/4VfLS+we3RxDzLQlfNCfpTwb6XinQXqo3r2oqd81l8\nS7jN\r\n=DBjI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQBiT8cQ95jaKfyZnSUfUl2tjJvwkO3P3xICJ3AKYN+AiEAkaYqWUJTdvanQ4nOlCjBkA2TtrXF1nAmSgc0LEskgtI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.0-bin-bin.20180817195847_1534536216508_0.24935677193805494"},"_hasShrinkwrap":false},"0.21.0-20180817204907":{"name":"@atomist/automation-client","version":"0.21.0-20180817204907","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9f95fe1341e317728aad9e1b68f6074f5ec86189","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.0-20180817204907","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rTg4COKXLesMB0N7Yqq4sT0dHZvYViC5a60YBVPa7PVngul9ZAmQdtbP/aSk4jyPH+EThbCVwxxRh6eAlxMMcA==","shasum":"5275fe632d07871d1e2eaea6b1afc4f5ca24e92a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.0-20180817204907.tgz","fileCount":812,"unpackedSize":5330904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdzYOCRA9TVsSAnZWagAA8d0P/0/iuov1mMu4uR6yd8wv\nFsHgzZ7TKTqjf9iV5uaFTeQchNl06nx3zeWTPM0VCl5WJP3D0nB168ue8IDd\ndqQn2+ihSiZJaD7Yj/o4aeIkiKYpaeop3Lt7ANB9oPhGUh4rRDQIt5Z7NDAt\neuv0n1D0OmQw81afREXNcvi9Wk+8CEkAu8FeYZeXZeE1gMnLjnh+0oHvGktF\nfEJK6ssPw+Dx1kl8fslCD09DgEaAv+72G7jhhGUH3IlQLdnIoiOsiW//RQzv\nANa2Xi5LLFWk3Om/OGgDAQa4sqggNjD7lIWYT3RBQFravRrTKgp7sMDGaCJF\nFCLr8s61WER6W9/b0jR8ddex9By7nsqkSe7HIoQS+bVxEyU6LzDOdpdC7LCI\ny63ofNyPK0fyoxgYJCQU+HoISnH67CX4NW4udSW1Jnlhqi43jvhW0Wm65Eu4\nO5CvwMw5FhuWVWXnNNdhU3Js3KpXxXvc1rK5d+CSG169U+SSF2C3/ogErPWb\nN3PGwOurQyQ5tD9WFrTMbe3GIzBwzZLX8hPMxUn9hBiB4WOTmXBIzmzuVsfq\nrIx48FWp16mJVFrZAyCqEkAO45DcMALi95aAr4M4XCEgWmoDn7OrYCDw5ZRp\n93JGFn64LMtmI/hEL0U8a48xsiTR1Sm0UjDXh/nRjRjjTwOe8sDEc852NvDE\n3cMK\r\n=3i2P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDanVSXVOYunVFypr7GdSOcUScGNgdz5gsxVDEkMflExgIfE/mYP7gc/IT7p81oFQKdVN5YBIxHDjHQjpmu1r+KvQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.0-20180817204907_1534539277630_0.4129685405781913"},"_hasShrinkwrap":false},"0.21.0":{"name":"@atomist/automation-client","version":"0.21.0","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9f95fe1341e317728aad9e1b68f6074f5ec86189","_id":"@atomist/automation-client@0.21.0","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BuXSTxKDNVYc+z1+Hx+d5Lw5S3B5cq1ORRmsj7nRLquaYTGs5tsozIsHnGynijno6W8uCfCqjDmTiMtd5HivQw==","shasum":"10232f573c2268716110b73a03c4dbe113889615","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.0.tgz","fileCount":812,"unpackedSize":5330889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdzboCRA9TVsSAnZWagAAI8oP/i2TwOG38PG3azKr/kdu\nAymYPzRvVvmRJZHTh4/ZeT6VwDjyhhNCqCRmD9Kr7Yb3+MmIPp5WQlja3IHM\nYLAwbYNiQKz8qDbiOSewfyxoe6MwRHPCBZKEfdvcUebWstRmhsEkg170HWwA\n4ygaPdIHU2aeAYRqFruNDAx6covfsaLZ2UJQEOeg4+XV+FJtEC6SnRcuLnnm\nKjBGz57POC6u1iDq57QXf/OMpIsduBuiG16UUnJU2oZnBg3rwhSmP165NotB\nd9R2NOF1rVxTypZYTl9/h/Q4wiicEI4BVwtQfXUfKUGuzRMm9iTtcWXEfQmo\ntaJ6bgvRdqI4oaDBMWLaz0+aDxFGQUHkIwTUVtSI6msKMxlehgRKm72lpvbU\npe3F0mE0+GpmH1Pp7fi7GI+ZBj621g3enqg3tNBAXnHct3JL7M0FdgtrFJW+\nR6SQ8pyDDYoRY260wWeeM6dNmwzWmd3zAYi8r/dlfjKSCJXqhcwbezKel7qH\nh23sSKMNT+u5yMomPJx4T1QdFo+OMV5TjI8xhJYIOY3OcdrJG0e04BvclsFO\nE2W14led7zPQCkZ5NZcJsqTVGMhPrmPIgGm2rcWYzoXo4BDwA9dvtPb26qRs\njvUUMYOHZZ3a/puPPw4Z85VqFsTtlHaRzDWR9O5wD292hRABPAarVhTYZak1\n1yLT\r\n=wsdL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7eHxQTk7Gt2rRPS/W2lcOKYM3U3wugH5BgPaa6h+hMAiBeh02g0glniIbKXkIEcW66yVnH7reWz/t4X+Xvn0ROOg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.0_1534539495697_0.9678819786055395"},"_hasShrinkwrap":false},"0.21.1-20180817205933":{"name":"@atomist/automation-client","version":"0.21.1-20180817205933","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"763b997073b04e938ad86400b884b3598197f565","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.1-20180817205933","_npmVersion":"6.3.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2pMfyveEgebFw9yMo/fYdVPdfn/jE/zyVPPygt+to5jV577CCtNTUypYS57naHImjPIwloQQu7fJLK0gTn060A==","shasum":"89fc11206f7533708cd3f858d22310876d21b037","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.1-20180817205933.tgz","fileCount":812,"unpackedSize":5331112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdzhWCRA9TVsSAnZWagAA3iYP/3CzuaxfzHdHfExBQxcg\nGfy/sMMAJKXUFtCcamfgQHCa7e/wcpNwOna0cI2FAJ93laDc9ZTUwWN/FJ5B\npxbrpF7crARipUXrY2TIt08yyMdVnKJKUIGiMts9xxadlNt91o2mHR0TbcW2\nesQeqz+VbOOu0wnKONr/Wbz71K6WvB5/cNuKR+eo6pRhNKDoJnlrZwBJQPWg\n4Rey9LZdICx8903ouzNoeOQS1j4y3vkM64gILKylt6Qokx9d1D+PFF3KxKTv\nfLaCcw3L8sJoHcHeFQfcffmTXjBOaY4off5pY0VyJsOxouJ4AdlEjx79OPI9\nnrSLr246F/w11xofsQsEevXkmB3pv2SdS3gYc55mC8kC0O6UWlKvuVkfSVQr\n7dbgvXa5oPPL4AOBzMzAgoqdbT6h4tS3V05mmNM8s89lwTT8mfLajoM7sHdC\n26a+Eg2Dae+KkwV4aVqPQ2OOkxYefhIyySFcJF1DyvbNhVZdtAxTDZjTwCJL\noVM+wbncHn4RtreIene0yi67c70bnENCvKv/MJh5yKDqSmx+r63gd9Fo+CMG\n7Avac9GFcVcqj4k+XcKQk8jpEij0Xn4UWz9vAawTjvgrbRO9GlKIYZbhbd4v\nhiidnaFxiG7CiAI4VJJV1cT3YFnqMfmKRteWGJrSRzcIJy2scrg0onvRJauG\nrUuI\r\n=xNlf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPT+G+UE/9U1zmaS/0PnkirFhWoLYUPxvQQNa30/QMBgIhANXRrz9+5Lq2n4z7hZGV9e+A9VQHKQfakHPDy6K8VDBg"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.1-20180817205933_1534539861681_0.00798980107931313"},"_hasShrinkwrap":false},"0.21.1-20180818155120":{"name":"@atomist/automation-client","version":"0.21.1-20180818155120","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"434ca6dbf71432898595bb146316416cd0c7c0b9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.1-20180818155120","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BQUVIL4tIYDkiBBrNmolibjXzgpUTMuJ+S7IpjlIY9rcrENeI4VtuxqxGP0cNWdCZmK39st34j7mBi4w/Xk6PQ==","shasum":"91ae742f888ee2c789d7902fa572691861120960","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.1-20180818155120.tgz","fileCount":812,"unpackedSize":5331194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbeEF7CRA9TVsSAnZWagAAQ+wP/icxH/1oW/xf5cX/tgPe\n2UofS5NjU9xVliFbrCqRii4U+K86wNXUNpOM4WGZNKprnAcVgI/lKohIWGUf\nbexxPmVZrw1MAiox+p3T3PNndlxtIkuMBFb2uAxjQoe+UhVMxn2ydNBCWLZt\nk5vQCJqppFFElCBC+FIOPM/xggQTopQJr6ItLjHzZfqtNIPYZMlylhGB/zxs\nJ2V0wqKPjErlzYNblrQAZeG2wyRPaVRZrL0evLR4FF0eZZMSMy3Ls3P4OO4g\n1yivqgCIsX5vLxUJf7l7a9S+qEQFVe3DRfHD0laMVEH8hTx/5WxFSM6OlfRM\nEjEsd6OSPvJ+GVqDHPFsRNSJl9MY2ldGPVZht1Qj3RK84k3q/ycsX78UR4kz\njGJJ2LdV4k9XD05D2CdD+D2r31u0KUDQWcgGcB/Y1q9q7yee3m6xo+S9vXfk\ne4wDqoImusuT4QA4td+3jPshhJ+VvzFSFvUO3QHp3bfrFwGZ6S4FaTtbmOuf\nEkazwk7fngn7ovwqfMaxSAFGRp48tHQTkK6DFdJpFwsuMCf4buw8/JPLoPGm\nE+y+bgsIl9qDQd/9iAQ/6UwbMudGn8tn+zFhS048KcqvCnHxZgxSvPPztzYS\nmotlxG5WZR57IlGSALftMVi01v/bVTrROAPP7j9heJAFs39VGeFyF8Q7P8wh\nZvlX\r\n=4ECB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKa7yh13LRxlVO5JWJWCWv/SKNSyoikQ+hZQ/dsSwi2AIgEdGzkXH0iHJqm9x34gzAfftI7ADAZe+We3ExlKJIk6I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.1-20180818155120_1534607738307_0.4176072047837851"},"_hasShrinkwrap":false},"0.21.1":{"name":"@atomist/automation-client","version":"0.21.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"434ca6dbf71432898595bb146316416cd0c7c0b9","_id":"@atomist/automation-client@0.21.1","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-e4THghMCyZC6vqZjksYRfVPTe+I8Z7mvfJczkyvb9wkqJVsLYXRZaw71E2pLw62E4GAKJI6UnIHCpIFWcxeePA==","shasum":"3c11445555c41224dd7d58fbaf3fc3895ad912ae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.1.tgz","fileCount":812,"unpackedSize":5331179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbeHMRCRA9TVsSAnZWagAAvl8QAKQaDyaqwsEDX3r9Emy2\nEUfSV9phZwVr+aQAlSAF3s8QQ42W+bySan/0/pIAfZLOKhmU9dXGZ1a2N3Os\nof7bgKzS7Znlve4PyNuhplj0bMHT9EweIZVcS0oZxJdQ6aJX38MmSFYhcYn9\nGBxh3QC1nZlc87pdtHQmaAs7G3LKjVCyOBWAmFynqHXgfHyAb9hjMfZD2eE+\nxs+zsS34WonsbpLvN3qPCx0Jq6JFe8TW1HWMwjWtokFbek6li0N5KI81TJX+\nX1oDRTsjlGwV0dsg0ArXUMNIshYbE1mRw3Avmp+/3GJ6aoGEWtKNb1zCwJg8\n/6kMNoRRhYCv4yE6W+ycxZWCGcG9O9tuN50IC8Ea7sPDGwzAIl/gEoC7OCC3\n9/w6/FdBCXW3SBiBsLGKUUyJKBU2D/8NCthrpVqfN1k+2/Aj4jZvlzMPizSl\nvTIcca3zsINlnx6c41AP6Bt6KaoKrlupfA5eFahGNdAQ7iQ8qpjjH+MtdGab\nNi2aX3X40kXw9vD0TNRhbiyKfDIqpyaaA1l3Qx1oVK9OvaTgFnpwob3+vU6C\nuvN68wxVrjEvB6FxjqiMwnNw/wgVcofkIPALhrgoqSGY2z/BDLpcal3seLmg\niv024C2yzwOqSR71wJVgIfO7oVNZTvMN03Y8AvI4pq8opdEPuEXL8vYkXq/R\n/PQY\r\n=aQBb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFU01xhG3dQopsNFLQdTsDajifGgnE9DXlFxff+C7bEAiBFl8hIQUu6EEIgYjO0s1ClvhGSqS7HhF0qba/0YGVpCw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.1_1534620432895_0.6060588736048222"},"_hasShrinkwrap":false},"0.21.2-20180818192813":{"name":"@atomist/automation-client","version":"0.21.2-20180818192813","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"333df40e154d0e9dd98e84442932b9c536b05bbb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-20180818192813","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-H4+V9OSHR8zzQ+G+Ab6Ntul5c3YTMxmXUk8J5ktyfqJtjrTgUjWydrvFJdwA8X4FrGDvYnOnJwbVuNlYzxrfqg==","shasum":"2d28e5d578c2a239975dfd777400e8234716586f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-20180818192813.tgz","fileCount":812,"unpackedSize":5331293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbeHRQCRA9TVsSAnZWagAAXg8P/1Zlh776dXnQIKauiqay\n4HT/IdIsmkRd6P4lIxtCTS1Qr3wSvPwJYLr2e2K7KrF+rjl+3SmsAkGeJP73\nT6Dyv+vkNLGVBkcvgo32NuOJu/YDtbiWzFA2kxMLP3O+Xg7d2OV5qM9fVi1N\ntUT/SePL782lbrxKzpn0/m6RNlzvzra2tfgY4tmc56ekt6W7573985MuzdqP\n+0XYkV3ZDm2QdXdDG1JhwBqdpt5HD47ococYMzf1QRR9hnBNxaQIGgg2kJUv\nCoTvOs5r48/OTYOEYWB/gCAqg+B4Oo0WaZ3pqVQdH6BXQ5SydJ114Prlpvoa\nsv1S6sBtp4HSohOR7O1Z+XJGnOKSXZwqPXNU2vu3Af0q9WmQPY3V5+vUKdly\nfxjKBfq4gwtNd7M40x83ux2y80w5EfNXcgKJpw0olLH45tDsRHnb3iyiYCbn\nNzNApL62dfuYQxq4MeJRfqAuCe7zvvrOxHCNsLQ9W83NA/JoE5MgRM3uXsH5\nUISOU+qOPBZ6XUchHf0Fc1kHc2d1cNlC53emu0n45XAfzKrTQv+JRbcx9IVY\nRtmv0Vhr9TX1aKCb9HC6gZD3DbjWDtFPWAA3avBP6pFULoz6HK+afkHcGlwq\nFPB2n7MVFj+ZSyxOSuGvT0Con7GkByEuRwOIuOBUgvk/9S5UzOWESYk1i/z3\n96TF\r\n=i8sA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwCHpiH0Nj9pTLI+JhOIOVya8v45cgolfNjH1fLZpOnAIgGo1lyVuDGVwf6zcKOuHRe18bNnGW1NGDyOGsX2WmI+Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-20180818192813_1534620751704_0.9441357859683646"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821124504":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821124504","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"~15.10.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.10.7","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f7a0c5b2a1c1969ddb5afa4662495abc0807efb7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821124504","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ulqC2si2fchv5q+3UZuCbUl1nBhiNcgIHiJdF469PkyGW+foNr1o6gLAbKmScKyRN8R9pEei+uooNK4HS8vfQA==","shasum":"8679543aeafc25140a3793c8a1779dc43eeecf37","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821124504.tgz","fileCount":812,"unpackedSize":5324367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfAoyCRA9TVsSAnZWagAADQYP/i2zVfIlX9jyRzGdefFp\nMhgz0i7p8EGqL7Ke1rRIvVnKPP2wpYkHJLnPaIjHq+r9uIurC/KC6w59OEDN\n2gFjH+tgUyq7G0m9jRNWyAduBgxFY7bu+I9Rpduhht6TWsErdqNfzCj7vIaa\na8HWnMK1gYog1CkKBOX3Rx5q+Q7Z2oBTiGGZaXCLplD1JIereNenPQgsYr/R\nRuGbI8k1xvlcqh2prCzHdLjqoAtN1ye6w5BsK5awDZolufElaHZOxd+AyEy/\npL8ymP+q5BX2g/rcHTI+mjahZuUQn8cPqDz1V6c+203j1jsAWqhR1pr0Lw9P\nxd89d2La4wOcN7MhQnN4YTr57OD2H8ZNzfzpXQ0vpDeOFOzJF13um60WkKeD\nRJzcxY0bHE+iSaIE6vGfhAbM0IWzJkPciQzma9ZuXQmAtXNC4zaV+eMz5qp4\nrgcimFvD94dAl2hXv1CW4FRozGXkbaOYPxCtFAJXAy7GydIQZCZXLQ0DinDq\nv+vpoW/osSz6cLShtqpamBmImYI0YtLWdvDym5N3jgdNpESklNbLodL9SrtG\n2hdbGYqDuqT8/oo8qLdPjA+pL0KPZfVj47RO6t/F6PWTbWQ7twzu8dTQqRyM\n7TovE3H4VBX/ZogKTjYYC6LLDw/3JOLaPV4DqsnUc1idN7+9YDG2T6tKXOZj\n3Q3c\r\n=07CQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC95sSnhyiai0pKNlq05M9y7lczy4UVG+rU/LrZ32nWgIhAPRgM04mUW1EcSY+2mXeV7zLG4Y6eh8XFkQoo8H3GnC5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821124504_1534855729265_0.7823777192570245"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821130422":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821130422","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"~15.10.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.10.7","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"580a976ea71d41db99a54095987dd1a922bd41ea","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821130422","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-q/rX2i4KZ3E03BFHRtMR8CDfrC1hnQg+EPLmevhpAWN7E3yP5/gQg4+u501YO4Fv56Wc385Xs6OSxisq42JtYg==","shasum":"73dfbb382084377dedb1e4b03daad49ce86c6804","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821130422.tgz","fileCount":812,"unpackedSize":5324371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfA7CCRA9TVsSAnZWagAAug4P/04u2gq7O+wbTmyoZCtM\nDZqNIcxvPYEZcSWObyKnOMEJqJOo1vHqX/eJy7+/Vu2iYR3BQDKhkNv5j+MU\nie5dp5zwZSfVCEsHdZQpK+JEhVEvuuqDqKO1Rmdyg2Orzx+nPsBsp+h2AlUH\nKL8kvEHBkr+/ZDg3UVc2+qwQTxaPi3msKmLz5Nez22nqGIy6idb9Mj0JXAFa\nuY2jrFNO9rX/qWK8UzmjC2hcYj0JTetR38JTyn8APlzpU+BGFcBz7io64Z3W\nnIHUvEfektt61BhihDpSwqAiTvYnukoQTCdVygUgcHpjVSF2FfHxho6vwChL\n5VI1TYMtciVt1ukHP7oGlf5RseGYycUmEo7T40jydwehS2jpXegKFPn8fhtk\ntHNFdSBCx/PKKllWMVdOj59BgiqlHAnTpczbFwea3J02UOor3tbOJbycscX/\nDH7ACkErRGTLG0BQ99LbeZLQlqLxHu0UT3gxtDYVr55XdbaRIirwoGLYSMNG\n7/HolNt6XvRmkQjAPB852j6UlSCdGq/wEjtz9E14i+X3W9W+W6gni/9cmt7U\nfViZsGBdwGANNOp3qjx29PosJEtik2LJUmYSunTJI8rMamiansjSOX59ZUlQ\nJSRvgHCm3q8kpvMTFlvieLLjJsQUCAqcM1pyw02kFB5CxTFc98YIx+DBaWrH\n6acn\r\n=a7qJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYPvIEKNyPheUgM/eBEE5+ugS5C/rEp4CdbD8uJCCm9gIhAKIX/L8ZD21nvJYi0XeO6o0x5gz/SXg6VG7rJCUUFqzp"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821130422_1534856897432_0.21756192587974277"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821131636":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821131636","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"~15.10.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"79fbc3d1f9fea6619a248aaf1f2a4aed9df4b08f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821131636","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fYVlwkofpLTJ6eHBg4nG4I534TGvORJ3P0N6tpLkh9gn/BtYZvq1YF2GL37sZe2JBtG4lylj0LQdqyVRLXPevg==","shasum":"8c491c01ff53b71401585745ba650e6d916116a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821131636.tgz","fileCount":812,"unpackedSize":5322526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBGPCRA9TVsSAnZWagAAStsP/0hCctLw4dXA2wT1vs9R\n/B2cfQnV5ACdcSfxcuwIUwmns6OcUvNz0/2dJqZqkMmKKDY6bASePhikRu2W\nfGk1yvAFMpiN2yzNUeRsqTjE07DQDhhGeM4Tdg712kJWlOK4FTbUv9WiX+0N\ndH75rKhXyj5aDewRj8pkOYRBBu6WlzLp1Wds2Tart1AyERVRoV7KkJC8i1x7\n6wrwNQ8fLDDo9bNAKJguH2SPeO/gIVzrItKgOIODxPEpwUjDVCKJ6f1QD1nD\njU2al7++4tOh7s9WMEQMG+RVe0/YTQf0bVz4jEnisfPJX88J9dFfK3YO/LvM\nszFwQgnie6Nb96/rFLGvFTb5hRhW3WWCuQILKk1fdULrJIfJzpwwXPWLdiEc\nJ+S+n+zl35D+9a2TM+DrGx98OCpYFiMn9xmhHxsLzQ3eFmdD5jiaVjxuU/vA\nAZqaxtj1+3U1svOQfQR9LICUtTeGLI7EXpSNV1Yn3ybK7WuLzl6eLDoier/2\nJs/eSRCvkjlg+rx3Uz7C2UxU6YjcriNyc8WMNX0+VM8P4sEWID9vgCLuNU8Y\n0rizT//1pYWbSgmp1RwbaQ9+RsJLb+2gHXUknSuoxMO9fmld61XyVzL9oxoB\nezZB5jfxCerc7H7bAivPhwjHKsp0SVRyMIrT8LH9CPJM4sPcnevUej/6XuRs\nk/AD\r\n=C+jN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZn8qnpIvufoYdky91CC0lOidMhMs8PNwtfK/8Zzjy6AIhAJBYx9uF6RxoK53eKazaHS9ogLAr65CiJDGQ7vmUyuEd"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821131636_1534857615329_0.7911525545609976"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821133921":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821133921","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3cca94b0d19dd36202cec7078443e59d95f9cf96","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821133921","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7tFi6g8cjJ5jTAjOLTS61s5Owd8gf0X9W/xc/g7BNQKVLMaiI4AL5eeeyrMDNr5Uzln4jw2V2T2GbkqZv+3qxg==","shasum":"5196bacef6ce383faabd6e035f7e645589f9e588","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821133921.tgz","fileCount":812,"unpackedSize":5322039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBbyCRA9TVsSAnZWagAAHYAQAIgePfIRaK0seSuL87VJ\n7zBoLZN0nmQM/qrLM25J0296TlHiGX8/FajEbwZiygerJgJDDnmstk4APeEq\nDW0V8VgG4qJVoyX+/gqjXZRHam1kgA+JktLbeX+oTL/pfKiI50KZ8HAuygee\nPL1oZ5oHj3e6ZSz0BnDabbjjwddfkfrNOgyRLUAEvyqHxMP8Z9AZ42EV987S\n2EJqGxjUs4naCPciFNTp5M6EBB3lZ5hcyaKKXUphC+Qhcv8UwaecVZ354Dwg\nffGGdggxxbPrD/6Rqs67sQEyOotu7EWW5Aci5JrCiW355IGQdb6WxzPPRXW8\n6UxjBgFw5QW7lrOxxrRoTAqSEzMzIu8iQr/OyEpOwFuGZUxdtkQjMDQbuFQA\nH8ynR9/hiakCTheevmrH78qcBF8rpIgmK3DIwGylHSaUrORrnDbk7Joazxc2\nJEhC6wldlt7U+KL+yGJHCibym5Leeen2p+W7MqdKVDVecbEM2dYf//nZrX3s\nsLVvAbwB0eOmTL9JCXmmNzBmuI5HyRhK8dNB7+wnQaXXz7Q4t5ZJyenyQOqS\n4XZ5+WNU6dF80pRWzuopvqvuS9fE2tBoea3umQjkDzz256MY8phW0p5sKYd+\nz2ecsLmjgLslX/q8FJwWW/rXWEJpnDmlh92eOjJ2lLevSVxTfsoxZug0dCNS\nArLR\r\n=GlrX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClBaaVPN/6vRQPM4s55FC1ZBpcmdGuVDBtUXyLCoe1NwIhAP61Ij6clD0P9DTPpxj0r2Hp6YfEs2Zq1Ejh4+24Vczv"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821133921_1534858993693_0.5473040032208261"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821134458":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821134458","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c447528dfabd5e0b51140321def460ea30cf1769","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821134458","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Lmoge1lXGLzoN825blds1h0fNtzG1wuLngmCO/emplg+NbREi+IDttKAw0owmk958G5IdKVatXw5N1cw0FEPYw==","shasum":"187e691cd8f98769197cacc4d8232bab3436b423","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821134458.tgz","fileCount":812,"unpackedSize":5322039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBhSCRA9TVsSAnZWagAANzwQAJnPh5We2M+ozpY8dEDT\n3bx2pZVyCwO1Y2LTIl7X0sLyxNiH+sTEpqt2AuLs6c1/lUzFDzalxPQZigi9\nSVuQ1dP7SYke9aBwg+X/Zoq0pY5/B5z9TkpXkfsBYd46beY2iorAW/CwNbMA\n4A0y5r6y1necbhgmcLGRLnUoJt96SOeqGA69uoCdAAw41vXJPIoG63kwbrMF\nXlvNTLwZilzh77G6Fw2N2XP/Gm+VwKWAwdLbLzEh4Z6cL8OiWnIBvFhWo1Pj\nxWGD/DMYe1GMDv4Z9d9lPc3y+bbkVseMxl6/JatlWUyQLONJhoDAM29lSk36\nOv71cBwnM2vns6n3ldlrU8ZPWnyFAxkRVXVZKKf6SERpWQRnnZ0ae/OgSuc/\n3cUV4SMbtzM/wnFqWaG/WlWUMHswAsE3guj6Yusz7lIl/XK0r2AInW2bkS3k\n3OhxmddK+oLC7M2ILI0vfwTMp04E/9PjYPkobaTd9i4AiLhgcZVakn/8tyjR\nFDpPR8MxXVPwSgE52HZuN7KsrDc0wsGPe7Li+KR6GsmVQtpwOmm4ljZWAYNF\nVEylZIBfk+NTf6kT74zKICl0P45FguDV6iF8DVae1ELZbag/sUKYTSTDx/Ry\naO8qxy1tN+t6AXYbdUJ2phvgDT4ZijFBiP+kmBKQqhax5+DBPvGP4AZMOL6S\nRlRa\r\n=W1BL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+VJhbLXgIcJGJshra7c9HdLIGJ9BkGTjsFcKUs83PggIhAI72+qV3LjyqQEn8zuLFPHR0X6h95Ury+z7lyRqKJDEA"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821134458_1534859345819_0.2344552949536225"},"_hasShrinkwrap":false},"0.21.2-deps-update.20180821134553":{"name":"@atomist/automation-client","version":"0.21.2-deps-update.20180821134553","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"5432f16fe37ae1bdd0b842f5ad6721ae9d2b9eba","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-deps-update.20180821134553","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-M3Bbqw2099FjkVzx8LmhkRPcC1xxN2lAzUKNgpuLdXtW9OPpJrng3nA0/t2VUyXH3ThFOF79iQzhAuHe1le6ZQ==","shasum":"fdeacbad0aec376728e0b34d660a4691e9c214eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-deps-update.20180821134553.tgz","fileCount":812,"unpackedSize":5322038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBibCRA9TVsSAnZWagAAJ8sP/2c+/4t1NxGZWdwm0Ezc\nhvxS8mrzomUSRbCxrAox4hIUL7eZQEALadCss4u/fI/Phpl+aD5epDpx9G0W\nag+JilU1HzL0kZXs+y4fhPiMmhdStKGKVpr5UOUZEit/ngDwFxZHBuBcgYaF\nzsRwUE2XrMIGERKUxQyUEbIQGFAPP0MMzEmPaJxsBPxPh8XI7/Dm1gZILyXD\nbvDqt2iKaJynZ1VhuQttFphKegF+3uKzEoOrUNnlZDZ2iqAzMqhW7pfmUGeX\n2LFOUQAaTH1LZkmQ6qPOUjbeckuBrCOyt1QP/lCCpUGwfPXx3rFw9A921A5m\nYKYpkF97qZsKkD0YAA3AAuNhEyQhbwWmrtaUbwNgx1hi/7aT/RQWJyrQ0eA/\ndvqvWTOjX6wOOlp8qB9csScdJ6/3H+VGNVzT5rWlh6wrEWj1vFmXBwLj1c/g\nrxtqc+qJpBVOQXdkgOqX6dbfKp+ryl7CpoODKVJUOegqVSuFk9J6R7AIK9tN\nslyzLjZAEHxZrrIWc0ylRUCG8FXD4PrDrglhA8joeDZuu8WJ4+VX8h+NqJ98\nletmutBTUVTA4YnJg2ZPUp4QXYCx9C/XchRthGW7b4u1BhL9KRHfg9oQx1GZ\nMLOJD8v8qh6bkeHKbv/BM+fVjZZQahYxAI1OvcpZwQHxZ3dTzTElzWblbHL5\nDCDU\r\n=jqtm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJK8gbygzKaZq5api+1Cw/WOP7Ol5eBLdpwnKsyWVNJAiByHeMN2CAMRFKHqEp6bkq/BqHyl27/qSNPvPQ+yWi++w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-deps-update.20180821134553_1534859418958_0.11739028633853987"},"_hasShrinkwrap":false},"0.21.2-20180821135621":{"name":"@atomist/automation-client","version":"0.21.2-20180821135621","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3b9090fb69392be02c2d44e2760038a927a83ea6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.2-20180821135621","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Bz7+CwO1A1T1fLiIgejUVyO9RQ8IyY1A8RJnY5CDmQKJ+s+R6qtDP84ZD2eRGJOXv374FG4hi0P8km97hkqysw==","shasum":"5f457544f8596317d963d04d7151e94d54fed47e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2-20180821135621.tgz","fileCount":812,"unpackedSize":5322026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBr1CRA9TVsSAnZWagAAgI0QAIeF/wFVtsJEZGpgwotM\n0ZcqcilQSBuUIm/IwvxKMMOkUjfN18K8tBSocbQDOToIqlgT5RRFEg2B60BD\noFq+4NAhhtKt3toai+twPUqntF4ZdkaUEFyrsI34wOKg1+03TALV/sRsTTJh\nlwa+6tioeYVWe6oFQppehIcVLF0y7uE+S6d0xwjMhhr0J3YXJkfcOnXpHiTc\noC/TI9EQ21aaY03HFD8hT3Zx8cmOjftjXl86mNRNBUuXbaprHEzMFmNy43lx\nz85hIQ23LEJz9YH5q/wM/e+ILNj7S3CaHUtSKyXxWNQJstZoFCgeH85w+qmb\n/zedh42Yw09XGiNEWyB1TTcTbaNe64C1096mVKsAyMW6y1EpvbAzzuMI6JCI\ncIyQ2+sQDlNkTROsNwOBYwJLXym5ob5+Q4ldXUCyeAdAN8+GWGlNx8W5MMw2\nsamBBfavXyb6i4SJEdf+dRf8oinZAsOpBU1tmkmmqbk3Hjoz+tx2o/lL3uOJ\nM+w+9YRaT27I+6ISyZuJSanRuPxulGuwfR7OxsiQ0fTt3zRdJuq39gWnsHKK\ndafaxkBfnbcRe6wZ96m7vxQxGn10AXF105A/bucsssGnIb2vebzpLcfQ0mBB\nsbAJlD23HXyZ3MFuSBfJ+zZQj0HQqFfPJXWlXOCiqJ1xotdckKFchqHbOYkb\nALVP\r\n=Ofla\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwecbAxPb0c7ZBC94noYfGR5nzT5F5QiC+qdjRZgBiIAiEAvsZCUYDcJYTkweWorBFY/eVPrf4bdEPQwwghOR9GTXw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2-20180821135621_1534860021342_0.16929417530469948"},"_hasShrinkwrap":false},"0.21.2":{"name":"@atomist/automation-client","version":"0.21.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3b9090fb69392be02c2d44e2760038a927a83ea6","_id":"@atomist/automation-client@0.21.2","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Iz+cZKWUNJk3fYP5+yyF+/VFmGTI6cySs9LyVjDy8NPH4K53vdNnUo4MCYHOxMistExFM3lTWxLu5z2k/t9pEQ==","shasum":"856d628dde560f903edc2d7786d14cd415c4689c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.2.tgz","fileCount":812,"unpackedSize":5322011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBtFCRA9TVsSAnZWagAA2/4QAITUB9zVWZ/YzXlFhmfM\nM9yFjnA4OiPQ7h6YeJzGzXGybBYVut1SKgE3wI2Bnlhawh4ywfn8GCkX+UHh\nAgvOat/x5JnZ7dSbOrzd0v3sjbA9ff8a/covfsitodlRkFnQQU/hZ1Kes2Rr\nFY4pjV/L4O9+9N7wtfaEg/sX+ZloII3F1JwJj4yJ/FtDLPrrTG2uaiYKMcry\n48t1GJZzx+3KEOQ9FZTvuyU3wkF8XeCccCDcMWkPALexhazN0cxYpoA57kpP\nPlfc+qxmPrtZSTKfgMjSjdcmLMUoYYzIAwBYBIIMyEr3MJ01cKBMf7lavnHa\ntbiQdHQiSv4P/G3ihbHO9L8KH2TMAuF5Z+Hrp7uV1GufbUyPosYNtI4O6/64\nbNPs5YY1VfkiHkOMuB84DeSxz8jqGNzhreAldqCV+8+4xg9a4ytes8e8KwnQ\nVEhfWzp3/JRKG+mRtXMbDZM2+fDK7uxtP5Vv+yNwaxok5DgWLfCyl9i1z1Zs\n7XuUV8QP/1Xt6sU7zLE60YlpRE4lvxA1wkb5FyLmyu3R+tWz3ldSHGhuMbJC\nSKJVn1eUjIYP7ByViT+lvGRQOOkYoeWR8GWB+H9Lnllh5W2oPchSgbAJuocp\nG2+JlyoVbnnSrGxMZmfdM8V1J2p4ZNgC82wvZ1I5RlTEDiF8jhbwO+JH7kbe\n0wED\r\n=2MCR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxpySSJxMa2amkEAtgn/pvLodwFNVe8CbhA+akOFkgpAiEA/gicHGkRP65CcGMicpJ1CozMSXVZ09NGuFmwKpChzrU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.2_1534860100667_0.014934812798628405"},"_hasShrinkwrap":false},"0.21.3-20180821140244":{"name":"@atomist/automation-client","version":"0.21.3-20180821140244","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1f1e0db2b1b8f38e6b446abedf7a7bb6acaf7f11","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.3-20180821140244","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PI98J3o7nNCxpAV8Ty1mVKFNC/WsSP0d+TfP6+ulqeDlR65dWmY0S9RzAndaGulKnfByiGpRG4exTYU2S2x13g==","shasum":"b3bb7cb2d87d8fd2f5b44ff0bb0b2b4c3721d2c8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.3-20180821140244.tgz","fileCount":812,"unpackedSize":5322261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfBxrCRA9TVsSAnZWagAAsQIQAIDNpxDiZ4ejLlxsio16\n5xDdHnjNOCvQpo9vyyilS9kZQbZo9iXULU29BCeLvMquNnp6Brk6KVx/VBek\n9/1E7duRG+MgMzFI7yPZPO45Rh6RHoYshdHw3tE95jkDCNyLin1Z8krdcUTP\nkBh4rAek2ki4JuPWomBcw5I6aQ8Z9JAfQNOYzfIV+ikeCxMW9n9cTT9hXANp\n3nytVbBlcc0tvCI5xJwz8vhdQiXGjOCv83AnFbJY/9VrKL1j10Qx76zkbaCH\nYNU80+g/MlHcFhO2FlXuvKjQAffIhBZHE3f+/FDDjiF7/e5kFDnTT2ExsNTK\nEOOeIK7Ty1SmqiqkN9y/sdWXQzZRWn5RwlZhMdMXqutWZUlgi5GPI1h7Epbk\nxHzOQ+vPKTsCuSgmUCUUP49Ydz0HHn//QX1W3tpzrAH18c1KZq0hNy1kPFpj\nK7+rJzQScgkcIXP9ZWEvlc0GMnQ420ijtMcAxddxOOZsJED9a7E2qBSjgYN7\nQMTsvskkCcGbVfuAzQ2AIEx1i/S60hwJ5Cz4mVi9GKeZc0IAeu9BMM4eFABX\na18cxudqS1YTIyGiJm/eHL+QivqJm9Mr1/fs/Zxi62kqJ2aj9BfEYQNOsFau\nj5DNGuHe7tZ35dAHTfbb1xyyXXPz3Cm6kbatWI7IyS8s5y4uEs7Mpb4PeTib\nJm3I\r\n=ddV0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQAWk7Dn+aEExyXVSbB8bbH7h3aRRY5EncjYk04jPsMgIhAMTuXcePabEHlprOc376hUGa40H6smyrY6iSQsgu0jWH"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.3-20180821140244_1534860395283_0.9767084694309687"},"_hasShrinkwrap":false},"0.21.3-20180821161402":{"name":"@atomist/automation-client","version":"0.21.3-20180821161402","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"180386b813f2e2fbd0e445b066cb7f1f3eb61f7f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.3-20180821161402","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BN+mjgs8Z2Qn4TlSRmRpkeX9EUpKCp7SwUHG/VQ6vbJUb6B4hnWHqCbeQFbaI1GUn05Txu/+2ztT5NUlqAkrkw==","shasum":"253e41cf43252046d2c64ee387b6afcdbd69cafe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.3-20180821161402.tgz","fileCount":812,"unpackedSize":5322361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfDtCCRA9TVsSAnZWagAAga8P/2umnyOGgiOCJj+BlSRd\n9kFFqnbOFU9aWy2OYssbppPCL9Y9DONBUK9c0lyxOTZMtROicWD03H1vqmd0\nNCCsWDSX8XTMdzf/lTfQPxj/E0C0TuF+Et3d5d04/a+EgBIusIkfV+BGeVp1\nhfkJ4Cfb+F09O0YhCMZSUZA/kHvagrF1GzYK8Kl3d5wm8HhN6fvrhLzbQ57t\nx552YRzkpalRNTnAhHF7kHx6gbtvd0mbJB9nHM3Wn/cpeiQ7YDhhIDGpU44+\nT4gN4oP5hq6XyZCimsnzOxLMxyL95A17JcaB904MTV+2y/5SIfitEixvgZt1\n3ai2koh4rP98YwVli8UL0lanWv5qn7GRu+7B9DFHJOeZ6UHFxjV5bl1nw0Er\niHXxhHNMimkk0VSL333G0CByB9t5JRcBYrzf1zhGEAHRhJ8WSEt08F/AH1sJ\n1KdEoAI+pOpbyhxxkNuopjLhWFUFvYMLYdbM5Nho5GWqnylzM1oiFQdaMCQv\npcW7kU9vs/sez+Xo0IpDEUSfM+ZgckDoh0SYC5JQvVYL13/CEgQk2M/zoXnR\nnTkpraR0Foa8kuiFzYLOzej2lgJIXCev1LUsupiCcQrXZ6w5B4fao9gbqGv4\nyxQtm3LLEvJuBTkpj5mpXW4sEp5gSF0BZ1Jb5A/Ay5LyyQIx2Xx7SIefLxIj\nlmqV\r\n=MLf3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1GzcMB2SoH9S8HJqoF1+cgKyR9aD2K7HVRWogFebmngIhAJqs8CVN5C82Wb6xWSMW4NgfhJw3wViwuoUzKLT9yNpW"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.3-20180821161402_1534868289743_0.6540839529909279"},"_hasShrinkwrap":false},"0.20.4-proxy.20180821162036":{"name":"@atomist/automation-client","version":"0.20.4-proxy.20180821162036","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.0","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.12.4","@types/helmet":"0.0.37","@types/inquirer":"0.0.36","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^9.4.6","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.7.8","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.3.8","@types/ws":"^4.0.1","@types/yargs":"^11.0.0","apollo-cache-inmemory":"^1.1.9","apollo-client":"^2.2.5","apollo-codegen":"^0.19.1","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^2.1.0","flat":"^4.1.0","fs-extra":"^5.0.0","git-url-parse":"^8.3.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.12.3","graphql-code-generator":"^0.8.14","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^5.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.14","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.5.0","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.5","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.3.1","ws":"^4.1.0","yargs":"^11.0.0"},"devDependencies":{"@types/mocha":"^2.2.48","axios-mock-adapter":"^1.14.0","config":"^1.30.0","espower-typescript":"^8.1.3","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.0","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b7f29bc29b2601f4f5a6a99dd1574a795789108c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.20.4-proxy.20180821162036","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0r50g9JvZ56vrQEdTrl7KReW1F24no4q5906JpS0RPOkgRg48VglwKY+4RHZal6vZ3qhDQgUaAwnTuCWQOSn2g==","shasum":"f18e8d31f4196d6d9687a7286620ddfc966b49c7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.20.4-proxy.20180821162036.tgz","fileCount":796,"unpackedSize":5310335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfDz5CRA9TVsSAnZWagAAhO8P/1D/nRdihiaD6D90U9ia\nY1r9PZ0EE2me+w+yCKQBgZKjeNBHm7a881hdJVuykEHkYAi0Nt0Nhi5iYm+s\nNRSVlSd9i0aT1GZqbkA2Ba4aFHfnsGe8N6pVJQayWyk0zhuQSmPcAqPxXUbR\nxDuCOSU62WswNgpeWukFVQCkmAoMhmqvdPdTMQ379CSxc0tCG2L2VWG5qrad\nlzsQx5wgRM2ZjiEt/L0drcv7SMPUDW9txmlvIVDvS1ivrNPVNloNoXsSJFjD\nvqGyi4U5IohenrldoAD1C6TF7jXTIu4pMMmB9ASE2X+6a0gtaYtM+OQiMdJ4\ndHz71BDXQUVWWzsNwJl5z1wMlFI3Nhu9kTjet9CyBzSPr3VL+B52GoUYydod\nwEAzHJIj+eLR5wQoYqysARhV/lmt87bYT7UeUlY6yKJVnVs/SLHEwPWDN2I1\n5RUCRcNQfxVwuJLzxjrleMF0jYtCp2YqOs8JunWxbzhaOedsSuk+csVrNMYy\nejklx+hGs1y55C9qogB2dGhdchPKjCZRgS3wu6yd0WehyN4Z2L7Hs9jln4WR\nK3oYZ5inV9vVmpC3o8zKkGZEUe+9d4yd1DSI1AFza24gnDTtACUyCxh8jAj2\nwijsZPalEmbAx0g1o2U4F437NzNAHHs6V5uBaynky0pN64zJGMl0T3FB6+kP\nahlv\r\n=WLCS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhI5y575lQFItNpYsGF36vxwSTMxMEQQdP+5oyEJaOwQIgJ21gHkGnx8nIhSpq8BkGrTdYotBvRcqkH3G9rwdPvWM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.20.4-proxy.20180821162036_1534868728420_0.9914387808191032"},"_hasShrinkwrap":false},"0.21.3-20180821172713":{"name":"@atomist/automation-client","version":"0.21.3-20180821172713","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b253a5ff11853dd79bf8113e883a9c36d684dbf3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.3-20180821172713","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0VHEYUcUy0ptRF8We2o65Kp+Yyizb6WCCxLWAxGmu152iWCV2hom4RV2lwN6lRgyq96GF8B06TgcjrWhNsSXVw==","shasum":"f2dc9250d4173c990649ddb4a2e14ad10869ebb1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.3-20180821172713.tgz","fileCount":812,"unpackedSize":5322753,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfExdCRA9TVsSAnZWagAA6b0P/1pcLCc8rZbp5CqyrA//\noQLuqvlLB1z6+OMMZujfH/RNZMUMVSbx8l2wYkH0yD9Q0974xAFbxJhAPoQV\nY+L+eGi/vdtCJFgLTkq9vktHfTzlflew92Oh1lBqrmiZYiSxIMl2C2UvnoRA\nPGwTzWLY6CeUrO3gFhA18mbhHqiWzrdF8t4j4OLVQbgKH6I5pEuUHKKcR1VW\nVBsHiIcXvYe8t5GlRHPGI+2xTorSI4Dr8NzbPU/+WJoWEEWVqZFrUdqP/JdZ\n88mNzrGLzDx437VhfFkckgeRKOIoVphnryqHzrL9LByAvTFSzu9Ar028YMXJ\nAZ57WsbbN8yD9pZ7ouchNCdMwTOUn/WQ2xoCtB7LYMZy2ebBIxZSob9cWHom\n5Pn2Vx7ceFKHsrp000Pl/LbOfO9wnpauRpepU9xXps8I7214VZi51kkmbkTn\nCO2fZEzlybbhOeUMSR2M2IK9m5FxHCeB+mou4eJDQ4AkL5GF9oOYbuI8p6Dn\nS4g9DrevzkWDJPCAwMQzwXeKb1hdM8Kt893yvV3+ThClICaDOkqKwjze+hvr\nDFbIz1Ug8qNJUI21zckeySZlKy+29DYO673l9Usjm+EFei+PZeB2vQR83CVQ\nXMcufbUMgCG4OWC0oqcohaptpozv9Eglun0RvfTaE/QeNkggoM9+Ib9uIRAE\nkQlW\r\n=1S6M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChg8odf4puv6cuMfym5rCTKly5FujZqbx3h3tI0B4NHwIgZb78Sw/p0IxhgzvP3z4ZrZ8IJHyMWu0czbDsdMwfqgI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.3-20180821172713_1534872668728_0.8116067972860055"},"_hasShrinkwrap":false},"0.21.3-20180821172905":{"name":"@atomist/automation-client","version":"0.21.3-20180821172905","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b936373bb3a684efbe3034041c6fe1b2be6e7791","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.3-20180821172905","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/1U/gQUWhtYdfPHBZW1HtsvPs5KrpFZWjPnbFDSMywmmEKrjm8jrWGJz/6N5oAbX8d4ABtilEoQ0Xl/tvWrTbg==","shasum":"e2636f0a59dd24764d7c744da3fc28549ee0cf7a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.3-20180821172905.tgz","fileCount":812,"unpackedSize":5323788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfEzjCRA9TVsSAnZWagAAJqMP/AiRXIXACzclJTyf4khd\nsfWcJX1xF/1p0RY2Lli0RiWGjZ7olvfciOp/j0yEax0jJrFA8YpSnwzxJDse\nGt8dd6d5cu8nG4c/X9CpSTPw2Jl3pvDNiVZ2PDro5GLohaSZxABiIwFuJiyY\nUWkeyBUUVnhdiA0GVMthlaxw7ooRT/FvCjT1CRhixcRHFw0E80c5FbJyYKH2\nzzkEbNwocu53IQXRsh6TMkVeuj9rWw6+zGcO1OM2rpUsnQIHUu0x3VY4vU4i\nL3iUy6IvNaarY9aK/yNiR3mSPV/XlmFNtV3xZ0DyjUMepu3kaAdwfjLlWrK9\nhOI9cdlFIFA5k1Juy4EZ8u7sqK3LJ9lVXGrEQjJf1tt/RT94Yf+PSF1pqvms\nmSqx4NPb/nb+4Xl+JmZGo6Js3i6fPrX+vjSKOgRKCuMWlcixHubRVHmVorHP\nRUvb7px90/LuK2b2gOOMEmEJfYAFc0OhKv+93Hy3FTnO0cnJdQWqQX3DAhhs\nEXnfaNEZZyXOvt+YkNdB5n9ev8ZzvT7voqPxblbt77T0kQlqP55bG2oEoZWk\n/l/rBQ7un5jtycjbG1PNeMHPWON+eoxfY3rea77VW9OE3umqI0ZaCs7JKqj4\n1VfadX+RqvMkcQXL+pUNflcC33ZDSjLqTrjJ5AGFPZ1rayDmquzngqMRTMxd\nOJbq\r\n=Prpe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYT6Gv4XGaYczIbKZK8Xn1JPtAAtOnnFeuzuhTKF32DQIgVJ7ckd5LD1D8/ShJqcyGOyVcnvluljypeScGJ1Dm8hk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.3-20180821172905_1534872802682_0.0945704768864084"},"_hasShrinkwrap":false},"0.21.3":{"name":"@atomist/automation-client","version":"0.21.3","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b936373bb3a684efbe3034041c6fe1b2be6e7791","_id":"@atomist/automation-client@0.21.3","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KeMaWNx/N76TiYwFa2hLOUVFUGS/+stxyAMiEQgbX4lWqQrdmrF+0rXBu15cZ6dlZQxPRRl+wAANnye1ypKDUg==","shasum":"1764ea0e606400d009fb833e402c7073dc2c06c5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.3.tgz","fileCount":812,"unpackedSize":5323773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfE4sCRA9TVsSAnZWagAA4TYP/RmprR0/bEBbmERCQIv4\nB9tZfbcyyVUt3d2OnRQA9n9qoWUUIbjPGaIhhf8xfz6/unHlADAAbp3wOTca\nVRtz9qtoSv3FOC3Kog7654zkbVJyFnLCTrbqst/qRTAjTNENlnm6pZN2Bl2h\nAUfmLcT0XccFZnh4swcaNMscOS8FO8W6y2fJAIUPFFvIEO2b2eI7LuKusRsG\nuRPkla1VLXCd5ckRPxEAndkg/XjGgh+Z3lqNbB0D049Gq6Hmp5l+cZCurNE6\nX7hBmGcxgwYDnHWDu9u4wmwkO8BtDx7Rw0rzi9RS9xVFiLvdStyfJ1ePzyAU\n8ScLosBYW5XO97/fBQ78xOi6Xdorc2hID3oylzb7P8l2kYTQSGhXTHMhzT8D\nnCbHnyckpZcjgsHpJMqZyYX2zP8K681ZUa3yVTcvl+bW2hB5cN6DOP4URJE+\nJbz4CC9h8iwWFFoiZILdMjZMz/7MTVEfimglK7WY6coB8b64JXQ4JuQapBdb\niJJa09deAiT/hBVQk+cVkXppzVF+4O+lWSsc5uO3mKzw+zfI5W5wGi9w4fTG\nr2oYzAR2DO/Ikr2wKUIqvtagr/oy2e1B8DOcxWUXcnb1yJv7hjXjKg1dXrXf\nmL93bKElW4u/ldTyq/pOekysfOlBgvfexkki16bNIXAxStd64Nz7onbvHkIY\nNj+7\r\n=TRRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKOrPO9nFWwYXdEbczcSQ+sLLDiP/IxxzzZokvv8ehIQIgNnCzgbF/qimp/Lb8u3abPl1S9E/TYCgbZC8tTM09e6A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.3_1534873132000_0.8171071799610883"},"_hasShrinkwrap":false},"0.21.4-20180821174003":{"name":"@atomist/automation-client","version":"0.21.4-20180821174003","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9c37e2395b60693363d5b50602d4fca7abfb62a3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.4-20180821174003","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0a9C34bV48NZNAvDJmGA6JvNxAWrqnyypb1HWrmu09oy6uFTCdWstI8P5eolypMh6creLKjqfwzd74tmOippHw==","shasum":"9b8d808c6361fcea5eb69b00d646f8c14a215c86","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.4-20180821174003.tgz","fileCount":812,"unpackedSize":5323887,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfE9xCRA9TVsSAnZWagAAMxsQAJ73nEFJm3f95naU6AqN\nXmllUIxD6RYYs4aeNsjV3grSuwzrMsG5XxtPBTp8aA1pUK0nMbRewrcDcQQ/\n0M6DRPL8pKYcrZm85jcgEVTz60L6qz62KCW7Cjdu2S5nY0yaGQ0hHDMrCmok\nj8tWRi7XPaYiTxij/4Tb/rJ+KgtSobdWxGIUmoTB+7DTNAa0bvoVTGL9V+ka\nMX2R9uwgissq2m9DIP7Tl4uLJVVGvfCaeKIkn7ey2bdGBauOZxyFtR8EukOs\nVI7nJlKn7i6YgUI1J7hPqyD+y5VMfr57RldUYvVECddiu/TJUWoxXCxYaSEM\n1oJcXrnLpw9CwHp1RGUuzYXZixtVF1LxWsO4+4rvEP1MwFiZCxdIbKdErDTY\nCK+2aj/DxExCP6P315gvRv+p/z7I5t6tWttq6d7jI3zG5am+GJC0QkNIfEk9\nXhGC2G+PaZzWMV13OVap1ncyRErw9JSfXzJqKCGViv+t1yxKD2gcBKP2Znjr\nqBhy+jkJLya7G+MuW6lPAQDMx44jyhP84nG/i78uRyfhXfypUWna0T9Qhf86\nCWca0VRGqStKT+8APHZZClp94RQp7LP2TtLNWiJuRIPsD1CiJeNXcIQRS5U0\nOxiSd8dchLbZ5MeDtEcMkQIskKdDB6ZakpM1XJJm5KUfs82yuyzZ9kKyAf5a\n/Yus\r\n=NR25\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrYbLQ2h0xQ41yCkNcj17yxgfJOoBNurdReQTDqvCjrwIgTIaGjP5CHHqLSxyDz7qD1c0sgCC3+YP89hEx+HHWsrY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.4-20180821174003_1534873457054_0.2952671038015071"},"_hasShrinkwrap":false},"0.21.4-20180821203311":{"name":"@atomist/automation-client","version":"0.21.4-20180821203311","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"34fd92e03bca54371416203db9a1c48fc3de7601","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.4-20180821203311","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JMHm2Vxkshwdyx/MbfimK/CjrhY3wJ8t6oYOY8lQI7Z9BsZvC2agcyCeOUQ6hWj9wXVFYM21BktE4vs/8uj4Vg==","shasum":"cfab0b6c5d3439652e3201e333035d330ba5d3f6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.4-20180821203311.tgz","fileCount":812,"unpackedSize":5323737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfHf4CRA9TVsSAnZWagAAnYkP/1vGuPyBUEbrNAEH01nq\nyPMRbwQH9obfQN+QXugf2cB1qvQD25UaCz7buPm5XfdBFHZNPVm4zSWDBl2a\nrt85D2ZxHC7soViSMyay1EsKPFVdUPTSztsa27YCmddmYtRst3fqaLGh3G+8\nW0utjjcwMIY6FvRNAWObUHEYFGQxRl73XC/xEvOOtyjT/B4c6H2Ilnx30xHz\nQQUKeYAMl08UEhYDoKpjWkaREOBGQel7nxV8/zHeP4653RruBPwOW3U/oWZh\n1+mfX5EXKUuCfQYl9Xp745ybsncUpPh551ipiLbMqprQycFSrS1QRXjZcT/n\nAPzYFPhOKd/pMTe+pSYlZ4owhtm0S9C7eIvTQe6H7mrV3Ah4zZ5x3nTpmcjp\n5cFNoe4b4yZmD+iq6nnitD0dB5jzPrKuhXrn628ensNkoFGDkJzxjsoWMTs8\nyZnePSWh8tiZkx5VYt2m2S+xQzCD69ZEQ1be01mBFiz/FZl+M9uuMPpG7o+6\nsLPLlt0zW+A7f9sdpU6LU7BCIH2UnfDJgo261BZKbh6719PGxxVGnsrz44s+\naH0xMJ+l3Xp/SkMvjtFUgkI/rZuHSHJ0hJArnhxjDzJxxk9aT3Aar8JkbdkE\nubxMOprBJvrhaaYqkC4x+C4JbzywdjoGc6JsZW8GRBfMwNXUZ8T9I6ty5+Uj\nO6ji\r\n=XS/9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGaiib/N1TU+CCnKUayGYg3vivyVwdvdZocaFGhHjrmpAiEAv6DtPqnjWk2NHLnJc7vr3Ro3FK4OChS7MJ/ASCA/0yM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.4-20180821203311_1534883832118_0.10394668483426273"},"_hasShrinkwrap":false},"0.21.4":{"name":"@atomist/automation-client","version":"0.21.4","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"34fd92e03bca54371416203db9a1c48fc3de7601","_id":"@atomist/automation-client@0.21.4","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UNSK15KsvaFm2HlN13xJCflmrH+DpNI/clCMyCC31ZVpcGvQF/084RohAgjlt4VBtaHEfl3wr1wV+iwJRhQEJg==","shasum":"8ab57f8bd063f7ecdfaf56b101a2b39df5d98f1d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.4.tgz","fileCount":812,"unpackedSize":5323722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfHh3CRA9TVsSAnZWagAAQOIQAJpyhHhXaK0U3jJ+Q+TI\nXwKjNIv0VFW5yKZpt3FHf7/90W4WusRo8sWeRUSxavfd189v87H6vBxF7daB\nHSrnI/LcMhBDidfG04pGZT3Cdh6fFrJi4447QGUPALpiJqgwrdjOXW+4thRx\nB820/xAcGEULcHQpo5dQcmqJElxMPDdgxY7kv4sWon63kM9he8YKFY1z1jn0\n1KHO6X9GHIEbwBHYRf6RFkiJRaB6crN/LZo7cNQ/gJ761cp5IjTUy57HRGRM\niRigbYGtw9C17nmERPYL6KbgZeGVaPSoCiTj1cJsNf4VDeCnq61FgKBlQB5q\nAX+ONgv/Y4UAd0p0Pg0tc5Rz2c0rQPoDWZUbjDVWteoOoCI8x/8vDB3xmJ1f\nl8P438qVRUc7s+IqsVEopENPao/cpkTZynfEZiYx2OPztbdyxJF2gkIlBOCF\nbTtTr0f3tzxONlXsHFN9MltNoW+KWtJFjRjIiJsIeTsFj+acx1gbBLfLzZLo\nYp9ZG4U39i/2BS4I9NyIqZ1oevIlV1KYjMtg9lxe8DcNlngpwWGJtSsODJx8\n2KpmFopAy2g+F8MHG3poWtToLglfxISsRl31sIz+cCaWIdW9CDjen0hEGQ4P\nyVPzEejdPVCEJmBWkYpGNFyhJBLMNRLXM2GGIC/1ntVDlH7LLlVPG51KGvXk\n2aVp\r\n=HGDx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqwlgkUPPeABqH8BS9lK23XOdtZiBooglZlzGLQdEoHAiEAjoLUJgmk+l/94GT6whx+5zecA+0EfbRob1nA51ELNos="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.4_1534883958580_0.9059822328008849"},"_hasShrinkwrap":false},"0.21.5-20180821204047":{"name":"@atomist/automation-client","version":"0.21.5-20180821204047","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"bfb3c92958c1713ced4c0296b27391a81b6f2b4b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.5-20180821204047","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pUw/fBavVyk1Yk151Pi25ULt2y4y9mk2d9tK8p0Vu6xPND8G9MpizbIoifgpGi/bxbD+QkDE2n2Id3x93PqCvw==","shasum":"6fbf76373717acca45fe0bae100ea4cc28088a98","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.5-20180821204047.tgz","fileCount":812,"unpackedSize":5323836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfHm+CRA9TVsSAnZWagAAo80P/0xb2wIcgrBgiwYnvSwX\nXve6lQNRV3+Hyg1C59SKnrgUN7MffsbpfaplG3lksbMgBEZT1SJFS24E/YjH\nTcIF0cLdSq0YFHFzZClaDp4FirrpzHWPXxImb7ljp8jp2+8jLSr9Dtg7dPfq\nIhOSuQt8xtjRIZcMMmZjwXt+YxG2DgHvPza1jERRCbFJaSrsSgqbgZJOTbkM\nh1dnDApy3ztyqatszq0oK52JOa/BSlUHf6pD5LbSbNY4BqspTJV1QnSl0oVA\npf94AbnCJNNyXG8X8/0Id7Tyvo9/BnkR53wlRFJVLQGxsGDn25VE9U0lBYzN\nEht6x4q96Bp8LnPJsYMeZAYRPKoz6xnHBIbLvmTQmFQ8vmaT46idrWQymhdM\nO5Q8sWq8nuB8JP+3hoVwnhD5Ads93Xou9fuysjUnCEohqkWUhqQEpYk3LZck\nJOn/gw0ByDjZFZ1TyBMaLJwv8rra/NtEmH/IT9jJv9KTz0TrCdayppKQOOa0\nBfQpQs1eITBIKVwovzTS1KtqRFTnkT+W9NFhT7PKp8yanudJG6v7WmTixq6b\nw+0cphd3CYw1eqth/X7bWygQtWx7LHTWWRV6YBmR/E3OOP0G+D4rBzTuxklj\nPYUg5aprHf5ZoE+990NEO2yXxnsIJHCMqQYvgSRKSaoPqK7lmnpRQ7g2c+7+\n3sdv\r\n=SzI9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbintnHIyVKcDVjSiVkIpJL8a5XpxzWefcgRzaZDvFQgIgfNQ3VeWbtpDxVFRR94lDBUf4xGdkiCz2K2wIHGv+0a8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.5-20180821204047_1534884285505_0.48549982298380323"},"_hasShrinkwrap":false},"0.21.5-20180821205624":{"name":"@atomist/automation-client","version":"0.21.5-20180821205624","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2","typescript-formatter":"^7.2.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","fmt":"tsfmt --replace","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3acb799f3dcd4a3c165f345c864fac91f1e4a6fe","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.5-20180821205624","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qEmiOouDfKaxD34fC94KnYnBI4loWxCuhuqgv+CGJ8x0aFr7ABSUwLpynPkw6CXIHkZ3rlwx9+Kil1RfO3+myg==","shasum":"96387dc88e7140edbd325293f758ef4862e915f6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.5-20180821205624.tgz","fileCount":812,"unpackedSize":5323928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfH1nCRA9TVsSAnZWagAAEw4P/i5Y0YTVGXk8+TEu0j3Z\nyeYW5gQOgHH+ls529j9nXJwY/RXRY8WEKx6MKpaWrFOaEEgzm4S/Mp76MsOk\nKPwZjmaxqZWpZuJXeW8ae/th2F22UGZ5ysdM9GnbR8ENCcINQDI2A7ytY4wE\nf+iD7t4TdA8T0zanaZulD+zL85pWU49UhRNXzD/gXRPzFI0isd7Wtd4/yC0J\n3s56A7mTJucy0X+QTdNgeD0vyiMtlN/YSsD17unHlTMh5WB7VwIOhE3QjoV/\nrfh2ORNYakgeLJ4NwUUWVO4Iqm3DNOXBCqmL+yFLW17Wa/UOgKfBX6WssQlZ\ni4SqdbpjcijbLrnR01X+1xIlS4e5ZV7t4CP+qUxiG0S5dGVrVFfIoM9Idnlk\n3V9GsUog97NWW8RYWaX38n5RLUpXCrehJQr7nDc+KGB5UnxhiBo0rQi5aIDU\nm20zLRP2/cpXbOEzck3FyP4HbMQPTQedt7AmTvCvdjL0C7bK4Ysyr6C4vzI/\nmsRVTJ5ta74Di5dyk3+z05p12Kb3mJeKi629wLvamDhdsWZMgmsTMmt8JRqN\nhW/eQCDPvkJ/7XhRMc0ieUElp/36PYOm+QP/JfRtxVYBbBI6B1JlN+9SfplQ\nEhp6K+M1Y3uFy6JhV1n70XA5F3lyKfL4R+2Mqv0jSY9cn1bVLrtX4dOxhFph\n1X42\r\n=InsW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUYZnQekaRzauP3Q+4+Qz3OgJdHzYZsHVHN/LYZNBliAiAN+CLqUp5uR+TA2kIt1tlhiCqgptsUD5VjBQQSXfZidQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.5-20180821205624_1534885222635_0.3342258473082813"},"_hasShrinkwrap":false},"0.21.5-20180822020855":{"name":"@atomist/automation-client","version":"0.21.5-20180822020855","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"40e786902a813ba1d484955be2c8d5049be9b8fd","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.5-20180822020855","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GajUidrnwgP9HQybQAf6pWkaK373jeaLE1CVIuPJe+T7ug+zUNhFR1lP/WVl08FqPWrSflk4fWbgcTsBdnW0hw==","shasum":"1942fedcae6e32c8f0677fcea24c071734031138","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.5-20180822020855.tgz","fileCount":812,"unpackedSize":5323860,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfMagCRA9TVsSAnZWagAAGHUP/0E24MO/JQ2rSvnSENAy\ndW3dHfk5cD/EM13ETV0S19gx/PV1ff2we/mEwXd9dokaqwBgzN2iZCwhtv2A\nRbw+fdCOtaeLrlXQ5ossO1/+SHq2/CWC89RyDSusVWEUxJSLAuLMzs+si6tL\nl9SZhlL+KZWSG/mm8mMV/YelorN8nVHxHKUeqzig/bLo/vBfFg37wHleBLh9\n9L9+tywru+cEKlwtW690nWfVHRGD4aNi80YkUFOvLjrj31jJ8PhTUSMcTF3I\nGiGmG/NqhFivFZO47ZIhnLWN/yIouj2dxh9HqON5hlroNoxs5QMhLcCXZmRt\n9y7SJkPGkJT2dvI6X1a99jrnrVVAwOGT4BOaXEfkb+lKwOqFmxmzxpFpjau0\n5LIrwAbfacDAk1bM3pj/b+Sbnpmz5eSySUg3la4xI27/WEDheA+7nag/vSMh\nCvrX9tV5WtiT6X9/C2Pe9s90lIi8D2Ad4Fp70AM3nlW3LLTdT8F3kk5r+av9\nvJXOtxl9dMU4upQzbTSEy3O1QPUtay0qtx0CN4/5ei7oQNIIoyOwcJoqKZXe\nXwsU+e3UqEk+r9aRNW1Nwd5V37EQVKYTYY0/S0ed6J6M4k/mLloSfRXmgjYv\nx+13I3+jY8BIWN3YdkWbCFGqabsrapiPQEbEg8EmfriyCn5poIaLsmBxcfQH\nh3lj\r\n=jxC2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5A/z4gvrB1z3y4FDKhE1OFAdG8B/Mjnkb9c3vwMmznQIgBI409lYl8hjA/9Jqlbsk0JQ71hL5FzrJdP16MY0znkc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.5-20180822020855_1534903967990_0.14020589823031848"},"_hasShrinkwrap":false},"0.21.5-20180823100823":{"name":"@atomist/automation-client","version":"0.21.5-20180823100823","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"7e80be87ac3f0ca704ce7c1b39547644b259c1e7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.5-20180823100823","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hy/+G966r4do7HG9CCsyVU0d5YkISJglO7Ilv5ccDQEjVt+UkPsM2VNUxCYMoGvFbg1GW2pMBmEvV4wMEzoVvw==","shasum":"0ac3e07f39e10ad0ef1dc54f067922756def7004","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.5-20180823100823.tgz","fileCount":812,"unpackedSize":5323861,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfoi9CRA9TVsSAnZWagAAJHAP/3GieUdP4okU9UqeHseD\nMrX+OPB7oMH0FP45Liy7DTuvSDgt2nkGiSSUM4kTSEW9G3bI8V76Qe3SeCwt\nXQKYNixsxW7SMr8+GglkV4T4fi2zbIozUN9gliK6Uuye899oj+IMo41EGIGi\n3xncb1foftA3vpOkn6rl0GUwCU7GeiGkeEzrDkZX18eSYJ1BnvefEvEIeNpW\ngkh+B0iaquCOP/5hinjSnkMCtaRyzXMHAkXVmNdMfgRa9GG/o0xIMQv3r3UL\nnCxErZmFAtPWL+/RIB5xui/HwCv8VY3pxuAleq6WyCa9vkyvd8rshXzqyZ2s\nb4VTMFE93/jkMRUWcaVbt6Pw9JaP58B1yqdh5DjmiF8bsVFTML8sOdqr3BfI\nXg33PKlHCZBw7JYY0KY2bziU947U0IdavedRX1TJw5ViEOUIAyXMqiLQsgrG\n17I0qnw+neGcjj7swmGBrdjUEp6Z+xwJQz3I2l8OYetbSpiskWQJgFAai0jh\nqILqpdLQ9zJLkYFGLq3p0tyNtO6ixBeySA/DgqPKyJXJ1L1F8612NebEBc2k\nbp1jmVzagOAZMxd55svqQ1YoApZq7kLUhJtlu2WHip2DHTB9mZ1f9yW6lUHe\nsJZrMlODMfh1isPUDjXqvKxRNsN11UNw+4FRDO8PKKUvbM16LKnWc2J0KCf/\nz+RD\r\n=eQl8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDREMQYHvoHC5eybC1WSyjiI2qhkTxyI+23brM9pEAd5AiEAxrEjBoy0dayjqXccEA8w9HiuoAHhT8KABcyWFami2ho="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.5-20180823100823_1535019196970_0.5398864286309426"},"_hasShrinkwrap":false},"0.21.5":{"name":"@atomist/automation-client","version":"0.21.5","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"7e80be87ac3f0ca704ce7c1b39547644b259c1e7","_id":"@atomist/automation-client@0.21.5","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hnNBefWkpF4mMXiqMoZYuIDI2fJvSg4xQUUD0j6E1HxDyPDs/7pxmUtoLJSfu+JxacDOxIJSXyj9Uyn32I5LUA==","shasum":"98ca628685ad724a0a754cf53b23ed7a802af141","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.5.tgz","fileCount":812,"unpackedSize":5323846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfosOCRA9TVsSAnZWagAA1aMP/0U09AaM+vavL+rIj8ne\nPmc2tnoLCGiVyuWeW844n1f6M5XZVnIWhllOJeCTupMTbZ4uScnSuQubmE4Y\n4BsfhKAgpAA89bGb2ycKCKqSsabGsRFhdhRdWhdynaC+FoGmcq5AZX1dIH08\n6JlsVwhFzd8wF+yvG1ooVzii+guqHC1L7mgfztfydOFs5HHfjcnX6WpHPRI6\nrtkNNFSB0qc5TVBl53GtTSeQzi09jeCwjVNxe084l3MtXRyvjzgcZSdaSd5W\nbUF/20AqM65Pba+XVIWWABLP4wJGfoDKVH0HptLHL1BUELjoDNvFkTiKIDqh\nc2vpxe9MWdBiAP0WgAsdDSdcAsBdPxLyxJZ5VOi1dgrxQMuYZGLbnrID8M+P\noPaC1tNP/hIUvpJyLTS71/15rnid9N1rDUltVaLnlvKG8Ojtg+WbsUYXJEPi\nY9Hfl0jO03ZDJlaCKXrBnUH3tsMO7kjeyuHXF9teJ27kJ2T7X/V4Ph9VQaE8\n4GqRJ5UqRqxUi2fCEFgv4ChpLH3sHNg2TUDGFRsNhlO8T7AN4u5E+SVBFLt9\nXxpMBRoXekSOOLylRY0qa0QSfwsEZz1cJ3DSTa1o0Rspbqveu5E19IpdTUlS\nmcTR8y9eaNxAtSkHVFlj9WKcjoe6IXJn+iMJpphwErU5ADx1hy824etwTBbJ\nT25Z\r\n=Grku\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDild4DXDMXLMrVQgvZuibx4qRrV2MJdNpNaZzWn+KM4wIhAIZZ8PmYCqabrMOS+PkwH6/tHzUfPexGzQom6dn0h3O9"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.5_1535019790113_0.24602932382905807"},"_hasShrinkwrap":false},"0.21.6-20180823102447":{"name":"@atomist/automation-client","version":"0.21.6-20180823102447","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"eaeabdbd7bdfbbf3d5d6c55da4039c6170a59bbe","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.6-20180823102447","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4vQ1nr7fqKCzKsrw3HuS0X3MCCrviV/sHJ9ysgEOD9ljJaD3kvgVSJTtf/upU/E6NXeT/olm3zfVbNXV9b2wMw==","shasum":"50f450edcc56f8badf96377b0ff5ca2aa12e8afa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.6-20180823102447.tgz","fileCount":812,"unpackedSize":5323960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfox2CRA9TVsSAnZWagAARToP/2cLwawmbEIWlfB6+Plc\nATEeFOUTV5w0V1NbjDbccOAM14rH6ADeghSnLy4dD4ASyiIFrcK3DrADlZPD\nszemTIhL2kJGQ1ZqU4Ar1a/d0JY4QLcpHnmbRxendmsqaekaw4i9EVe4QMdF\nwvPowgaYSob5k/XFEl9I1kLowScxdf8d+eZK4sQ+ZOsPG0sh2lTZe50YS/nW\nMZdFjA/XzDACXEXrPZma0HIlg9D+EN/OUtpaC/TSBJZzJ94owudH4I0uk35L\nVkK5OV10gLAmZq9ARLqcaZ8CO4tdAiu8aYdZLSonKSS0Oh/tvNZAnfBT1/4f\nrSKunneGZkGmvE92rlZyOUgrrk7dVqvxu55+DpdIIXqVxe4LXcAJycRiYsMa\nPZSEO0H43eh9pqocfPn1ed7+E4uQo3N4MXVNJJZP15aaZWdSw5wLXSqBw6VG\nQ1JAH7UciKCeMFu7PmUn6g0pzy16pRqd1H51uIDQeRiL0OsN2EPcTcC+uPj7\nhyRXVdYqA/q2MjRz8WAUEHpfn66JxN66wTsZ/1V16ii1VHNClN7M6bakGXT0\ne7LoDdyrSwWQ3cYDKxvafJs2ysx0AL9Tc/UgUW+DtMUbYwlV02TTFiY489s3\nkoGB+Ku95NHfi/NEX1aYuCXSGD/a5mcjJuiRLSxSsqbmBcG14hBY1NtN+v56\n6WOj\r\n=BzEv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBzpc/IQKlF+eU4oybV+C+8olTQfH67wjGqUbGeOdTRAIgIx726GLoU73WqRqtV2TpEJeU3+4/FjQmSs29VC8R0go="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.6-20180823102447_1535020150175_0.09335887737851878"},"_hasShrinkwrap":false},"0.21.6-20180823121022":{"name":"@atomist/automation-client","version":"0.21.6-20180823121022","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c010ce1ed2f5a888d7c7b605461e53093d35c58f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.6-20180823121022","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XwcJKrS62WhNE5Xo+VT9BtHFz4wFZWaqSGlF4xaTKv+Xcvx7sesjEHOtdiV66vyYiRy857g8aOUFjuhl1k4a2A==","shasum":"cba848a121f8a25518e50c6977cbd5bea3db3a10","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.6-20180823121022.tgz","fileCount":812,"unpackedSize":5324039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqUOCRA9TVsSAnZWagAAj/YP/0VEwE3C1PyRAkREN463\n9paruZ6im8k54BnNNxYc/zBckNtklEk9sgwUweKxIrfMpMEG6E77xwG62ZqX\nAW+AMoSa8Z7MY29cTfCkdEl2gNMMPG6bAZo7UG/+QgMEmPLfA2WA4zIohWPi\nt/i3z8jsU1w/T7sgZSck1BR4a+ium3CH6ImFycPryBshhJBMFhNdVsfXkU3k\njWvPaib62BXAhu+G6tim1ACVOfskzPQ+7FhjOkFF+1QwO9HpnkzvCyRR2m1q\nAMbk66qGZQzeu7GP0bDnVyx4qJPmujU2Rwrjod74SiljUUnCvStq3zEpZgPz\n4ce5vuM6FarKYvk3aRZNerGWcRLwTy3wKUhjjsCaDPaedzvjb6+hi82Yf63P\naQ1RedyjXBWD75u2E7Be0aXdgSJyjZMC5m/gQ2+kqJ99TLrOFcv0o58s50tY\nsCB91Ymad7RMKdyONdxLQ9BUMDA72QPdr9a5UzhnK42/HbCsD67lBmRGvgH3\nEclwTZDPn47DnXTeXCHinCvPOmZx0MKv+WFmkdUTX0oRGmJmdj1RlNhbdSfR\nZDDQRr8oAjSFvT/phYouvp1VqGGIvx7M+/BYYFbCtvPR7AfUo1ukgywO1Hm3\neTfJ7EQQpxnRvMvsSuZoybiZkaDeZOirrBm1v5o505NXZw32Mxl0cj7MsT5u\nB9C/\r\n=uUm3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmx8gurFGLnp2wNqZVbFgYksrKfAdHDsa1GojxVsueSAiEAp5kfdWsdKiTBmfjD99Fbsd7myPNtpkouE9lqzinZysA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.6-20180823121022_1535026446075_0.8320926694843414"},"_hasShrinkwrap":false},"0.21.6":{"name":"@atomist/automation-client","version":"0.21.6","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c010ce1ed2f5a888d7c7b605461e53093d35c58f","_id":"@atomist/automation-client@0.21.6","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MVdFpljutOHfqtk8SIAD59EzKuVOLOWKD4R00modXmSB2vk3sTHvOSR5I6FYpYmLd1uaqyGp+eBCXr5qG5lNnA==","shasum":"6dd3f742cb3c2740ca0fc31d47b9295dbcc3dfa4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.6.tgz","fileCount":812,"unpackedSize":5324024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqWfCRA9TVsSAnZWagAA6AoQAJ5ijc3K1Qy/beRlFJy5\n6SaA2EkIgi4ITZgcT6BizfSnWf9TIkjp/BV1Pcdbe6hu+PaK9VIPTYEVR9vr\nh+IXuEsNYuyrh7Si3c1SzOBSHC8mbyBnhMpXBWbp8c3s6AnQN2sSc91mSdmv\nTLGCecIVeOkFGEle5B3Lb4VnYZoICwZrPxg5DtIlSAIGjZh3lkSXZ46fCFC8\nREyUjXp7Y/9kV7OlX7djz+0MGH2mZLdHzsNA02HOS0fd5k6lA5GXh7gLaKy1\nh6M3YfHreI3lN9brhckW4dGoJRj5AUvwQAhvGKteYkwdFaeUGzlBLke9CpZZ\nBb+LL5/8It6jLVihMk256BEylLe2jPWkPVcL/AaWknWs/vniiBKTJR0T4cqZ\nM2DyYIeSFSbEsPSbzjnV1CkJv3b+lhJMXrbYYR1gRuryxWJL0fW758V6+1G8\n1BffLRMSc0fBgv7dV+EeNXQZFZRPIlPjsMy7V6LtyzHmqGFz184HlJcLgPgL\nFLEkkLv0yrDODHz5eQ4AzkzbacaN4YWRBw7if+PCFUAVb4EEwAxOgz+63XLn\ntAhfeF1uXkGU/pOncnJBFH07jWIKhge2B3XgUWCIAUkAmC3H3jv2TXdFkGum\nusuMeCPQhp3Q9QvMkKr7BOov+D8KJ7L0Uagasw+teAXVOXz72lr6CJ8f5bGG\nIeM1\r\n=d//n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHr4I2pHMbYXZ3gYoL0LAJn0CM7XPhn1UKYewOCwyEJRAiEA7YnGbTy91c1MZtjW9bXGvuYnMehJHf2zkFEroemwmiA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.6_1535026590686_0.7564199493872563"},"_hasShrinkwrap":false},"0.21.7-20180823121743":{"name":"@atomist/automation-client","version":"0.21.7-20180823121743","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"62414f036ceb87c508fa0fbb23dea606a0cf43f3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.7-20180823121743","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PigheoEVGrGS7f/Q0qsc9l2/vOI05cF8TwGovRzOL8iGKC02GHbHIHywU07qOKmRxxWy/mmcDEB9tu3TNCQKLg==","shasum":"ba8f7136a83b7697a2fda7ec1eae23badf87beeb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.7-20180823121743.tgz","fileCount":812,"unpackedSize":5324314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqbhCRA9TVsSAnZWagAALCoP/j1kPGAfUjb4ILOE355S\nk04l+46EhjErx9Qd9wZ/Dv+uoIa2AwpsKj1yTpZftTRe60azKjSUxOfdYD6x\nnCBe+LJrfeXtzv1szLUCboCxv7YRtNsHQDwNwN0pf2hRokmPCWGmBfdb8lhQ\nN676UT1xsoe7hgqIiQiCXUwqqo5RKpMIURsvBHw8bSBju3o6+wz22zd7Q9Yq\n9ltt+wr7kqcmngYMvNTwEDWXMfRIquv5YW3qv/byRNf2dAML8GFCZL3wEWph\nb/Bbf430n5c8gmxlSKEdADAPOo1NaRmbKC9Q+HPMj5dOOCrYpucUt5j6YIzq\n4mr7PcaRfiukYYwsWn2d4EEuibW/MTrvgClhlChZHRtxKN994I27pU5/jeLB\nkHCBPk/ooE4rQW5GfBkYuxmIjnSCoAzz1BRuCRabs6nVXJ9EKSx7oD1iZb/k\nqNxxAVNhPY2Wpwy+FRovbBGaeMDhrro7vW81Q8JnqFsbUCZ/7LGqWF+8EX4i\nW40TKUdIv2ZweVKKP97qgzL+OtP0wW3L+KJ5Zs42YfjjK5ikShdFc7GWV2dZ\naC17G1CruO/zI3mks+hsFRavlAQiT7yHnfXa097JwjiOzmwAMURviL/YW9FW\nsv2EXUbAzwgxO+hEQ6ui2uL07GXQYqVha/TFJL0JCm/KybVI4WXhNzDVBEW/\n8piz\r\n=8YtN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhntVUU6NIJlTJwqzzSZ6a4tUkabV2KdF49535nPz8fAiB9lNx8pUn5z5zBpChKzzhso0tjbnKjS5Jc7jXn5EMuoA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.7-20180823121743_1535026913120_0.6550521047006419"},"_hasShrinkwrap":false},"0.21.7-20180823122629":{"name":"@atomist/automation-client","version":"0.21.7-20180823122629","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"97290a4887db4040cfcb0301e862f94e709c38cb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.7-20180823122629","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1rGrxbvWyWcX4bBcUtly9d+UvSwkg1H3wmZyj3RWL4elcIIj2JMsMmtmmrUGsYjvaUHADIFYbOOjwDopSKcKEA==","shasum":"7096512ffc4088406742362c857288a5ce5fd186","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.7-20180823122629.tgz","fileCount":812,"unpackedSize":5324274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqjdCRA9TVsSAnZWagAAiL4QAItLGNRR3LgtfUFFIu2/\nB71GYkkbKXeHxdjPcmLJsdO6QRZ2xHCiBnHrsKeqZbWChfaxfXPo4GvPuYhn\nflil+3q3LEWAcBQWciKJVtR2gXLG6j7fNT7qWQzQTJNIHOAjseIjLfrHtXej\nxeHPh9rYS0b6t5hCpShzd+FzDOCAvzma4L38pCmYzUbLZFtRBC5SP8vESZ8B\nfaOfGt+LHZYnTznKqTqgSQnb++COWJwomjhs9CRqFWnA/z54aF7v2qacORHa\nBruQJgifuQiWzU1XbFJ5t3epQIp2BDdESV1NuuMwx7v9AjG0fNsnrvQ76qfe\nwA7YO0Lofwdj0HATsBBQJ3YYvdCFkTaApx2eG/2iBQYRwGlj4ICXIW6HAHYO\nTXMNScUS4HwSeZ+7OyQyauTfJiS4WTWe7c0duOiSQ5+RJjXPn3GHrmzY2+/v\ncNVCEb60+d6YFV+sUwGWsuPWkMPOtNUmff9D1J2roU1nW5UBxDWcvyw6tTnX\n5S6BxuNrnYG8z9GfpxVmztH7mtmiod26+fRDcwiLM5exxBuc5j0x0NlNyCLu\nrAftTwz1I5pc6euFgabUdM7v6TZ4UjiWJg/VKEbdS9zofs+szBfGJCC7L9eE\nFXeN1bYFRZeZXIWEMlEN2jlPinZjV+HJJWE7B3gtwxkRpWwY4nEYBk2NG4Ei\nE9y9\r\n=jZOO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5ncztUsL/urk92+Oba3YRmDD4vdKvmCucwyru8Q2GegIhALZO2kcL2ZfLBb++AbSB1sPtdHbXi2IfqEOp1oLpoMjz"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.7-20180823122629_1535027420602_0.3738989663150163"},"_hasShrinkwrap":false},"0.21.7":{"name":"@atomist/automation-client","version":"0.21.7","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"97290a4887db4040cfcb0301e862f94e709c38cb","_id":"@atomist/automation-client@0.21.7","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RolenweWVV65Ei+Q8VGua4r/Ni+A7hIeFAdiyzyubwwZ6//ElMpTkew6d81oZBAxDteBbSnAU/Cn+eiQpvI88A==","shasum":"eeeefbdb045981c4048534e71663102f5f6c3313","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.7.tgz","fileCount":812,"unpackedSize":5324259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqsHCRA9TVsSAnZWagAA4TcP/R4XEb8BKbzbxlZoCrku\nBSfWlA/TtOv9T5/FtlG9NKIvQQM8lOEa59Kr32PG+3uCVupM6stIhXMbItpz\nNXTKADv01Ji3VYc900z9OwsYgbOfrroX/HmeMajaI4FZ8C8igoFwp7lti7px\n3PJNxCQsCQtmazmTiZNBH29NQhX9WqdySeesgHXu9ZuwQy9wc8XYdRu55mVY\nZrDkxeH38goOb/gEpqebh2GQZFYNZ9aJKWBcQR8nlx1hhAuGpvP1hcIS4gx8\nH29tG+Ya/73/dPrWHzHewNKQVonNUFSlT7qGSH580UxK5VcuoDR70KACpkJs\nqA1qR1wWOMoRzCzHTY1fMUQR0lRu1OGqDeEUroUseWMGp24sB9+Y1npkRLuW\n9rCjqhYqbUcgaecnM8A1OV1XgCfWSh295zzQAHhe60nSudz59vmMicbBmsO7\nD6RZtf34bUXebSAKAbDG0mQ1crNnwT7kg7reagxd3GJFaMuALPmcfTSEfBWG\n8TqMrtLH6NGnx2/KUj9Byp6ROEja3TMV6+5TnZG1oEeNktVFRXz2BmlkqDGn\nKwHS81e73H6H5DUm78W59K//RR0eEArK+oA1pbOazdLyuFZ/XS0bwzqdvbMf\nGZGrkz8tuMrt2KdTYUEy8HdPcNyaleDOAt4Ab3uWNjh243qD1KYX+ez5RxnD\nO0LY\r\n=EbSJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdLtYQbLThnxZTPATOO3jg+F7/qp5G+r8iRTJcjT3GNAiEA0CZ9hzDvBr7WHReOnLaLO1wZPS3CsooHNKubZTuqIJE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.7_1535027974967_0.33551257844213533"},"_hasShrinkwrap":false},"0.21.8-20180823124031":{"name":"@atomist/automation-client","version":"0.21.8-20180823124031","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"8f5430f3e0e0f1ea1025b3ae03509da66956d7e5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.8-20180823124031","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-af/Vmmymk4EdkuwLeS006XpTCn+UO3AP1vxBONHep6Xi8cJaEt5d1I+vvJK+rpD4qWi2oFm1m/b98jkqg6DJJg==","shasum":"6915ab7af4f3fc087da07c8c3e5760634a2b681b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.8-20180823124031.tgz","fileCount":812,"unpackedSize":5324373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfqw9CRA9TVsSAnZWagAALa8P+QE6ikYLHmK3WjS9ajsk\nY+nymidwUflyY5NdQyXv1TVGW9b6lOvUOKAwn2zl1hHhyHy4HMi5BsLjSHFr\nX6wvFY2gSk74OiMXCln7PpWSQT5msvnydSzdJ1G4zsj1lNjtLOyMLhI8omQs\nb6rt6YmbVlj18OcDc0QnGrK2l0AGIDBNMnWCD7RusbMjA1Wv9kZZpENaC+Rs\nPfPRaJwVtygQdMu3VdSYeSM7M0Zw/umq0cwwLJETlZKD6ElUuHU/JIkJYaRH\n3FY7yruuuE2E0sohtVjGMRMW2MNLESRq57FIwtT5x+Ks/ueQ2apyyifHo0Dy\nYw0BzMsyazMf89vTVPJtYbqgFzd2OnmfCITz/4MtBpjPqOF0B0nx8msHhyXH\nBlWaRB8+G51NnJRl2Fhvj4w7MtHLSJQhT1HqWqKAvuF2SRl8Jte8Ok/ew1zk\nHOIUf0mBtDSFLwNdlZf3urPTvkPY9JKnhsq3bAQhrP7wyRiJSnqYAel2YAaV\nUjExLcF3cT7zQz1DYt7/OxWE+It3r+Ik4SzGgX+ITFu4MrG185w9JDqSH/6c\nXMrb99E2VU04CvMRuL0S6ja4zIehFWB6GQnSTP24okovt3/0MSsJi2johKBD\nBtaZ0Yz8Qms2h0dIuv/1deX2SrzBVqCaBNuJJP0DIx70t+gmUhxkbY4odLhK\nwV8T\r\n=QPZ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDVAh3xg/5z5VZNbANf9i9npq6I06m9voQCgfV/UNucdAiEAz+5Tttx6cIvlY3v9V9E0LjELuLszc6TANzC3pEAp0lc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.8-20180823124031_1535028285187_0.8884932434259059"},"_hasShrinkwrap":false},"0.21.8-20180824230634":{"name":"@atomist/automation-client","version":"0.21.8-20180824230634","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"afe5985e504001e3c718f7594e7660649b8398d4","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.8-20180824230634","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-26j3VtkPVY1kMySnu3kwAPNIi3r5yVU0OE1PmctWuVbNt9gm/oNmYeNeQ6fqp2T/vmU4PssYqv620JzoPtoN5A==","shasum":"ebbe8b6f697da7fa15b4075ce936a804ceeaf624","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.8-20180824230634.tgz","fileCount":812,"unpackedSize":5324376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgJCACRA9TVsSAnZWagAArZ4P/RAmyVf3shGyq/9DFI0q\nk4tv3tTA1FQWiZRArnv4U75l1UdXmOxBcX4ELMRGyL4VmUtQmD7jmCtPhuSs\nX134zJWDgVcLcK8VpGOzXzt28VsvUwLiSL5xA/dIfcoZ0FK5PycV8lVVpWpJ\n9oNBKejmzGsUpxVcITj4m1bwL/LZN5qkthiUDGgFcutx3S08xqUJtDBkLLEQ\n+fHpKY8C/iRXKfHlILWDxJ8c4V93i3KM1pMkvIpscFi3GY/7jfR0dkOxxWPC\nInVmJtlF4Nbnm839D58CBrRo1OzqF/5n45A29qrXR3g3W5EyJtJlqmw6v0Hf\nUNby5pYAnaAscSzLtcBOSORzpxOVN6IBXiW17IxoX7BSMu42Aw4/vw2pKFWY\nN66gapjhMsFeqUkHdMjvZZQLmDmWadcMazTBSVJ2XNafpmaMcqk0GVEI9ag1\nkw3wQaW8/nXGM0t8adMDVJOqNNDeUek6t8kQkpIPRTWiNHa2f72PaHyBfLrn\nie9qwP+TcEuefgw2RGSfEUKe70JUqAX7c3oeqTQDcJ5Q+RBxRmlAG4Je8Let\nzB9/KoYeCunpLtAWi4sgxjmbokDpBgCwLZiwj6Zo+IdsAYMzB1IsLhB65ri2\n7S8m4uO1zReddYy2+RQc47zFYm9KSSHMKPDjlOs3SRLwPlIAplpPiS+MhXuf\nMake\r\n=FGoY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrwwRP3FUtvG0h9hffkGnZAtIlV+BaH3sRZvHRHDU0LAiEA/smH1TtbBW47CdwWhQvjA45UGXdvmpNTG8zdnL7Htsw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.8-20180824230634_1535152255999_0.23202498440162"},"_hasShrinkwrap":false},"0.21.8":{"name":"@atomist/automation-client","version":"0.21.8","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"afe5985e504001e3c718f7594e7660649b8398d4","_id":"@atomist/automation-client@0.21.8","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-s4ACbEHNog/YRw2aPdOrqiN6VSKZ7dE5cQxlfywYZ6abisFLxFTDPL8hqbY5uftZdFxo9+bfO4MeP6nu7n542A==","shasum":"c27e31013ddf99e37b78306b456319de0db9e31c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.8.tgz","fileCount":812,"unpackedSize":5324361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgJCfCRA9TVsSAnZWagAAwbMP/2/SVVPXfFb996P5CtSW\n44oPAWxAGpnB1o1bx5bTqL+gvEtc9Ik9jt2zMhul7lGBOk3tIuHLz05e1D7y\ne68t8e3ozarlBiYGp30u9NjsS0nQZV9W1b+m7fo9LuyBxEIr624wvRWSYs5Q\niWMgX3aNztQBgTBxcrYr5XVa/yxSfUY9qob3mAeeVqfksetgMDNzhv2uVKfM\nb+K8UqYAML4bVWkYfsHlP4KVFRmSTQpQ3MhQ9UAZknTKZKNY/KFwR1Z7YtVx\n9dA6cN2EoXhOBYDSoexAJIEaNAgFfLdqzGjk5vAu+cYHXJhL0NtS1HMMy7Ep\nuLiJeMy5/lsEEblrRCmnR0VDltlw2liRXID1Khue4a/gHSeQzoZ7ZAzS9bYT\nV9Lzif4omz/aqu07n8HFKh3rqoeEix+QNf70RucqSSDZK2Sa1jBV1jmkurRf\nRTqnTrg3tKvL7oc7UeqO9YXVby/OcRb/9t2PIAprmW+VCZUzVXKVwEmm/IVo\ndutUlUYrLKW1vBiCMSxipV3dHKojQZswPaW4vs9H1BfWAnZO0amKgGks7bxU\ntVbSY331PvMgeW86Ei0L+YHiRPuNRR4rmIULCN4wUU2rdLEUMvBwPVfcS4Xq\n9ewIy2yISRYXsHKudkAhU6142cjN5XIaf9zMFytW3wsqPWm76WNPmIM3VjPx\nPHl2\r\n=2RqL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG//OobMb0Javf6DP87jNYkoTUEJPZqbHgp16aVaxGHdAiBxxRJ/cDsSG1Is3EowwQ1zSGxAP2CFqLFzHsc50aRb4w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.8_1535152286394_0.84766697864684"},"_hasShrinkwrap":false},"0.21.9-20180824231228":{"name":"@atomist/automation-client","version":"0.21.9-20180824231228","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"96b9a5ef72e24232cf3d42ce415260d31371d445","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@0.21.9-20180824231228","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EW/0GnPzaPx1NEfF9G0heCFXcNsvAl0uI1o9TETsDb5VoAQc14r1RQLVSpIAlxvj229OBlFREIpbTuadgbaCMA==","shasum":"a2147b1a726aff97c439da307e1112b81f9df251","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-0.21.9-20180824231228.tgz","fileCount":812,"unpackedSize":5324475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgJH5CRA9TVsSAnZWagAA3XQP/3uP7+JFzCLHgNEHv5VN\naByxuri8gAWOqqrdXtqXfqcXdpYrx4zIvDOyepXNWeQenXY7V8KXsJRc5JQ1\nIHxHNRX8YKF7HptbjoFluCfP390Ncy2rgbp7C97CaoIsmpzItb5hfwmEI5uO\njFWr3rv09G/kOW81dqw7mvFTgi+ON6kFoWRe/fHlzCV1zqydFkwAcl9c8Xyq\n+F1ni9nQzNI/D53dsmtxppgC9zaEMun7wT8NWW5PpywLdLGcMm45HQU7vGeq\nmQzNtXnIzT9P/Fw4t+kqad0ZnSfzjhzgJBuELtFMRH8DHZS1qkwIQ9DO1JBk\n3VInTgeZxUxasd+IJPqOMIcI650hfaa4/MM/Fr85avMEEHfBI/mM4/0h4sz2\nxbnMgYU1KRpyJ0kAh9g7/Z35YAboHOeJjScG3LDV97ZcRugTCjpr4r2Fzf85\nQFRV7CHFX17FqA2G4ldTFMaw219YuXDJdIx5Tv8jLTpHkCriWGj3VBqb9mgu\nW5id+80+OiJgN0sNIBcOxmm5+jA/fNJGWFlQyyc0eIMhXxv0XPDHbi8Vt8E5\n/LW4sGU6BfFWnl5lODv5MbyeqEAH2z/2InLsFAXIp34HpIieQR7X0VdhdnZc\nBL+V7AvDydNQGAm9mGTOOhLTjkGgsN5nSyh72jRTu/luHilm53FfJYQGw9To\npdSx\r\n=fuIv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMIyshK7fBG5XDWW/GUsk2qHBmBzqoaUt8PZ4geHIFEAiEAyRarYnHIdRvHVSsSg3Ozpvjx+Pgz1QwdroPgz9wrYLk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_0.21.9-20180824231228_1535152633156_0.7809502750680517"},"_hasShrinkwrap":false},"1.0.0-M.1":{"name":"@atomist/automation-client","version":"1.0.0-M.1","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"96b9a5ef72e24232cf3d42ce415260d31371d445","_id":"@atomist/automation-client@1.0.0-M.1","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wT8GOszVpuz/Hytq5RteKPvaOjPS9Pu5ULBaxBQ5QyW8KIWy31p6MpwWaUdjY7bGTxCm885g64aN9r40O6U1rA==","shasum":"b401ad662c0b65e71b11b2ccdce64f2e5f8b0d0e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.1.tgz","fileCount":812,"unpackedSize":5324463,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbg8SHCRA9TVsSAnZWagAAgacP/1Ayk5fSF11V3ChO6vcp\n9LtuF9cSnSDNdqSUiWxgf5eOy5PfCPbwkyg/iCsdNNqm26iZYxkCzk2pLZKJ\npz4DccCdeElYgyE10LMqmAMphiPjDjcKy2o346QaTkx/TZAQieks/l2NsSU4\nnf5cwYXx5Zmb9MGhqcg07JB8kJFgbskBglB/1Q+4CkVX74eLcPYHQqbTzwIl\nO1CKysrcSjv1DE8AVjaMLM+uR8BeSp0d/e8GslWZsCKQRvINCiEa840wirLI\nnCr43C3qhYYJRdZ3YI37bCD/JiZaG95eXVy/1JMqeOmfWTq4uv5AB5g0raim\nAgO5L+xl9yIcUUsoSIBv9rqRivpVR3Z2A1QSZTH8qrdp26xOJgr3rwoiy+xh\nphypcQHAbB/0TMdBt/I5whWmpQ0pcEXTN95DIVpB50+1BmBbZe1BQ81/pzLr\nYZS88czvbmqF5oKg4EL+bQngqbQD8P3tBCvvpuYwr6sd+G6YwDgOcRNAUDDz\nZnB6W0HtVDaVBwGZaQK5szCz75lrAD4c1UEpT36xNBhdpQZxBWmrUZYaCKDr\nx55+23rp94IJHw/9ygL7M3mmkINi45fwSuJ6yTD6byuoSV6941Zjo8OsfuDl\nrs3rJWj/Q5k6WMkofH606sb8gyOla6X8dD/jUSMISDx8UWYgFeeh8e2pNhGL\nIk/C\r\n=EGuO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYx5hCxDk7pKknp16vwMPdiL/GLVdZEszPD6U6Q4wqTAiBj3ys0+MpHe7Uv2WLNH3RiGH/hhrKlYgxZtLDwNwA8Kg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.1_1535362182368_0.27846710972776356"},"_hasShrinkwrap":false},"1.0.0-M.1-20180827101310":{"name":"@atomist/automation-client","version":"1.0.0-M.1-20180827101310","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"84ab9a05a3f22dc54ed331f7d3032a28737702c5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-M.1-20180827101310","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TsglSK+CIviTX9oT8XTZb3w0McWmdn/27pcDpl7l2thgJysCiKYUCFfXY08sRCmwTzfBvdUXzazbSdlu1Fak9Q==","shasum":"1473b804999c50e9b959ccb8ec48165948a8da95","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.1-20180827101310.tgz","fileCount":812,"unpackedSize":5324586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbg8+sCRA9TVsSAnZWagAA8Q4P/ie8byMxoFWex5KNeWPg\n6rp3mA/EkfDMl4uYac8Q6oU9CglXWssKpWc6aDTqCFzC2YfmD1DSDyRiyqEx\nXvknoqzKZHvG30XdaC78BNbi3ZsSmZ8CUwd5cuLnoIOYoibLoWVJ4o+7v+eW\nHxAzuYjWhgmUkyk0FB/IrqZE1mG3u3dma4uJ2K91XEYej4AMbWePR+eMbsnj\ndrM6TFu6FeITdkQerUyU/lHDYYBPFqd5ia9WQWLcqCyAzrwP5Dt1rfsoz9ve\nKeDnguypRYaFWvHCkA81uk4Kj7ikP9DDrD4xuY7e8Z+gySlsVjlZeL8I9JBY\nGTRW8Inuzbns4TqZxDhUIjRj64/+onGHK3Yqf/8A9XaW9n3xErpQl/t0n71o\nxmOVPhJb5pjAKrQ08zG12sDgl0Hi1U25OP7F1zebIutTzZyne9JE4QDeb3Pf\nL1MUYvrr95GOmh4f3DT+wqcMufDAoWNyo7jiNH5OSJ38tT3RAtXzpz3ADTxR\n9NiNEzfjcaxeCfIW1GJMMbOwsWIpsuV1hnjxYqRuiTS9pHJnX/l5/Jdc6PXk\nH0IE5vm+c0n91cvs1hYbhViebj+VzvWfyFS33R+PXifvaaSpE/xIoxFkr0Oi\nebxTlb2clMI+w/DGk/0kROale6zcqTIBWvO0zq/xx1CIUgCWw7Yiw9t/GTZf\nSvPb\r\n=5GuZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOk7VktM7dCPSkU5YSUcVk1CWnzBYN4f8oT7O8w47m3gIgVF2jfxZW5jV4ixqnUr7mp4S9jVyxGzox+4yzSVfS9qo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.1-20180827101310_1535365036144_0.08592793061768167"},"_hasShrinkwrap":false},"1.0.0-20180827101904":{"name":"@atomist/automation-client","version":"1.0.0-20180827101904","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c5e60207533757d146136a0c349571a102c3ce05","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-20180827101904","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FpIcVL2NEMQSvgwgKVGOsOgZqDHC90ap6e+eHXLORvviPpsMYdAsviapWrncbUQ0+AadBoSJoFlRGxFpHaObxA==","shasum":"687e6ddf5b6b02608cf12598da6cf0334fd3c652","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-20180827101904.tgz","fileCount":812,"unpackedSize":5324582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbg9ESCRA9TVsSAnZWagAA4poP/3REvvukNZK58OEmk5kM\nN2cZa5Lmhf454oVtnU7MWNuFCa/UnW8pEfLRNxHbAXPb/+STbSiM3GG09qDk\nWkjCNQOmUzcZr9OF+MbWGmOGVwfJ58KSLEJyODayUKRfJLUe6MwPszIrZz2q\nyPUdFVP9zRb3kibmwT7NM7sqw5t+5aOvZEjb57DQSHmPfWqETxS7jHc/390s\nZKcXm+ozY7dVh4VMDLSXHPgGzozAMPVeshKOGOrl2DTSI7XKdeigS6twuZJl\nrEM+10yjxWacVq6XykyLvOzV2e4UVDAgWXz4jBoXuInufNF49u2rovl/i4C4\nIUqBoTQlVAYAW+JUajV0Xnvam34e5V4/bvULRa0DossVit3xTUlQuIIW8UTk\nqpSgvxQyCAYIqqitjL4Xz30qq8AypeTljM2kEz+d1fsgO3PgR/mtbD7djB6c\nv0DaP98WeHZn+6QDZEY7K8RKIz2Be4MkgMp6XUXXWS9/dsd6uyoNbDaUk4pb\nf5X7kKSNNTcx1tThO+6VOld9bM4x8taBjMq7Cv04ytVX5cwMwIenxfiQDXEJ\no+Y5h7SoGX+LrxPFIsQXAffE8Z8W3DpSbmm5V12Z31F2hYru2ST+9P706Ncb\nlA6CmsK8eEw6dufENAjtPFxIGuwRPb3C/P6fQy1fI/LZXyutIU9frbooJLyE\nVYmF\r\n=iWpF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+WV3ARnOEXSkdhAArFUuMs0JFooM1mONZGt+nOm/GCAiEAhgM0AB3HkdaYt3t695KSUIUr3mMRBt2kgikD4Sj5Hek="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-20180827101904_1535365393744_0.5742653288429285"},"_hasShrinkwrap":false},"1.0.0-master.20180827152750":{"name":"@atomist/automation-client","version":"1.0.0-master.20180827152750","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e9252ce124840d2342df69e98f90b082bad86229","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180827152750","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1bIs4gfnX7FMlGs9hX/K4OcL4y7R+Suop0LLYMafE8w3J+gnbXmbw3CtN60aKCKu2jW90A/ZsVnCo1pg1zUGpw==","shasum":"660bda57bbb9fdd95b9c1565933952bad9c3a452","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180827152750.tgz","fileCount":816,"unpackedSize":5326123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhBljCRA9TVsSAnZWagAADsgP/imDj+uYie0PdV6bL1hP\nlyRK3mG9xpQ+sZyScB268Jh8l4g+mnPOhzY6MS+GVjZwmwwD9AufqBFfn4RJ\nJz0xKyZDAlyEr4OB2EwTPkj+OFSXgd0RcYvyCghkxG3DyS3ZGFZsnhw8ZDDR\nxctPQpaZqfT1b8UdYcANEcLHjjXzldiUcdpsjm9rDqOcRE9gjJdmnN+Qg+wt\nOctmy9GE9RFZhq++5LkYaffiKN9vxPaYNarQ4BWuIu2Q4nsHPlbG+FVJHoF8\nvZgefqUdakDgUYbVlwV6KsS95wSsMLXWauj7ob2mCWpxTcghgonaCoL7Cq74\naNuMdjxl5fBMbZ97TUfNllzgqBUv9bpTMKpJgtDDyxdB0EU220u4Sp/cZ8i2\nsMTKa6dXAGzXsMoGYvzFfxgqJkv2VAIuuswGWyMCyfodzCr+OlGGTQ0SZvLC\n/8gaf29Bpg2BlnGDUh6f41g3lyKYYHsFIoMqMAzDlxuq+Vyf2rdKMobrgnhm\n5eJ4Lv8w2wotOFJgbQpdbXAK19V4MgMq8lDPPCS3WXnytKjViKGWMJAFjH3n\nNydFre6C7mJGd07d/3nRZ/WHEQzF0wek/+aURzpSu8qiUAzHDuv4DX4Gooxz\noLLDY6gHofACpZZXnPxxyMhn++/JOxRS51qkqyiTNn3UDUrPZztOkiWs/CDZ\neXgu\r\n=Yc3y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICZyLjc1qBVw7lCMqMODxK+YwLe9tBXC5jGSUnT9qOZ9AiA5zsYqi8FyGd+rhpWcvzdnZxwVqn1vxm8EKZygXziN5g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180827152750_1535383906134_0.7468692003692396"},"_hasShrinkwrap":false},"1.0.0-M.2":{"name":"@atomist/automation-client","version":"1.0.0-M.2","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e9252ce124840d2342df69e98f90b082bad86229","_id":"@atomist/automation-client@1.0.0-M.2","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Y/qKno989dlLDFysm6tRumMdr4Emke1g8k7xZHODIuEluVryb6hT0+eA5PEjABRDQWZSPqeYkuQ8/2tTfRq/cg==","shasum":"2be8c90b5356ab2ddf52ab64cc9a859320b5edd9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.2.tgz","fileCount":816,"unpackedSize":5326105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhCtACRA9TVsSAnZWagAApB4P/3myYaV4c/oGI2lv/jpL\niTgpi4IXamrpcLbxGqU6H/RgWFLFKVjVySJKdOQMQrfEh8i4DPGhiGmpxBS5\nhnn8kAwxuiEERTe4ZfKAbvovw6n/jmwJKqoVCWWtQgy+L3Z87LBF9x2NnLE/\nzUojzHLP3KfPiT7rjON2uJgnohj04lwChTk83wnAPQH1ikLnYy0bfkyhXX1r\nRSpZ0fXkVUO0KXSOaFt19gAJpktZEJTlqqJl7dFkHk+9DHAxS6SSJh32J6Ci\ny7yTVRuEBPr8QI+DPfAP7V+l/OfYBNfmQ4eKRnKRDVjdd+W2cO5Nb5vzZcLP\n/Jmk2hpZZlonZQyu99lnJNeAgdX+7I/RZM82vSVV794c+KKGTYDaV7rHr5xG\nHwircg4NReoJqly5DSOanD4oWpPtXgq0khuluqvWfuRLoJadulJzxJ3pPrJg\nSU+RPUiAFiFc9hMX0nJlLJiXVpt9D3wNGqC5hArx+imG9pJ6SBFQxcOtpCxD\nTFi1HDSmE1TB08NMwqphnpqvNqw+JqeuF4VYbv2UUccYZR7GNoBOG01v9CkP\nOm+OSUL/QlWH5g5In54WIYvzLloshiktqRFBKmxbHKMuqzTEv2prryWth7OT\nXsXLbZ4BGYemEXIzui2K6WTMB4nzv70X3lqVVaAGY8MslrJGYoZ96CPbJWEv\nuiI6\r\n=EtzJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9upPAFiEYKw4jNZH8qYqVr51FF6JF4CCHi584OJrbiAiEA3mmVzjZ5/6o444oLWopd925fbQTUcn9tfT7IwEr0ok8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.2_1535388479258_0.028273842806547433"},"_hasShrinkwrap":false},"1.0.0-master.20180827185035":{"name":"@atomist/automation-client","version":"1.0.0-master.20180827185035","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"167c7422da473ce92de82aaf0aba2d02bf920ab5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180827185035","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/AQiBVDmbUyDOOe1Oie6LbYaDgGdodKW9U3FfIcJcR7y+qYVQFIrZipthjcxPVi/8DlGz4zwHAynUSyNVDPz2w==","shasum":"fb68a03eb417a3dcbf351d48899141a0ecce36eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180827185035.tgz","fileCount":816,"unpackedSize":5326270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhEj6CRA9TVsSAnZWagAAt8oP/jm2gbagXvC4BaGj8skF\nefXbrMv0ZlbopKKL4yxZWgaW+42VG1SVO1j0b45UQGcpdnL/C2eRlG92/GQ8\npGD7crLc9RLhNAh9wGtAFHAYm8Wu/qwkWjqCJ+Ct27dcEhupyQjnlyuA0JBF\n/MYCQwIM7Y65C2iyw5Jwx2dOSDBi0LrOt3MRz3ax4pDFlzxHu0u6KnQp4BW1\nViCWQscnlZMlvCdFy6+WWwnqaVkNMGpalVRcsMnuYkWS+Yfx4X/f0ytxEoK/\n1wOL3hPquvqwG0asgoQyxpGDLHRHU3vD4F5fQpTiIhwTQ2DOjxR4LdhhxUgO\nEO5cfN9LeEMbuydAVQV/22oSkiI9UTwhZ67fzurcbv4Xjppsl6/SC0QRCdnU\nM5peT9Ej5waBGhARF0SY5xx52W0nwwFniCJpAWs9WyHG6BgoqdzQcN4Kqrq1\nkukrNdXFgjePbxeLwcy38YdEzVCGCP6X80rAlbQC+o+da/80jBKFw7SS1O/Q\ncWN7Bm6G187g5p2raNJswyXJ0gynIUHsGHDf2KzJQ89XWV5tdG0pD19KzE89\n08YzAzz4ao9Bo4dCZCvz0oQUKI3SUj/K9WZXJBA7EGq9NklHh7wE2p/GsK9+\n7QWiS4IRsY08BUnqu2dAOfDU1I5SI3F+OzEVUl3QKUV4614uDJie3Ou21HTi\n1XgX\r\n=2tXN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErANzKcJSkfrDyi5bIyb/NlPCy/x6y6Zt2QBwGyuUnDAiEAixfGzd6aRRoXhWAB9yHPCE7FASIqmn6u0vkbcp2VhZc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180827185035_1535396090093_0.1863213359254159"},"_hasShrinkwrap":false},"1.0.0-master.20180827190033":{"name":"@atomist/automation-client","version":"1.0.0-master.20180827190033","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c944c6698f08d4e4f0586908e43eed4e2cdee31a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180827190033","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ucs453xLKysrQoblF8Dyj2FqeMP2mRtRjVuTKR6qIrptmw/Pp8zQ5LFcTrsIUGYWmsYvaccDlmRnRPclVOXG6w==","shasum":"8cb5d63d4b4276897290cf50ec7a9db9fe190ff4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180827190033.tgz","fileCount":816,"unpackedSize":5326474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhEtFCRA9TVsSAnZWagAAUNUP+gLNI9Gh+sL5mqjS2sfE\ngsVQkHnMLcrzUQvxzgY+ZX4EnvIdxmSCE+bLcRYHPjQBgOiDKMisEza4a131\nqiiYNeq6F/kg0PtPTXdy2MzYNB4RR/fp5EG97AVa1P0qZeGKfDij0TL0sruR\nlRyt4XCeOZZRJDaJAbstuGRc3Z2R2Ry9IZDuZ0OmRIurQmYa28uIubXT3BR/\n61Q0jyL2+Ej+xSUI9WVoExB0L6MowVAWvA36QmiLQYlEt3gziWV7GjByFfQP\n8tlqR1VhaQoNQ70q3l/INvvCshZ5tZr7e7dv8iA/UJCLl7Vu+qT8vOnlnH+S\nLQ+TlAB8UBRgIunNEeHcd7LmcumKrj+WKZqkb2ifIJmCA1/5ezIrgjXsBOk2\nmb2Aq9V28kKk4BEe4OFVKO4nihMb1E2tMxtj+QBPpUdJEgFqxPftVNe1SG5v\nWlzgHxdxG5P6kpS/VYEC+xwV3s4QmB/1y4ij2eVrTistjg+DIxMO+8YRBFgv\nIfGx3VLzy+fOOQPgn1IbS/TLNzRLSUyEllS/Kvi92vNqPkHgOP7+Ds0tVtwW\nA8V6wnhcETxO8oIbOxz/nDxTGFZpXS12Bou5BVTLEi9j7Y/6zFzuJ1Oz38Ol\n+y8r7cxrSebjGdLAJvHpKOXJ9zR2cvw1UB8G6EsW6RmBI/rQ2yi34Ct2VNg0\nor7t\r\n=MZA5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMog9e6fA8bWGpnZK5dPsPClcxnqVhu4jAv8pY565U6AiEAmWdb2FyaMF8dtlGwzyALklpdUzr3okrWdUlP2BcjfW0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180827190033_1535396676416_0.9837561707420233"},"_hasShrinkwrap":false},"1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9f32ce23c8abdc3112e1199afa8ce9c287da4587","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1MSrutBkB9twcHKr/3Tg0HTrJq9+vV6EUtQhlcows1uOqFkLkY9syRt5NhehMfzN4jIe/Jj1+r+dq5+IN8vcXQ==","shasum":"ca0bb3eb1b0b726d376680cb169a1327ba2f960e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200.tgz","fileCount":816,"unpackedSize":5327425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhH8KCRA9TVsSAnZWagAAfTYP/iLCK93oF/2KAoe7ySLg\nagGjQNoVxmdPleHH5NtUt4Xn86hSLL0HCC+itcOhOHuNYPbcQYGo96LzIK6Y\nGLtbvglooFBwEghiNPf3ED0KbLvPzqWfqnMPD2ld6yTlcA8WPTdr+RBEcDGq\nsb+uTDz8POy++xp4nw9IqR7zGDxvFpjhwnwrlU8WihaWm9W1Xuvu+Tj/XKFn\nby02vv/1C7LLjMev5ChFjAQ1OXn1S9NCdPLmgGbUV2ozAHguStpRNYSsNaCd\n4AcblqQowEtPHVuVYJTQFRxACAQxoZqqSgKnHJWgq/FBkg2kx1c7Rm5HBpBC\nVhca78hvjgxDlSwzGKYLO41jGddQG+u0BrhjzdiSqXaghDFsPToIL0b+T+JB\nLU+XEyLMoAydLXeOP0FGK1F3o+ps12qWGcUegAK4Mcc2V85Mg7FIrNb1+Bgg\nHuZ1EQAHYshxZq4lRT6fG14SWcqJeeywVeBNN4Gz8+moCLXupSFhO7ftjQKi\nkzqTcr01laFLRsJNGWNVfbH3wmqf+SATk7Pw8USaXJ49F00gbe2O/CpfkjqU\nuyd5qZUzxtB7rU2lQQY0hDGWUncdJvy3Zp5MhvwiBAUzgXfo5aTsgiZQ3p3P\nu120TBuKYUfPlMW94PX4J2gwXntRjOWBuX+Wqy0BVcVOVKASZ0sm+tXYcedq\ng6fB\r\n=GsfN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3I1y8XQeuknw680amG8Glz5D/aIV+EcZUuhgVSjHoPQIgFcT/wFoHizNZIIWCcEAVtqHjahODYAtEjdrC14WfRh4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200_1535409930203_0.32057953707503173"},"_hasShrinkwrap":false},"1.0.0-master.20180828081342":{"name":"@atomist/automation-client","version":"1.0.0-master.20180828081342","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9e7fe9beb967178a43206d1ef85a8e76520942a8","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180828081342","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Uwwpmr5udP1f9x0NI8AzFh70aMPZwIMcFsJYbTrXd511L079blqwWynGLQFy/zRpD3dBftLvtPlU8zTORAH70g==","shasum":"e6894043cac4a51fc8412d2b24b594c83985859f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180828081342.tgz","fileCount":816,"unpackedSize":5325963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhQVqCRA9TVsSAnZWagAA510P/2U7T0zY6CM2jgVQDlrz\ns4E/zt50cQt1B5XeJ1n8rn5TuUW00JXAYeppeopYobsdUdwmb44Jkke5M0zm\nV8CL33bweBH6QnVx/GmNmz91B7+mcaH8++yTSAPBL2limT/jRZaNYnTsVLdV\nJAExE9BmkGbJ8u7ViRJBHtBfh92PckLjjIqZwxk1OsnSIFB1OjgtWD/jEG/8\nWOORnNjzmQhjW6yLPZKNFo8r89wyzO/7EoIoel7WEIRfVk1FjbOtqk44+n8B\nrbI3t7NWqdFzB1idphiTMu72oTfs2WEkd24+2DrXWdYo0NQSaez7ODRmHwmP\nwDfZfHA+5qqtPPu+wzr8k/ggxr+SiJnT9UjgPiyj+dB3PRiFO/DxInePIK5i\nQIaPC9jtw4sUYXmVTTVwE3NNmAdimPeyeke2tI4ykDEtzxtk6/8dep596M+j\nw7jUobFmvDqE4KwC0g7zun29+EpQMF88IzC9fczfUNfXLV6DMQ/qJrNEcQ6k\n2blgqJWDqi0jvQY9zV/3AcG2dPk9c7U9Pv2I2hxR6bx20cb27/mfAZhMHp0P\noYwBPvSrrIkxxW/fIuXr5d6+AnK9tCKNagswA3zgH3rx+rVREY7bXoAtCfmt\nxyqj2f1TtoAH9ACDZb85swGr7nzOfOahjQP8GWfdPL8AVhOSAUP+yjyz8wbY\nhuVb\r\n=H4RF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpMtm0aweNINERYxY0WdZo38GSlbvDYxnmXahAyu+9MAiEAu084TqFVEBPcS20Jmk2KLGCl5+uDYsUTCTeD/cs7nao="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180828081342_1535444329553_0.7158981247946183"},"_hasShrinkwrap":false},"1.0.0-master.20180828120312":{"name":"@atomist/automation-client","version":"1.0.0-master.20180828120312","description":"Atomist automation client for running command and event handlers","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1857853b736ad550c3f75153d5572b62345355f7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180828120312","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uE/Ken8OYpGI+7lEctvA61T9N8gTY6llOhkD1a9b2nVsvsnlGEWDc3bGnNP+yXvEh3IbUeh0Mft2zsRdxw0kGg==","shasum":"fd5d9aedb8301f8889550cd6718db249ef546c41","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180828120312.tgz","fileCount":816,"unpackedSize":5326878,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhTrxCRA9TVsSAnZWagAA0nkQAJKUzXOMQbePSdPQoE/3\nARHJZQAIxoi1fO/WTm7It9fTiXOymTLR8HOkveeUUOKBIZ/2nU+7QaSv+cPc\nhDuiKhCyrBs042F7ieGuqf3DuIehcQio4GumF4kmP4rBhPrg9TrU8zgtAMX+\npmP+TdGgRvx4kujYujIukDhOQ7hYXUGY4tdMnb/RTDbLCQv+3eWPZSpK13/K\noEQ93cX3aiT4sAd9DOaoyCMzqow7K9SWhMY/DRKe3gnlJBtRhWABeuO24olC\nzIR1x5j5RJP1fgg7OR351H6owOVMoSUytF0Cq9jra8xIh9vwR9Ks1g7uZWPS\nx3qM5stJpzAb04M4iG6s0wh+p6dipNsnNUUpZIERVRBuoU1+q7HRjP87ci6J\nkg5U9VuBdHRVU3Ml7NoDSiSBpVMisohU44DrOtOX2T0Y5yubTCCvZ/Aw9iG/\n4T1761N46EjxZs/u0TXCPMBrZZ7789QOqRLzy01G8N0e8YW7lpdagb+kUaMk\nCyS5wdG4p4z1y91byoPGawWPz5DfAw8yGxZjK6q2cXiJhgjTFLlhLvNkj919\nBrrucM+x5CJjn1VYO6iXeUrQg6USTJhBsBajrklVWg5/fCw3pb9zcjmmidhn\npAn1DMx6msR8fZiX3kuKt49C3KiJM2lJKEbGhEVsts035jP+ENAAypGRnUqr\nljyf\r\n=8x38\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnvtBByz71L9OP9Gpw4f3K2kyYPsk4ZvF5K0xf/JrStAIgWJeb3ycwq2tzZQQThzAhS8ytHLIPvqpjj/NJAnuiQUo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180828120312_1535458032910_0.3250297233865711"},"_hasShrinkwrap":false},"1.0.0-master.20180828220516":{"name":"@atomist/automation-client","version":"1.0.0-master.20180828220516","description":"Atomist API for software low-level client","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f126096f4c009ac4ef6ccc45df626c31c93779f5","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180828220516","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZIiUTIMU7smL02SlrUMUeOREWzntAn5Ku4GRz14/23lJnGlj/afQbdsWqFqSSId0SSUdTGTgXEdFkbKxuiSqaw==","shasum":"78c7d43a1f1715c1b96002c54cf80fc10194c138","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180828220516.tgz","fileCount":816,"unpackedSize":5327978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhcg0CRA9TVsSAnZWagAAAdMP/iBDNBMWOOe0Ei6wIGGR\nNZSEDtsWVK841gCSGlOpcmzfJwvfyzKnJ7jPDjwrxuPMhhDvrq+p+UtbzOjU\nHUyI9JUDk+wRetaIgrucpWOzZmiHvTgfKzaOZ98L5G8Nn7Vwoa5yLM0CrFSc\nQcrntld1TG3d5B86+EQcYE7MfPqoBylp/kagn0D1mhKMtRmgsNwtVopyza7Q\nt3elhFZ6zDwULVgMDMFeevtb+aw7ScXiXC7vNaNaH6aHNH+toWhIGDpst9pm\nrQ4jLCYwdVrC2M9kRpy7VH7TuDyvH1t/fuVImsoG6QwdFI9v4prrtN6/CBIJ\nSw1puxjL+Shw/uSECIlLfbx1hQIB6cemHqI4VCePuTZWVxnhJGpa2xCXyjIo\nZYMws0aQcowXPFt6LrMRicM1bJrUCQXvU030ejpun7cqYakM1+06qlqMl/B6\nP+vCFIrW9hL8IzKKuZStcqv9t9mi1SOjkhyMSsPQUnaW1pEsSWVEHPc2PdfJ\nv/pt/BOEBUikI9Rv0mDgFbHG67ht+uHxeo/qjJOAbsfaXPFESmDwpTrMtEL6\nkMz4gaHTZ1DxqiKdByPiWvTtmprgENlAnlIKdet3dsfouzxHeEzRTia+bAO1\ndbxGk3aLTps6GKWNlcFvsD3jFTPVzBioIURdLDVbwhEzNNGRSOGRHb0jlgMt\n1wSV\r\n=yHFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDshVIRxu+S7yAJuEmnxNVVGoHUa7F5+89fdSvdmSJngQIhAJqczQvof0IRbUX1ReYGdtUwkrcOHM7Fyjs4jlbHcuDH"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180828220516_1535494195669_0.9591842661793211"},"_hasShrinkwrap":false},"1.0.0-master.20180829064317":{"name":"@atomist/automation-client","version":"1.0.0-master.20180829064317","description":"Atomist API for software low-level client","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"4dfbb0f0cffae9fc45748c558d05d497361bd8c9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180829064317","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sMU67ztrqnFqdX2JwE2kdXu72LLUy933YA5xQmoUTJg9jSUIvO3GfFRkJDTabBhX/g3iQF3FRVSTnR0n2Auv2A==","shasum":"6341de11252f9a9f4af5eda16027097209fa5df7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180829064317.tgz","fileCount":816,"unpackedSize":5328229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhkFzCRA9TVsSAnZWagAAF30QAIWhrJV4U7YhDUcVsPSu\n6GvvSnEASYqg3iE421ZZvP8fttO2VbPFtBdj+VEMFHzAzkfdvWKJHa1XxrJm\nnMxGi/AB/hDvhVTr9icPecemsaamWzFgCu8pUTFdOtIThrZwFZ6wv+dSsz/c\nH3SyxTkVhH5rE5oM1iWToMqOtKZBcR6s+oz5U1iF27QJBVYxl9UCfqFMyLsO\nHE0WSiLm1551CIqpY4XCreJZO46PVGCyJMbGeNGkY/TtoH8ydTI46jQYBnZ+\nXnCbrr3MSUyoVTLqgQmQuBo+4Yu0jGnvyEYlrztniiToIy9eZzLK3nEawDWw\n5ms/fWIcrECMc+uNhv9sURPARISmoAJxir6O/FkOnIphec6VMx2KKImp9mbT\niLEB0y/fYK04SjSXbocVJBmpBrdV/HfLipr/wErM5D0NqhltnsDHGtD9pReR\nUWD4a5twFuix9TRHA84BE3Q9g7BcgO7vV5XaSSYSv8Hsm31TY33wzeH7eovh\nIXVs0+9Pafdfz5ToitQnGguLiMmGZncdtp8Cyz0CHXTnpXi+UGDnYDPQA26O\n7VZHGj4DDMBoKfOCBdbNWlPRSbZcgon9NQINglf/Kle4rrL6HgcRM/V4WiCw\nFawSaYP8HAheoge8hQEJ/3V9fq0jP/Jv2p2Gp6Geajf/k7Ku53Op+lrDdDnU\nCXxh\r\n=VSr0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCWwIR8X+fgjThiVJfI3sn87zAZ0XVvh/mAfhVeVeUiQIgRU6WDvJmX5KPgONZRSAHo9IkgPGVGE3u4fQjO+sUq9o="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180829064317_1535525234292_0.4397363795818021"},"_hasShrinkwrap":false},"1.0.0-master.20180829070856":{"name":"@atomist/automation-client","version":"1.0.0-master.20180829070856","description":"Atomist API for software low-level client","author":{"name":"Atomist, Inc."},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"56f953cc196a3d77eed05b6a183f8a63befdeb50","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180829070856","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eyZb2i3+wm/CGIoDG4x+EJGjyZCakDRflnBccuFkCn2PMJ7AY4tvlMf/SyqSKUwy44BBIL5mtsHnm8wmev5kpA==","shasum":"7dd6d36ea90b5aa25d8dcf8f21d1c3d97a3d28d6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180829070856.tgz","fileCount":816,"unpackedSize":5328595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhkeICRA9TVsSAnZWagAANooP/0fFoDTZqTfxJyTWYA9x\nGuz/QHA73f8EccrQQGk5IMcgvBfwoiE+zsVMkB10pkSnMn+YS6JvkFKWgG9N\n+iJsKeO0pkFo15affZikH6qbfYEhq1zFqa+JwPA1WOlGHMQHVrX4xve/jFRM\nxq57jt21dNeHGdP8Tsd/SNB0Xn6UwCCI2zcavsL+yK8xJdoZKLxyesfFGmOR\nuYef0BD9uyHVYjkbY5JVqt/WY3fXtn4o0MHMWtVtTY4lhNSsvRq/Iiu8Y/Sx\n+Mr94UNTOKJVWGfx0vL7iZ7ShW4XodEnkYCCQX3hVPlyVXh0WT9bcGgAw+DP\nQwd516wvI7BUT+RH0rzyR49QD0bBoJWyKrID6yc+JkPyBUd624cQMSjH/6Xi\ndWvsgT52PGD2+qll4GveM7kPHgHrXsstCV9lI0vsSJQwyn0TbH1fKpVakFGh\nCwFhXusmfymYS8uZmSMYiYXWwfNhmpe+R77auyOwzsUAZzwkuhloK344+km7\n3h9O8vM8W2qs3b3Oq0qDFD//43qVUMqDB3LAM7AQWCSLuwWheST4rKetckHN\n7zzDo6NunLywRwdBEKhAdJvkEEOEDjBLAr95x/0VBDyBhfO6vhAZ/ULZhCxu\nKDx6/O8stR7eq0OEBITI12qKShCRQBOPfibugx4pOq+LL5BBlHnhrXqpdymC\nNJSn\r\n=oYkc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEjVEcUkwaG8xKYhdJKy02y8FXJw0NfkwrsLsnDDGlsAiEA1wfPM/3GXvXFd2Lx22pgo3PArtaF940AnJKWSQQ2Pp4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180829070856_1535526791539_0.9506440175691979"},"_hasShrinkwrap":false},"1.0.0-master.20180829090821":{"name":"@atomist/automation-client","version":"1.0.0-master.20180829090821","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9b11b35eb1a50490ccb3699b35e0c80affcfb48b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180829090821","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PQW7lLrviGcQIyfalkgAYjSQWDmaILoIMLjAli43dgxU1m1o5Q1B3Md/It6UwIr9gbMPlrywb3iSMoldd5DBhQ==","shasum":"145e076fbe3f03669b4e4f66041864dd2234703e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180829090821.tgz","fileCount":816,"unpackedSize":5328678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhmRJCRA9TVsSAnZWagAAXwkP/1sk9WErmFXzKcoCUuvz\nqEpuS+s1t0vknUIN9XZVsbah4zdig8owkpA+1rogrfVA9mpHbXkItxfEMjKf\nPEo7kCaw4SY3sCcKGMuPlqjStp0O1D5z9Sew1mlWp3WdsGKV5t0kSqQAQCXO\nOVexprAnqGis4VNgLqynLAyqqq1bldcQgFYPHIy5Aj2Sa7vWSt4xlzQzfcCx\nsueKG4Fs9Iqy9g46bsXqD0Q1+S47axQdLIC2UpmPLWvhGx3kKIfFot+oA+DR\nUr9jD1ZC4fTnR5z7M+SIzFdAUXPjzGd3W33z3Okug0uaGQDxlR4eKdAMsnDB\n6MdvFP58jklTHlCIpEPrYD8CqdwFDqLRJiiMx5pM+AT6FS7i5IxVdso9ZqjE\nsKGZ8NYBLoSL9iZy1VMyMlMRAx5iwFwm67jxtezusOniCtns2b5BSIT3O6pq\nBPPQvv/xrm0vZ7kucBiLwj/GN2f6iXfQHhvXofqbIQskF/deg0e6vPH7G5VJ\ng1ctWnTQOLeyfNi/QWGRYw6F72YlYwOILHxlKt/UYJc6AJUS8Y5HiE1K+5GX\nP9fV+mEk1Eb3hSZrpUDDhoLSIk70Psib7gwEgCPDZ+monJMLBuoNbx/bP0mH\nA8QmN1It38P/fvobsO0qHtKsok8sZSV8dzpH5uXg0J1wl7tYpAtM2Be/azAY\n6SHW\r\n=/Fas\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6GTfaBoglaBT81rh3vLYm9OO4IN5aiyvolpHl200uwAiBTx/mgKDEmqKWerRzAG9exyB5Xdjw0sSj1mqJ/UxjKdg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180829090821_1535534152582_0.19807444097704185"},"_hasShrinkwrap":false},"1.0.0-master.20180829152002":{"name":"@atomist/automation-client","version":"1.0.0-master.20180829152002","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"69686f2671e227f2065557912d94f1523b68dcc8","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180829152002","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+iPRZyc+bzBcLVtSPyCJnTqlM0Ym7QRxANEjxzaJvoHDSBdYSGSMHHlQPmg0IHPvBDvo5BvU1YPITHiUr59SWw==","shasum":"66f2d915f21843c84504b60cfb3e39a24bc1ac47","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180829152002.tgz","fileCount":816,"unpackedSize":5328678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhrrlCRA9TVsSAnZWagAAtv0P/jPSADtUiW7DsdiBIms2\nr1MpT1LMHVLPpRFUAmuVKuW78OEfOEVq8YDwPnNcrNwDsk5I6OOgqPTRoEMt\njS7rQ11SFcKR3FXrh2VCgGH/DDXJ0/fdrrym9mBIOZA/+FPgknbM/qMlIlCS\nOMH/AvACJ5zknpRDrBiHDkIWDb0YFlH+qBeMdk/IjP2YaSB0cjFGfCtfMzv5\nb6u328Xg+CjnhbgqdyzhJqIWyBU/poycdLfYus2l/2a1ymxDiNPUw57i7Eh+\nmFOieV311D9AcSxGklcdGEVJILff2x1euHcenDjiBV9pmMhXTtzrBkR3AIbG\nENn4dga5gqjVbKLy0X0dO0yS6vIE3YJeftPcBYXlK4Nticy0JcQ0m9jiQx1I\nv0mcS4ccMecWgQe5Kr8YIxUwecRh+u+2AH40BOC4nWqcN28R8HMqDLdkiaUu\n8qd9y5bYTPC0yzmzUM8Q9fW8IJjaYUVKnmElc7jjKzJK0yM7rORsxZTOvAXV\nvF6YgBijOpHA0baO/51jsDJhN8ldL34v74BbSTKrTwkCiZ5d60vjeqWTuqAe\nujiO2iVbw9PNbDQFEELlf7pZJ/fp74psMPubsU66vyESDZ7TygWFapDN7B1v\nYVByQzY0CI8d1Whyx2/HyCSv2J1+oYmq++tmbg4HiU3CGgW5N8iIyneBjgGF\n7AhS\r\n=UByw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRgU4lBmjmx2qZPFafr2ppKr6LqFNKsY4S48ZyFzdB4AIgWqMesvgPAFMgTTAoJfa3sWKDPW1oziAp9aUHIpZnbt0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180829152002_1535556324535_0.018185302494800215"},"_hasShrinkwrap":false},"1.0.0-metrics.20180830121623":{"name":"@atomist/automation-client","version":"1.0.0-metrics.20180830121623","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"02029a538b2e4132d1961519614c344018901ef7","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-metrics.20180830121623","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-golymdrIDeiSH4VOwt0ujtBxClF4Yl1rR9O6uqCGwivtLvnBRLQKDiNujFLKKYk1PTm8Zhi1jsWP5TmZ0al4+g==","shasum":"805f1ffc0838bca5decc6d686c37e7a2d6e36460","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-metrics.20180830121623.tgz","fileCount":816,"unpackedSize":5328246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbh+EKCRA9TVsSAnZWagAANiYP/3hS1tP8UUXsTn1Otzrv\nBGDLXVPZxZ+bCOamJ+TTn/1AJD7oklVGHByE8PGNDub18ux6nTgjS0gVCn7D\nA6hhiuY7gBrT4j1G3gFZzFpKI8+/jI5NZIlhN150z822noQl5MNSTe3QgOJu\nqUnpn5ptOhPN51e/bAyUITIscId2mppnm3wBKXFdCEUbenJbbizaX9NGlARY\ntu21GkFAIxUsnnwH0B2ribMfoD6i/idvkaCNSCN5RCI45EqSTSvpQNP3TOdZ\nosMNZXC9bBI3QGOmfLUK64zugGUABDhBXcbfgJmyuGy9ySqkYeADSjs6SJuy\nYNk5Yp1e8usPGHZQC9UAfvIYuyvvI3+1KEDLSeqtJifFu9wYhpZXvRwdGryE\nqCFyANOe6hvnPmyVcC20IsKP2gA2oGuzEdxQZmUh6x6OevZCLNVm7Yis7rl8\nbZJGNPcpGRuscYSWEXF0UcYexLSIf2OB5UeY/QYZCS1Iu6KSkxccwV7/JGz1\ne5vtEnay1/B8to6PXGdd6WzcmPuz2bdkQyaHDCo+FzJkA5Dny64GKqKqrRG0\n3izC8ljl1u2L4bvclNurIQlg5+ts/wvpSLJFmy+RBN/Y2EEIifZEZ6fs712D\nER0pY00u33vXYnKYbIxZMn8a1Py7BwRLPqxaCA0+PbWnJqZZC4mBiCpRareV\ncRLP\r\n=WTg9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5MSvj9tMgjX63CUbJsEJsWmgARvrr2vrHF7GBQTFxIAiEA0WtCGHXsSNj6TfyPx5sr1k3Lt6OyA7ePDi6qJN2mJME="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-metrics.20180830121623_1535631625505_0.18999973613151622"},"_hasShrinkwrap":false},"1.0.0-master.20180830123633":{"name":"@atomist/automation-client","version":"1.0.0-master.20180830123633","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"265194b230778766aebb789063bdff8581ff5812","_id":"@atomist/automation-client@1.0.0-master.20180830123633","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sjfPmthi05nI/tq6mlaja0sfw62CgS7zY1LhqS0V38kqSkktSbqhaTsKuD1ch1U1uXPV/vns1eYjCk/T9RNavg==","shasum":"203a9411a3a6f9e456d34979b57808d285e98d59","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180830123633.tgz","fileCount":816,"unpackedSize":5328245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbh+XPCRA9TVsSAnZWagAAEmwP/2V1DkJOCk0Npd2pTs4E\nAE+WpMpFWaFkhzlFuVFR3CkFCxM80vA8GyqOeNYpIBP4ggJ5Khu4XJ6r524M\nydCl4VKl7LkKFansOG/23ERatAmQ7ytmacNC9IohoO2J0rew/7JmeLsGVq5Q\nSJt7fZmcw9a47wmTcSIewA0v6zdE/sU0Gnqt/U4IgVlSwXOWmTOb3bx0F4zr\n8W2UPjNIr31FPTw1ZXcxvLzPUHoUhigv1FR7x2nG95ts2T4Fdhl4kJ7uUjLE\nSinMPcP1T15WOlBh3JHi4szdEeTUeQWuKlVJSZ9kdGsFZvhJPG8xL08lmVpE\nvprJ1GTlvQ6Ouryk9wg3l8TAkUO1L6bmZOq6HECv6HDQjHIxwGXcJ2XKYL+k\nvtIyVUvR/ugbsNJZh4AFkmHRfnDdKBygNhi3dE43C27TdkVosEkB+DNGsXzY\nrl2BgfL12AowV8oSrffcFPixA/vQXP5DdTEpcEjnTDssDSpeDFxRU9mHbnqK\n0rYgdvPdYCP/hECLALlMUP5n6U9pht8gCPMHRZzLDbXop42G7mknMk9tMCQ7\nxLO1Q8PbstzH9BBOuG80Wq8K/wfPy/P9GpQ4ndWo8uH2VRVboalha71qsdF7\nQKGIA6Mv13AVShonjXp70l2G3ceRb1XzozoeFiRSKrfc6Vwhl0nJtJr1SwiS\n0pU3\r\n=iRF4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUCh0xrdeQarCHDeAyd3FJAunfDl4kiX1F963RbV3h1wIgGqqDQkpLhUYQeKTVw0KB4Ebt5aKyVQwaF1C0l8AU7yc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180830123633_1535632846800_0.796432123402222"},"_hasShrinkwrap":false},"1.0.0-master.20180830202336":{"name":"@atomist/automation-client","version":"1.0.0-master.20180830202336","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"dd95b94923239f387e1309d6793dcbd814aa96a0","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180830202336","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NtB0iDIBIhs7jUAjUZlPalvAHO4gItefL6s6kzRIzt4ltQhMM51zoXCGPQiT4tOxtmjS3NfRdisBpELmmtObxg==","shasum":"e42ca6f6ee836a3150bb7cfa42c6715ce27b94e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180830202336.tgz","fileCount":816,"unpackedSize":5328734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiFMxCRA9TVsSAnZWagAAMxsP/00dGbCDqdB7tr4Y1mYW\ndBvoWZN8YvFre6kmqWBqpE5XPkJ17vW/89dzfYj0S4b2qRxA+M6K0oyBDRWH\nSUAjH7jft+6snG4vZyJSJa0R96VHwNJnHdE+ZPNDvsGrVhbsbCib2wdzV4l1\naC0Tiuf+S9ozZQuT6fqMq/0IO9CowoeCPGHftyC5TOyLrs0NIweMlk2a4IYm\nj1qBesJiJQCEPheNG2iMpGFzTE7lFSJeoB4MWN6IoDklI9G1GJLcUtCvADR4\nyIIaklHSu2jjepkQ3s4ZkKUvlEvVWu2xQKWgQ/lX1emeEBly9QWBIUSI9U/o\n6XPgUv0HgxuVGt+pfE8pwXysegyREFy/qZwpUx0ENk35T2i83Yig6g26LmbD\nrhTTLvnQ9rMJF4rBGJM4VjkqFmwTxiTIpL2CgeLRAHX1PZEPlJFCPWSgtxgJ\nC2ZvZ4w1Nz+XWEdQhH0SbM5uQCCOBpU/ZpLiAbnO2Zxq/lnQ544smQrwbZ6N\nwGZaPvUtYFzxWcpkKsMCQIavS5EMe+PLq1dlZI9oEyPtIe9matvIgUJYDbLX\ngvnl6zw2e0yquT1vPHQZ+99U6LZf4afAQ9Wfc3pVxF0ZMcNghifbnk+BFz8V\nyNs7nTWfn2gy0hs2Rxq2CtHU4iAv0npnlHVrEyOntMbJuiiClw+Am9V5qdl6\ny+3S\r\n=Dj6t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYuvEzDPaaq1Sh1TYoLbua4HRbe1ReCN9+l8O4KLmQJAiBTRXf6LrJ+QVEE8D12+fdqoDQ74ljJ33C07PU8R8SiGA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180830202336_1535660848563_0.07234691201694576"},"_hasShrinkwrap":false},"1.0.0-master.20180831010955":{"name":"@atomist/automation-client","version":"1.0.0-master.20180831010955","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d041e23601b0860fe9a5350b28a12f5cbe9d6b0c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180831010955","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WoAIKNGu7a41kw5v/iM/uxyfho8f1538MMoBd2hxesSO8wpmeR4Th/63GrQhfx+z+G8gMwCMIWX8mLkfhanGnw==","shasum":"31fa3b55d58e76bb76dc5825dd77faa444a7cf3e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180831010955.tgz","fileCount":816,"unpackedSize":5328784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiJZcCRA9TVsSAnZWagAAp8wQAIAD2wu/i8PtDuTnooIR\nC5UowweZWKJOT48YufydpTjvjcXb5X8AV0BnrnqtNxkKU41tIBYWzZu5vAay\nRHH/TyKclF6jW8X95+x49rLQWqp8NSxpFYiO66Fwe3UDgrGk89bJkc2sRxQh\nZyhjsPI8cdn80+4hOHF7l8ZUZcSyOi5HjWmq0IEOOGafls+AJkoUwdK/jQ8T\nDwCkZgz7F3JdecvBxmpCvDhspu1TGzp4ksx/D9f1enE+LdSQzNczCjGSI2jy\nx99rm3t2avTlfSU3jx8zeWX/Fff2QzaWMQSCmWzjWWOQNCq0CNMX0JQ3BCp2\neBCt9eIzrfW+Xm7S0hji6rIppUN/vEjs1LBqPYNlTl+W+Bul4xM/Dxv4NsmJ\nvJdfFiefFD+PFFf8cGS3gIw8aPGwXKBUkwfV+hq9KE01AjLteZbCQBlXsr/M\noF9JH09erd6+DG3JITSe9QYhYO/ZvCG9jiiQwan35Ofl18tIUOGd8hl4Tq7g\nTHUJZT9xE+i9mnroBge8yUXUhd4gtDeshi/KuhRQJ8dbMLJuWMuMJ6h7ShpS\npc033KBRfgPXQzVGvXbek6gPn+G9Jce5fI4vuhp503OBOoSCxdJNBXI38v11\nu3Rd44yCkyqaaRhyHa2npkm8LXp6rVhxCWXLkxZGoxS+GQJc3eHJspyzD3Yp\nSnTn\r\n=YEWM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICN4dhAFoeBz+Icon4Aw0nQJxPHTVuqAnwwhzBiXBsU5AiBs88j44FlXnSxGEts/lA51vO4ELBKFeb6WtCrfklUe4w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180831010955_1535678043538_0.6067911810575519"},"_hasShrinkwrap":false},"1.0.0-remove-deprecation.20180831091843":{"name":"@atomist/automation-client","version":"1.0.0-remove-deprecation.20180831091843","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f99b0378c26d5414736d77400c6bf4c1df5ed097","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-remove-deprecation.20180831091843","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8QMMMdJlRjQIxTiBU22M8gx27yHbvb8HZDOutgwGu5aGOHqmcvH6+Z8YeMXeYq03r0UzSw70uXovhFDTdOdR2A==","shasum":"20ffb024e3d5deab309e2e375c3193f3ebc97f20","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-remove-deprecation.20180831091843.tgz","fileCount":788,"unpackedSize":5250384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiQjOCRA9TVsSAnZWagAATRcP/jjsdDereXAahGQg3fd1\nylnLeZYSAnTbco/2FxpH4PeNxdhwhZjREDeEZZXU9juwwQceJoe8eUxReCuY\nYVOoe0YBSA5p0qmRfWjf9bzfAmuCT4fJovCZXKKNr/bD8DU8o2tIrmb5gpUF\nzjm12EFo4z8q0i1UDJifkaB6283fsWO2P6uzicJeib4qxdcdbsT9QG+Ye8qT\n4ciMuxpQQC3GK9Jyft1ALAK98eiHnpExU2IaRwLU5oqn95FSE5nhP9HIHlA6\n24EpcWxLCPNXNEww5fsguNRyjgWVDhUsW8mbnUj1bzlwaaBaGO2t/PoCnNun\noLT4mSV/QoHPufp1nI15oU9vBIO/sWfqm7eBmJEf5xYZjL4oak5QqXQJGsDR\n/xArLYbYz6mK+BM5AuokhRuu92gKeucsu815wNaIy7vShL7dom98lV6bUPHq\nT+fpiCWjHFNYsxu+Xwm462zHg+oZHJYiqKlBA8TRvxdUNjvqq6X2fwNgpT1g\n60YhAmO1k3pi0n6IyjJNwc8zPdDyi+07uXpmRV+F3iGFf947WhM/p3tU2QmS\nBrwe3MIiUKsYjf1tE2g5pxlvw5vHeKkNZy9JXgszzgSQo0Evpf9EjDHQ+Qlc\njDxrEa9Z2WP65ElSSsrknE76Gpv28TgRipZ6ygrTB03uTt4+kTXE+isfKMcY\nUEf2\r\n=d6S8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMPdGotDskm5YEoddZdafLZlJTBwzVRxb+v2zXsAIJkAiBh9O3/evYkJjjBgYpG9pAPJfhv09obs7wDEa+QZESlXQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-remove-deprecation.20180831091843_1535707341859_0.31044012092576345"},"_hasShrinkwrap":false},"1.0.0-master.20180831095541":{"name":"@atomist/automation-client","version":"1.0.0-master.20180831095541","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"4c8f677d2857f301abedd65d7fe9fe5eb37da56f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180831095541","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8E1AIUfOQkPQkwloRpD43o8cn96SC0dl6s6fN6B1m94m4Akqf6/7cgzyF+KquNt1gUL0jlek8U9XfCeOcZry7A==","shasum":"ad472bec63c53860fd5107923d4e63de9c38cc8d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180831095541.tgz","fileCount":816,"unpackedSize":5330932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiRGaCRA9TVsSAnZWagAAOb4QAIHFBn85rqAd2WpP+Pu6\n6tiGp5TVg+ryXeO5pOt80yGxe2BdA1y8LvOPlmtNtUEWxC25CnWt+h37pjcm\nnVVEcxUOVA4dCfvvW53rJ+vLX5eJRwvItipEE374xeM3rvbT9IaMWmaf/UNc\nMiuTycs2VB9CAisrv7W2+IHofhPYXdaJq+SD9NP9J451L4UG3ek9V4ueGllV\nds3fjoRoq0IfSx5s+Zx9Z4MpD+kW1YkLt6MeQZvVGU2hwvC4zcr2mwyxY1tk\niqLXFIThwi6WC107kCCmySzJfSFNUBKHG2R1/mI0IZRvSBsXmxoLQD3b+UCt\nh0iK/kQAxTmyAhz0JrV1iazhFu4vZ4wbNADQ20KO7PktnsUogRiZxXDyPhvC\nG5JJF1Sj/u5rYmKCBpGkh9lklv798DdX1QfsbZNeRs9PnnWHnE67oH8AgsOJ\nvxNGRD5/gdaaBTnLIofnvOiIgI3wsgtjCE0NgXllgeFsw502mrsILx7UHX2T\nEbLKwebDEKDCsO5nQUdHDDguWzHJ0zh4hC8exlQ0od/7X+9M10S5TwY3Skvy\nj+SCG6gflA1RxTCK8sBjnjVbtUjIDEqpoSH8hsa42JN+RWlKUr56Pz5GSFc6\nFxKxbH00u8KDTLC+zyi/LtdBTKxygzeQOVjW50rX2MbKVpnv35/F1vQN/Pnt\nvdBU\r\n=pC8D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChtavufwhVqRtXYypbYFk4d0Xfwlv6fV0abZ6pe8rDqAIgDfq+9UMTWiC4XCfUe0KCwHEeFP5VnXBPcznrSSTZ5D4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180831095541_1535709594119_0.8040096591455799"},"_hasShrinkwrap":false},"1.0.0-remove-deprecation.20180831095627":{"name":"@atomist/automation-client","version":"1.0.0-remove-deprecation.20180831095627","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"bf2907a5455e0017fe5a6d9a86ce52586ffd16b2","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-remove-deprecation.20180831095627","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-czxUuDTZf2DWG7kVV1jQjCiq4SsnVkILmEPS764sTGyrL7gfQOLDHQuqmZAkOXLCPAeLI08tg4nxe1uYZa6W2Q==","shasum":"ddc3fb710e0e5b0acf5a1607e9ebcb4a2bf0c313","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-remove-deprecation.20180831095627.tgz","fileCount":788,"unpackedSize":5252698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiRHICRA9TVsSAnZWagAAxPwP+wRD2m7XvHXNb6QL0/La\nrV5btjFxo4BQ5wuYDpm1FYvLF0sqiqb0Hr5k1SSnTNAwXSWGox/qdMtGDS1H\nlDpFTbZP+GM79pmf1xqp+N5yqlG+HiAEIEg8NgcyBuD2kDwuFkGBoXrxtyhO\nCd9czrZAxhYBvVVojNlTxxqUY7g7F11FpQs44ITdHiMGx9BO+lFeXyR9Uk5Y\nJ0r0X1v+OsjSIJZ5G7yJ9AgjRZLGkHaEk5hU1HbcHlVBEgbd1krjUCK2q/eC\nFYmAdkyi+okjB0DS9oHaOJYTnysRKEhOsyFml0W6tQYEuYTIH6gf29y7QSY7\nFrR7ilIIi2q4hVarJeQ4d6Q6JBHJCvkYTqa7qbX8RR01IBivyjvtUAaj3nOA\nP2cy/du/+xlKyctFqi/9HxMwh0nXJvd82uezPQoeDe+i8St1FGY9irHY8M01\nylFRJneGk1uBgiL0HPKPvYM2ZCbwNfRd+eCPL97Be117DS/VXuBvNa0oZwFu\nxv+EoxtKWdptTWsj4RspphvVxaiUB645cetKKGusBcWSzO7f6bQwLrz8gU2p\n9zGdBnfW2zMiBDeK+FTaXKsJnDv6WN8nhHSfnYPWcab1iER71uqBNAj7Xs4O\nhG+vyYGUGdFFzlAWeJLZsfznfy4NVcpXUBghGrs5yXMb9spZyoOU/bntntG8\nLMiJ\r\n=7iZt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaNkIORS8Jv19t0rQGa99FOkmJkN6Qj4PZ+5rbRols8wIgXEGVB8fSc2qm7RDX9+wPRVtb2/BHxdkibwylvi7/NY4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-remove-deprecation.20180831095627_1535709639443_0.6032200559739067"},"_hasShrinkwrap":false},"1.0.0-master.20180831121947":{"name":"@atomist/automation-client","version":"1.0.0-master.20180831121947","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f891d8ea8d743f5e73dca0112b04efab6a9a8cd2","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180831121947","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-YlLcu5Kmvu15EcTKmWbY8lsNM49+qtQFozszJ8WvmAxwtPKRFWNcGFNPjC7OdMKfU9m3p0KEwUlLHpdh48lZ0Q==","shasum":"e153476d6abb9c3f8e6ac3e6eeb9344facbe2a25","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180831121947.tgz","fileCount":816,"unpackedSize":5332886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiTNxCRA9TVsSAnZWagAAKNsP/i6xgWtLwzIgL/6kn1ur\nbQcSZaD+UbLY6PH5YDnE9EEPMlDWCYTbMMgUOUfoMtvjf9bugJ/jcr2etPiS\nx6lj8NN5SGIc9DyIlvHCcxidQ27qXauduV2gpDVk3vIENLXnc0iEQL+8bw42\n2jqCWihv5BAQQBMeSTgYlboBphjz2Y/Q5mES/w8nP7Qzb8QhRCrFpyEgjEQD\npKJ+YIWOxQ8Qrx3J9eo5rRVqLBZYTNUyDywK3pVhPa0LGaOhsEaXA4Tw+YCK\nWAZi9UxkKgEbw8C1UIRmL6mW5mzjpoEqLLY4J8LWzTSrsf9qDM8wdJ4gEE/o\nVl9G3YpsQVNxO4Pi/2ExuHTQmLKIoNOJ/9J1ibklSHI7tb1tqkbNIpyjzp6r\nbVb704166ZaExOB4OJ2Bn05PZcA7jkIrxIdGQvVRM1DGnZw13UzpvPqNzFDI\nO6sZUqpyoGIfYQzFqQj6G7RAfyPk8awVQXKISvfKIeXaBc93G1xMsppNEhT9\nvenehItPj4XpbvPmFc8G03jYnH4P3V9NjYBUMjKgEaXRLVppfIGVV6HfU+cH\nNvt0QlC9N1r5om4pN4/3SMG1vszqXTF/xY1Su2WopAR3qfKZI6LoSME5p/by\nNE8x7ge0aoUQeHjAulgm5pLqzve25o2JisABi49p06qCvrbbhK+Xp4PUbd+1\nsO8S\r\n=8c3O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4f8xOACv3PBxGIH7mTBBvt6RgtZSan+jHavDR1K15uwIhAJTfICgayOU2LZ5G8lvzdGP4U4kCb77P0TICZD7IaAIs"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180831121947_1535718255819_0.7597081271373416"},"_hasShrinkwrap":false},"1.0.0-master.20180831124448":{"name":"@atomist/automation-client","version":"1.0.0-master.20180831124448","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"d6412ce2b3079469efe8bd97a17add20a4e164a6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180831124448","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Yn+683uG1tq6WOkKHHO9+E7WipmN6sYZNG3lT8tgVEzt/UrvK20gknroNpzkewQml5aj+0aiqV7gvKUEvPuswg==","shasum":"c859c898709df6ed0ffe69c13dc93cf1403e82c9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180831124448.tgz","fileCount":816,"unpackedSize":5330141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiTk0CRA9TVsSAnZWagAAnXAP/jzJxhqd/AbZ9FD7yt2q\nd8Dfpfc1wiitavfGDJgUioBqN1f2ETp3YlhrNPZ2ISjuG5fVk+UB5H6WiaS8\nbez7uQBnTKyw/Holhzjk5PffvhPu7ucooIs3j2UMxwwdg+8kwlNHYthJetxW\npujlxhi7LUIAYjmYoigoN19h7X21yidUyaf9RoxXdPHvJWGqK57ZjP3MQOjf\n7rtWuQMiSxfJREKyRCziy/l56wLMqQSeU/HPj1ZUf1Fo3bpdDoMkeB97C82b\n577NBRPAgyBPincRyfdd8ejCC7rJlgvqKXr7HW/5Kdq+W4CP40t3rThOzK9j\nMgVw+spM33iCE8q5vfr73+5QAbi9PT6YbiXTVmyi8zZO/tNd1V0qeKdPXXPf\nFE4zQaPxxozUBE6BWSV5vjYu6gbKNDhf1COFX0scEKUsX9dwAytRzoKYjHuW\nX0CuDbimWU2+M2xViH4OGzo8vdWSKQ/QrR0LDtfzukhQ9mCPKpqKqE6yhFbH\ntdgBKk9oqbSfsChnqGVXes3ieXXcs0iAWxgqu+z9Ox5HPDLL3UnZ/90PShcJ\nCMtBVsKWAQ7gwgPH6yeQBzj5jJrbmtHUaohlVA9kKCVvxVVgakx8NxoEVQta\nrc+pWf5RX+PS3ma7URT3R0Oxw1eBbQPoy2qCgolRCvT8+yRu+yhtBZKN/93y\nNZcc\r\n=7RNZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6YrJ8vYGygGxWcV7owiPHR863nPSMUmnzArKz6BEyyQIhAOvk5ZfmirLgR7nLFBq+UC8zoPAHtSsiJfmAccR2Kspt"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180831124448_1535719731234_0.751551024217918"},"_hasShrinkwrap":false},"1.0.0-pull-up-id.20180901012146":{"name":"@atomist/automation-client","version":"1.0.0-pull-up-id.20180901012146","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9411b08d87844015f12ed5465807bd1f33881527","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-pull-up-id.20180901012146","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-CeHriXLoj/a091sYyC6HR/KFxCJWFDNapDfSDGGTx1r57r6goCAEtsgWuO+2htynwV3XkLDAcddH9YrqZasbng==","shasum":"575ea45cb4931b12902984312cc286fc6ebcb341","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-pull-up-id.20180901012146.tgz","fileCount":808,"unpackedSize":5322677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbieqRCRA9TVsSAnZWagAA8yUP/jzeOMDdvRDBZrLcF08C\n2XmGslZXu3uhvMnIBS33tL7ShfNcklKtZy1/d1FCQ30yC/3GCYOoSxNWHA3D\nA2MEL6aNCZVvVefQ4gAFdVSPtaC+6BUa6KKoO8I8I3voVloA7SmjP1qMh1q/\nJv9AcKtBlMpSkPgpqSbEw+6NrqOMHdHxzJdS7GABUBHM/7MXhgRpaEzS0rHb\nzPfq6VOuUIQRyL0a+ZDEUogqcRlKSV7fN5lSO9mmq6lPk0b0V3ht4fCuORVO\nINhUrX/XQf4SWrFmecjbGRK1o2daRN5IOvnSLoDOvJo2ajvhn/N04IrN7H7p\nEO2wYRBioLhcYPwu5b+aWSpWnUdHusw4O4g3+rGEOutBzkJT4fgHtKqtA96Z\nCHfCJH6DSE9tozZiZESutvzn4cXxovvCaEXEYYdA0CtXq98V4wCgjRFu5iS/\nyKZxNW+j77QHzOg3MQ88AmZvLJHKyGxep09JjSqJBOxntqDzIXM0KEzIMl+6\nYbgqr/eDrBJIeqbWeea+PPm8SKoNvWE/Aq8rsUuqe7QIqmcJJzdxeYuaCogn\nAItMoAhqndwtUAiFGREluOMJOt7impJNLdnGbbUXRljHsL2QlAWeBbSakHv1\nznWU3Buc+PwA9eNDFhauM8W2Trjcp1rlgsOYHPbMFaSjXLwJYmN7jfzQb2mO\nj4dS\r\n=1jvM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9uA7T/bsAIJY8XMpG+bQ2NKglzhGvCQfB0kARF3YbUAIhAIdn1XujGK9QGbxjEGjWMPDJKidOljIOCBnUQVcaJr5v"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-pull-up-id.20180901012146_1535765136645_0.5724754475967175"},"_hasShrinkwrap":false},"1.0.0-master.20180901082459":{"name":"@atomist/automation-client","version":"1.0.0-master.20180901082459","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1453aa06e775d4eb56070530ba74d4cefc41c787","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180901082459","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eHHPwDbuWk/IracLX4tePighGEMDwnxPexacXPGaWO3/v1RZ3J5HNdgGUexy13If3Hmlmiv4DXDHrjmc4H6KZQ==","shasum":"eca828bfb86416e1a0b85b732d108aefa4099a9c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180901082459.tgz","fileCount":808,"unpackedSize":5322673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbik3PCRA9TVsSAnZWagAA5i4QAImSQnco/iZ9jAtQvm87\ndLvaFz8Zeul8uv1t2bVQosqWi71xsX997oSp5VjCmfpD9OIz9pIe8ccOem1D\nEUoa2ykaSXbADxdIOmLAKkpz5K10ppVSGsGyn4Yf3zkBF4jmNLVuXLdNXw9O\n9mqdvwTGtCli0ukKYUunIR3xSLwRmkvInwnK/OvDiZtf+UMqYU7nU5+nZbN8\nCuZqZL2rhrMoT5OXT+K7zJ3Bjmpjr7pY+PNIt8Ht3ARX0xQGcfYNqHmac5Pu\nJ5yWx8ESI3ClK8PQO+vyt26zwzwSBoc965MpJz2X52ufIDANXyvkJfrzOgBR\no4qqXBlBWDkApWSdgv6Kml93s6sQ2HFsu+Ig5pTArXpdFrKzZQOzUyJTHcr4\nYRqXySSrxPos4afE5skYdNqCBpcR259VpOLrIorNHtKLe/D0XdosasT1q72l\nSK9+MUyCAGnufwfUNaLxk0TI4beNq26H4+MnDuLvHuyYYF0mnPMn/YPXBe4Z\nJYBvN+ek+e4LjiJV/PPjQw/U1/4MjXVPWGKGEnQe//t4fB0I7bL4mGfBUQyY\nP18H4LpDoYj2QGLp9LKSGBndD3Z1RFKgCIZ9NZ6mKzlBWqBtaRYqZqPZWeLk\nGRFYMYswWYOtDHbbSbUURE5z8iSGkY0pXMxbZI6i6Y4qwM01X8mG8BXTqJU0\n3fnK\r\n=iTEF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSZpemeom6LKJUAYxRN2X7Qu+wgpEipQgFe1F8gilLpAiB3mCLOLOHUrf8BXvLLaIhsu1mCCIZtMZFT0CnwDg9rDw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180901082459_1535790542097_0.66195076095439"},"_hasShrinkwrap":false},"1.0.0-message-client.20180901165917":{"name":"@atomist/automation-client","version":"1.0.0-message-client.20180901165917","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c66e59deb0a0e19f5434e2422070928f0f153952","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-message-client.20180901165917","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-4XJGsH7On3qyh8y3ntH8AYye9ydyCsoIRksQJ0WEirdnVECBLQ3RyxUMztNTPIf/fbGOt9b3xkv3dkk7bkh/nQ==","shasum":"089d25d4c63ad8dcf2bc3eddc8521ea8ce5adcfb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-message-client.20180901165917.tgz","fileCount":816,"unpackedSize":5335773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbisZYCRA9TVsSAnZWagAALpYP/1ZkMG5mB0frR08RGEUT\nHCNUOMJs9xDGdFeBszjplU7GsPyqrQkhpBXC2PCE6oq4vgC653rhMcnN/L/K\nXLLaaNGSXnf6n/2FeSEtOaTbsrujcBM2rNONFCchY9yIkcqigMAOOGG76i1r\nBzSR2rs1SJtEgZRf4Dk/zXZ5A5LYwKf/9aphdhzpbH6FgYrHWaoSG/zoFxOG\n7HdOqvByDpQwh7CF+q7QVkHDKXmYS+hP1G65OIZe1r38G1A+/ceZUUzlOhvL\n+KiKgP0E8nGMXt3oErZsPIsYyC0Q3v+1jvRXkbbMG6EuyQKBNCzUZT3IhTEm\nc2/BLgWgzLKvcN04Lo0sWzw4Rj+vCn8NIYhlR+Cd5+c2duoRcHF0VzcfUXJ+\nVmZy8u1OWXyL8ChquCi1k3nF290x3vKJXkgtCTM7ONQ7pxmnlLXe9gfDBnax\nPRmUvLqel5nhtwqrveKZW3drFjvdbQTvYbpqwp5rhkGzMMicafZJ55aydT36\nsLs0fq/gzAiik/b9Wm9MnZKXSfCFM2NnIrQW55UJ9r4tHRAA7i8ic8grzXus\nQlZi2NfACK8osFpCfyFgyveYh1AhWxqRMT0+Iqy2GQrSPSwXhqVEGfIRuYFG\nPrQhVQrgp1hzuLtOXgTlScCfoXiawaFlyYiw+f+dTSiWL0rp2fyL4f2j4OBY\nohJJ\r\n=RTeJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDy4csrsrI306FGbgNm0Hixfuj8nuRAVSnMpwX0n4+nDAiEArGG7S4gaVoZTZmRAQ92NnZgv+rr9lZvlX7mZHL3BE48="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-message-client.20180901165917_1535821383352_0.3592239911439439"},"_hasShrinkwrap":false},"1.0.0-remove-deprecation.20180901142930":{"name":"@atomist/automation-client","version":"1.0.0-remove-deprecation.20180901142930","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"23b822647e5d1ace3485fd65d5b314e8d5dede47","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-remove-deprecation.20180901142930","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GTRZnpZsiUDtMNbO/LXB0xmsjhrv+wYda7BJqT6pYtdZsyjAaPvSAzQXWiAAcxwA8ArQU5VgT3gKAo6PzVZVJQ==","shasum":"7ac92194756e144fdd3471ed785771a233d9e3ec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-remove-deprecation.20180901142930.tgz","fileCount":784,"unpackedSize":5249346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbisxzCRA9TVsSAnZWagAAuWYP/j+PwfXYOCLtbLJMQ08U\nK+CS+ONeFR3MeRSDr2Oik9Kw02wgbqOCbkcvAGUbKJNEgvp83+t/OXv1U3or\nu8AnRkvBeQCRZfIUWhwsikLos1yViWI1BlsnyIz9IugkweDMGb9VZAIDc+xx\nCPotYu8kE4kuzrc2Br9+WsIa2a1pRNetFYe9UaGuVDgBcTJ1RxKr7cAI1Y7g\nji6oK8kCVCIEQtYM1FFxsh7t711sRdXnSCmZKd8Rj6CBXSfHqJqEjRRFLxAd\n63VJqLtaTXis5G62pYm+lfj+XqXgxxmuAB8mmFAbVyyAPJ049fU9rsWgtoe1\ndsQXCyQLov/VJ/kHR87LQLjwh8iejfr31Z54Gg2uZu31jgXSPiuqOuTIu3WE\nnQge36Ij5NCKnB/hoLWW6ZNkdMC7pahibwtsRRB7vNZMIwozSMkWL3hVHG4v\n0bBDuokAammZcLY79xyWTPE54Tw0MAqI6dGuxA7n4KMe8u/ZdGERVfq3f/q7\nolrd10DlbWp1bzkGCV30XXtpeAsTiIZD+nZyoal6QBe1FbK51VXWHAPRGFex\nZeeXVx6cF8tgOP8zrSP/hdpeQN2y6/mZ14y81SpaogLuUD1TNJg1qdzGacrg\nXaLY7gwOlKbhl6FxV9ZgGczMTK2f8/lT3q7j4dt4cK0amT8f7ung6qP1fAYS\nflJS\r\n=cQdc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdSlEpeFjO+so5a9tBn1n8NHMXIvrYPhQzQG5HLncq9QIgVDNH+Cy9+A+IXjSpSUsw4+YRzyUwbjNOLGzqwN9cKMA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-remove-deprecation.20180901142930_1535822962496_0.19612345698608236"},"_hasShrinkwrap":false},"1.0.0-master.20180901183023":{"name":"@atomist/automation-client","version":"1.0.0-master.20180901183023","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"a8092f84cd8751547ef2e39b778400e6232250aa","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180901183023","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HaBPDk5Q3WNWPHcBZ8fhqI2fVniHubCWf9xuxK2YAeCEvc9rRTzuymWLtLHSzxVSJAlgrEUh1eb5vQMqAw+ZDA==","shasum":"b4804a4d03fcb551dd4ad494d9e4d3ed1899e4ac","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180901183023.tgz","fileCount":808,"unpackedSize":5328426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbitunCRA9TVsSAnZWagAAxp0P/A9Y1wEbLxwazp2qwlXt\nMyx2SPT3tysb21E+zmLpA0tR0BcwhHnolgHxHrBifIMCef0oDpWaO9SXe3mr\npAomwuym+nMaU4qpcD2p60Cs46Wkq9S38VFKx7mxMgCAckX6T1xkR9pNTpZW\nRJJjODoK3xBLDpaphDUiX9xkbu7UkD5UbYQ5LAGuvTfiJcB87KpeJAQow4xF\nDJTPnmo38txA/2Jr+dvMIKJ8w3xNT/nZ6lZhbjsTQgd2A/DDdqL+6otFsh+x\npcC4NIQb8p/vXyXD3q8rGiZEEX/7nV3eIeKt6LgluRvvs1lps0Civ94ufmh+\nLXwCyX4rttjdTnpFqvxxJq/bIWhFaw8+oWzoI3VaCJWruiJ6eHUFuXoDjfPP\nWyIrQtkkB8Zis3MG8Sr1pdN2eJqmtgKta6DvDbs4HKkoQn6JVjBlmfNDNcf3\npHzK5ImhCkejs2cCGy1Oty19v0yLeDkw/n3jzOHlvN7Zd6igV2YBWLXKQ9/t\neT4XPxwJAv3mRn/V3TJ/R4uZngSorDmMKLCg/tpY68L7xalkpdMFmqBPd8Se\nX/Vd+1DBf/qKVvexZuW4BSMvmXevIVT4P8MUdD/wVNt36Grk3+ReI4hc8P4C\n04MX3pWAMmW+LcxlN9j+fCYOgW8nTtH63KO7vSyfGlrZJCa/8Q+jkJmlKEit\naxjf\r\n=hfJU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICq0pKDyLyej7/te/+tu7b89y8c/MSiMHdBB5ssU0yvzAiEAhvPcTbHkth1pLCHmjZ9s5fS+j/F7lBMm25FeoIqdgM8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180901183023_1535826854229_0.6528722613249112"},"_hasShrinkwrap":false},"1.0.0-remove-deprecation.20180901183348":{"name":"@atomist/automation-client","version":"1.0.0-remove-deprecation.20180901183348","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"8787e92e7084820fd43e6f88510a9ebe370fbd04","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-remove-deprecation.20180901183348","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FI0iHHk+ImDFC/FENPgBHmjyBsGoiN0WIpbaSDj0jTe8ZTcCerQxk6IuVmy60JbwFJDvyEJhTady1KL3XWyguA==","shasum":"2c1ebfb6b2a24d788ee4ac1e3d305ab64d0bd2a4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-remove-deprecation.20180901183348.tgz","fileCount":780,"unpackedSize":5244638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbitxjCRA9TVsSAnZWagAAXgUQAKTpUM4CRML4flg7bpQ+\nWhnQh0Jnum1eQnnU+iCaUV2XU9P3fU+nvDPUjBaGOdPSIGFsE3ZFVDJDvweQ\n6+mOiD67ugtuL3DfQAplT5qIAIyjv2IczOvNxw5nBxeSO4BSi6xyd+vyaAvm\no8bG4hqu9TPkpGE4D040kqVClv7FE//uinvlOv0nflWP71MTYtLUK5Iujuf3\nHpvnGSQ+10OeqKyUJJeDrsbP9FQiGB22POMk6FhQTLnGjXr3eKx9B08iFp8h\nz8Y3LmqVvG2pUG4QivOpIg9A3ycGDgEogmqT7TQdWx94igyuzBoYgna402C8\nBnGSJMt3TeozizecAWorTrOhqKvg3xFqpA8LwS/VmY/MkGbneLsmME5U15SK\nKnAqzlYcCOHBLzWB1wvlFbec8cSZPnM0RMhyKfgnKTWqVca8F05QdirObE/C\nq+W2Hhp+UnhbKrsFZqRp8L892Mo1FPe3OiaCURxVAmoEvetw17mgDkKe+EW3\nlCTWxN8wdM5QUZFWhSTFBR4Ng2VX1DEwGk4PhiP0Mxj4jytCcQ7lT409MRx0\ncnlWivUMPUOMxvoNTgyxI3jRLRLrOdFNDxBcvS1nOZeOGy9ZE431GBkMnDOz\nZkQeQLf4qf8SjSo4E5kC8ghYCunSqKqG6ty1SNCJGGybbo9UwaB5veQA8jhx\nRVDx\r\n=D39v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEWQdevE6BwOMv2B9NYGIDlwC4WztHrXHAHZLC5kCT9gAiBmR17LyvkEttyqqbkB1lhl6lNBuz19/+RJWhAFnBvkBw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-remove-deprecation.20180901183348_1535827042809_0.12350684037943416"},"_hasShrinkwrap":false},"1.0.0-master.20180901185845":{"name":"@atomist/automation-client","version":"1.0.0-master.20180901185845","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"69e5df9187012613070c8f14f539b4e32904b4e3","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180901185845","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dHo7sEQXBVDGdd5ZYJ6l79yTgqFNaN4KRLMR+AXscFkJMAPqavPgUl9FZu2Z0ruoyt8RKepYDcRK0/fAMOj+xg==","shasum":"3e35bc0b49865782d340724d720facab135ffb71","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180901185845.tgz","fileCount":780,"unpackedSize":5250350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiuJICRA9TVsSAnZWagAA2r4QAJOubpCjoVPMWcq3Ggwb\ncOjWD5kvLeINewygk6lZR6O+4nkMsvJzBfMJf8c4VrYzY0UMBy++iD8Fopd3\naPbfXM0IDtA9CXbZHEdsVa2mOYhzQuhWd8hchUDCFptXL6DEJ4dFD7OrtYXV\nLqMthkkkfwdCafEjy0muHNnsB+2qB/+iB/a+00PUsmczz4wiwK5tUkV1f40P\nuyhAONtERupmU8n+6G1umIXx+hzxZLo7N9VR3dJlQMS7sLqonH2rL/C3uXn1\nAoBPEbO44EaAHBl3qKixke7sw0WqqB5oA5iWmOduFlJl/813rn0b7lsjlClk\nXf4b5lfYZIs3ffzC/XEyOW3BltwSx9zHtanVQG/6nGKD9AMVZ5oYmMSnw8ok\nhvs6/kU1W6xdf+TFekXA5a+6j1WDd4la300ABANPgP5j7Kv7UcbnTdEzqN3n\nurR56SKYyB8x7KUIec4ehei6+dOBm4gCqRne0nraH/vnuTnCU2htHRYCV6XL\nwT8T8TnsbGO7rBRCrAH6lw3+U0a6tc5T//y/qY1RxG/c73kQhBI+GypUuRoQ\n0bus4zqtYovl/COXpTnR+0bkMEHsszWQ/E6kt6qrqotCiX0sauwZpUqm0lci\n3WfW/RbMcOKNCY8EKYH65u7sil/CMfN41stxWaL9sNeJ0W7ZlOrqYrWn1pR2\nYs9J\r\n=xuOT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/Au3xbQLH04d63Hv9+eBwUQ7qpGrvhU2kQxaoLbn1zAiBNiAMQT6box3x1BUrzJXIx73+cIxzS3JGtJmWRgl+b1Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180901185845_1535828552126_0.4448882189237213"},"_hasShrinkwrap":false},"1.0.0-master.20180902103822":{"name":"@atomist/automation-client","version":"1.0.0-master.20180902103822","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"94239821f137e256cac6c0f26add0a0832b8e654","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180902103822","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mAp+mprK3nX/wFiBqvA6y46RdSdKnOr3OvTMA/zCCYDfnUOlvh4L8XHlKMLJAfeqQMkuMxDN4qRlIuHIrZP98Q==","shasum":"6c7edbdc459c6875ada834137fdd6c45467f7b1f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180902103822.tgz","fileCount":780,"unpackedSize":5252815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbi757CRA9TVsSAnZWagAA+Y0QAI7BBHDQXll9uphtl6lH\nU1q5F7wXBbuWECaZhbjKOOqdp/2qJ164ANnXWH1XvruEctyGK7UVd7FEv84O\n3DVN2tG2A5+L8/+iLU5knIM1OQ0CJy3L0ad47X9vZxNnzSIRQJrBTvQAF1LM\njnB748Ss61fKDTu1frNWfdosLtQEkg0+bU5gLDuAeoyRZ0ZCqXgzknRMNrf1\n/2ejKGTU4QaeEA0/LGMHpHGQXBFM85O6prA54Rrm6gtgEMbDTrOXC2nnHh1u\nj3cO5s1TYtx9Lz96tgzF059289VQNpJ89EIF2rWn89AcG3iicK0bmBMLIfHJ\nSXkxHKGSqTJUlaUOUlJXos9ApzBIAZHSrSnXyBmU4WGHP6FfzgvlKX5hTIVG\nQDyJbdnDHQR+Vc8cWGrTnN1juPMKzIGRWwH8A8SHrGlUqzt1jv9lYyK19B86\ndYjAh1W6Io94eA/rwcmaH8TJoc9lTJ6sfljxObZEEioFf/MIl5HQkCr97zFc\nqB4r07/wUMRGpwQi5NrXrC4lH+7Z/IODLGCCdu1hz6NwCGu5aueUrLq9WcnL\nj4vYI69Ipk9kE/lPTVDnBEeiykmaNpQgKlNPQxJbY9ppWVqXEyWreBhPAO12\nnEugvzGUrj+odAhCpj/HmWJc7dkeUzjnCVoczonslw8eT0wBL14prwySYvMz\nNo9r\r\n=B2ro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0iOjN+CYL0n2RgZFS2lZ6ghhQVzXs+xR5bvwKpHejdAiApqD31Ftnv52GF8NsoLztiE0oZkpOLunq3UCcjkH3JbQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180902103822_1535884922826_0.6986750301670119"},"_hasShrinkwrap":false},"1.0.0-master.20180902124855":{"name":"@atomist/automation-client","version":"1.0.0-master.20180902124855","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1d141d4eafeade48ffe9513d8a683ac2a71f843b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180902124855","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NzW7zVrU7EjAGZ1JnvTfTvTN/6n+eEm2x0h+EdBszu+Rw+ccj+siBlD7l+yvX64J8877k87Hs9PjYtSZEY3YOg==","shasum":"8ab6b82b7daf005bfffdace86a9c0ad5f285a859","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180902124855.tgz","fileCount":780,"unpackedSize":5253826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbi90bCRA9TVsSAnZWagAAMkEP/3ZNXY92DmbblBZSNd5p\nst8ERh9oK4lx/fgtG9Z3pHWRxsY0528533P2KywrQjm5sHloFIsJ9LoEgeV2\nedIsOWMq6FLsZrlQ9V1LeGEnrpJ8xIuRPqvbgftaEKqUDQ5VFv66h660c8TX\nySoPlv+vz1K/MhxvS/ZMeIlqIcN6/xUorQAocnuzoYl0ClKg0ZgpiPb6cNVo\n7ClHDRSDYaAWezNxQxWyA0pYQATYuRnnFcO0ULftcUu5U1DyypsPEYaj05dE\nLiOeVeb+hoqSSGaTbGNdDDHb20wcINMDzNMGNYuIaEqswmIBmMUMQ4pKOqOi\n7o6lKC7ylzF1fL4qIHE3KihK3yeJgvo91bzUtDCs/x5ZSLDoAh7RZ6Wgl/iF\nAB4ikX4qdcpj8JYHe3oFDzVmw1TYmLox3n6uCXLr/NIu9bwdOFuLJUVC0l4r\nguEJCE0EHhPevpzMfVJWjx2tyOeIS7m+PTUCLbMSpL0R70lC+xBPbTczj3V8\nt166J1+t0Cs3bh0+pxRUjI2Vz7l66IZcFwRU77dNnCtEBAHz26wZUtOqIgdD\n0qt5fLLswBj6i5QONm5852hFRI7aPaLaC8gZNxXjSHjH4U6XIjTUwrv5Ody6\n5t1uyRZ45YcfMSi4CDIRP+tOgSig/G6kDTQcnXokMTn4QpLiZ0eTz5eacea/\nLG6F\r\n=v791\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD72GF3kH4OodWHp4jZwnC6BaKAcar1pegvF77QolcCZwIhANaZuvcJe20TLBs78gvv01ThZHTuyP3okMMdAPCzujiZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180902124855_1535892762777_0.4748965812387558"},"_hasShrinkwrap":false},"1.0.0-master.20180902125238":{"name":"@atomist/automation-client","version":"1.0.0-master.20180902125238","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"6c939fc78c46605ea8e3aba849ccae977796e639","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180902125238","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-p7l1urKqOkV69z+5Dj5uUEHIKYrFsBDjT0VVkLQTLE8AxsfPPFwFu12VtvWN5x2nCQdgLfZOieckumIYGdTaLQ==","shasum":"821d4a31b4de81c38da8565a61ee55f4f29fec7f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180902125238.tgz","fileCount":780,"unpackedSize":5254159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbi94ACRA9TVsSAnZWagAARVoP/2QMWDa9RUwTSgmcWrM5\nE06upAud78NyYngwyDLKnN7bY3Er4f2yI0f2uqvvox2rfyNU/Ip9DBfjL7Ts\ndP06NglrFTzU/9fZQLkiOrjfzfT5Gzmx3XO+nNTfimyxcADkhYnXFabW03ce\nanwEi6mbT4JHapsN4u2uldcA6daKm1VydA9PTm0scz01JpXHwKOzBcXH/0B3\n9wqdTImUhjvoemSfUBZBG+Z7PYSX8GBdj8OwPqpomFmOK3++3tY9vPqPN7S4\nzalEvpoAijFN/mCXZRSuNNqfTlsHwG6SiuAb5lMV08FGJxLeEbTzeB2jnfXk\nGaH96ZF84XaiFyTJm4rDNigozEpcdhcq0gHkfwt6vVuzs3lYDosQaZ5+gZIB\n7MQNcy1eAodpOGD1Z44XlAqwVRVlH2NMYMmmpOCjh6tdjyg/DjiTY17j4c1p\ngI6VIZTnOQFs7zB081FYcUuxCwSOv435OZUjeOrmN5mnetokOyJqowAoFzl6\n0g+i+cBn95ljQEotXniim6V25iAWjHgvbl1PtuB/YPkSCZOBlY3WYQ8RsxTi\nqPLsP7s8IZCmiGqM7nzozjzgS8MZkll9Mfem6vQpw+W4CU91mbFIOVuDSNZC\nIWC5n01qXvQLX2IAiTBWcS37nHUWE5dd/MPEPxeoyoB7YJBZAueYCH5geBwl\nSFpH\r\n=Rjpy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5LqKghzbDzZxcQdzhxkJJnzsFQ2wGcXyoiutBJVZYbAiBhCyq4vyypqC8z4bUgp6IyyvlJUZEmn4Glurc4EqJB2w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180902125238_1535892992053_0.666087761504667"},"_hasShrinkwrap":false},"1.0.0-master.20180902163213":{"name":"@atomist/automation-client","version":"1.0.0-master.20180902163213","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"486a9c6e13bd8bca39a94e0e54373cf882ea638b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180902163213","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sxaUBAH1jQsbvp+ex0JqezW9bIXGw8BzjBl3d6xXEGKQBaKvdixOhwBSsgfgrc1mmdyps64z3ZrvNiguzTx4pA==","shasum":"072acf2676e544ad34b53225371ab149af1cbbae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180902163213.tgz","fileCount":780,"unpackedSize":5254046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjBFVCRA9TVsSAnZWagAAJIgP/RMv4KmTOtErsjrqSPZ0\nlOQlkwV6a8GS9dbMII/PKIY7uQ5CjBSmDhqtjvS66PnE4qAG4RiaItuBrB6L\nutIDqLlGuyu2bqNFtONHoEq+pUf/dIZfukZbH1jNTAxkSf+RQLiN7ff7BTPX\nmwq/F2UcJKS+EAvLB8rz/Wo4qnQ8qVARVcA/dWOluOTRubkZMOmfZnNGqFww\nUTGKbjHmBgoZpYyCoE9gXIOl8IgOhpbsP8ppEBaw+36hDhUpvl6QKou02OJB\nvIkHjCat4L72FCk+e7X+wl4JCqsjlhsIVvDxG6PLu7ZmQSjkkT1CIxeA/T4W\nEAl1p6eVvDjabiz6fi7Ryk8jW+XwgbrCvmS3sn6Mrg8Rr9MaE+LRbWerdkCX\nAkOCr2G3jwuNNLZrie9F52ikQVjmH4R7iX31W0S6urZF7gIHOODrsXMn/rz/\nYDHXrTUo1wV1pnUJG0ANOsE5csLml1ZpGFC/bU3PNDlmxKN7Lj6K8qIgdmdr\niRCb8PPwJu9/FaVcvHYxGSyRQ3/JnrsUw0J2S1qIWoYca8OusYyQZDnBbFS7\nJC9GbDs8YyUIxxQz9gMJ/ziUMmtqnLHvb8zpNFcWC/CFgffZJFqlBaQTGqZv\nOO9SXwTqIdQbVVSEPPjjSTCG5eeUjuYXQdBzaePepOO1rax7/XhZbtS0bh6o\nLBv7\r\n=RyGi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICorLvqoWJ26A76u6OJXIwYHOQu2gQRgpy+5HFo4YiuUAiEAvnGTvmxCjUe/UYbP9HAgNkNLyPZd5kvONkwSwCix6FA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180902163213_1535906132658_0.21743906798696444"},"_hasShrinkwrap":false},"1.0.0-master.20180903210158":{"name":"@atomist/automation-client","version":"1.0.0-master.20180903210158","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"72573752792b2d45addaa15bfa04e30d7780cfe6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180903210158","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VEt9he9kdtvPFi5Tt2nJFM9IvpxQRVtWRXKVMhDhmIuNni1lmhi+RJoaSeWtFwnaenzId8JQzSMZkrrm86anvg==","shasum":"430d63f4d2231bd408fd49dc44c337e09e3d3197","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180903210158.tgz","fileCount":780,"unpackedSize":5255201,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjaIrCRA9TVsSAnZWagAAnFsP+wS2QIO9XevkBC4iAfiz\nRTgiLLNUSv78tWdpQ8O5aCMzyLD1Yjth7wmosU0HfCCMHcAbOBVfyayfLuw3\npg+wrcWEfhAePDZxFubQsvpJQr8rVRFxhfxUTUp28ldJ/6NyzmvK1XnTgBMs\nfkJoDoWMKEuX9o7XPxTDq8+yyDnsjnuRm7H9zZCEOjbagkjjsWUN74g1jHZ/\nxgy6he7dZVgojUlyrtNV8w/gP7DlmOKqAUNIpCB8LNGV67XgkRFc74/6uPWk\nyFkYs1+0YhW4owcmzQhGIc1/0frzc3Sk8UeK3C2iMfbahKbewtudiVVrrrnS\nnb3j3C3+VXNgqWIv5uhWPuwiegH1GNWczHUGKV9L1+LqujIMMo7tZfQBB53m\nh6NvmpOECHItoNad4qy7S1sypGRw5wHMV5cChRApOMO8o+VAxir7BSUm1qAp\nrv5VYbJSEaFAz0zoyVsACU8FbeFeYFwUUx9pRvaVzkhw7/R+cv5k6MqT4QTJ\nG4A6kJuZyJJDfmHxK5IeIwKiW4JrhcP/Jn7pCkEVlS+7XnQteP5yApdFuxCG\nF9u1tLDoi0pAp8dJEUWKdw1R4C+b2hdQXZA4obOQRASDMz9tn4DnW1hIV1Mf\nNdqaVABwwYM69aqBvPn+jwam+Y+4Rr/J5KJ6qATRG4XdlMnU5j/qy1iBlF45\nx9oa\r\n=GPRF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGrNsDQ+j6dQIupD3R4tFJsswDCuuj5bNnaSLqxclK/gIhAMyaZqWbdnNKzNSJiLBy/aC23FSlywNfmLdHMOflT5Hh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180903210158_1536008746730_0.4799389292415639"},"_hasShrinkwrap":false},"1.0.0-remove-team-token.20180903220724":{"name":"@atomist/automation-client","version":"1.0.0-remove-team-token.20180903220724","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"783e34aaee32d570fcbc8cc524d5dce78899ac32","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-remove-team-token.20180903220724","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-w/QNh+UfqHMkW7eYeJ50bjfF9qNXrmSwlaJKqkRH2fVv0CIUPHf18G01jaskUSImg4zkMy6sxR/jP4aWaiWgMA==","shasum":"364badd1e6d6ed3076d65e7d3b6e5aa24fdc4cb8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-remove-team-token.20180903220724.tgz","fileCount":780,"unpackedSize":5252151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjbGLCRA9TVsSAnZWagAAWZsP/2ZMzlZz771QcT90ZY0t\nIxa0NNEwp4iKccouBcWTeRXY/eeASQFQkJkXp4gBY8xDNFvGnKR8jUOGNQDH\niagsFL8LTPELbZxlt1WUVMNCg7YmLZx87nm8WH0Bq7eFkf9X6Eqk33i3T4nR\nPbJMmMHftR3YheccA3OFGAIUfwl6uuPgVNd5pD9Z/bf207WOjIEGowuomUPx\n5MKLlJZc6wGT1IMfVa+8r/R1Wo2lhTSyeE/Owbo9MoZR8nepjBM27A84EMRv\nBmEl0ZcpK0pWYK4xBuYVxF4vELNFeOOiNepZ5WjPO8YACx10fmv+tfMdOp78\nuTSQArvJYGUBKiEuFahrUqY3ex+qwmNqnKH00vDk6lVloMkaMk4uXPsA7/P9\ny/LDTYVz8P8qolAq5E6D1dOtaMmOaeRrB6BeMIzUdSP3gf4X1IShOrrad/Or\ntXtQv0TvZe+jiTynFQ/l+q3im7UCuED8UZqQuUqrGZpNveM3Mkx2htuuVb/B\nQ+mV7gKCuQ2gy2ibdDgkyc+iiplM11xtngB4DllJyN8IXm9qtCTNfPeJPNcf\nL+z+RS89WNggwA99GTM6RDkayUYDR9mMFPRPUhnKE2hnfBOTJsx/sCGNKfN6\nfk5ndT7NC5EN9/YBzlnBmwjL44dFreDQ3SEnFMoLyb4XTfWTITKQOSYgFBj7\nb+V6\r\n=bw4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4yShffiuWspU+qAIj+vt3cT2rrzXnKxIAOBTeCMfJ2AiAdW1bmkR3i4mlpBRnc9ekvmkaChy6B3BJbMWbw1vvgRg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-remove-team-token.20180903220724_1536012682771_0.4306933262860533"},"_hasShrinkwrap":false},"1.0.0-api-pruning.20180904021531":{"name":"@atomist/automation-client","version":"1.0.0-api-pruning.20180904021531","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"638f71ef362df1fac60b0bbbc1e388f2bf3d9a9b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-api-pruning.20180904021531","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MdWAmwZIxZMbXFQw6pacREYqs6+GLaOOqPa8xGxv3aBZ+sGAyc2ztXdijMjO7Zl5voVDQL3kOmzvAl5zyOp2lg==","shasum":"352cd3d5272ef34035a11dfd45f0932c8c73f752","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-api-pruning.20180904021531.tgz","fileCount":776,"unpackedSize":5253216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjetpCRA9TVsSAnZWagAAeXYP/3EHEajSaLhR2zDlwaqD\n04LmDat8xRc2hnKkWu2dFRSq1lNvo+xuy/1KcQJxxu2gS19jqtoP4uPVnYrE\n0bAIP3B2N0F5HAUF3w66zanJk4z4WVAWAz5oNG556B05FjzWmgeJOjsvOj5R\n4DfTG74mDGbGe7win6Xded8dlwWDRGn0ibv0N2IUv+/4ihZ5dPGlQHNzI2iN\nDAPjTlWQ2HLbJlnmEGbtT/Tz2p9Kny6BfFgHFbTUIygoCB9l5G6hbrC321ge\n+FUtUUHTFIdg531lFSlQZM8vVTrAqVzJN8Q7Ifzo5ZDtdKXz8Qvx+7z88qmT\nAwhzuv50AvGiuHB49PTqjCz2Z/OfHyfNVWegSJSYhOgBRJOkl552wE2l/sl9\n917IcdQX0EdZGZ9oZuiJKgOmoBKoUAmIBOFUSDt52WTbSXipinZ4DbQNJpjj\n1Mg8Qh0k87pdiyZYT6j7H7tU5Y53VDOJPflcxclvWkYXudB1bUjO5oHK/yoL\nRlCqjdxq6Ut2Qsp97LF0sH/DGUEqzEmUvlPcufJsOGKVlxPVL1p5aWNKRIZ7\nu5M0GdAH/RwiGop1K6kKQWSYnQSBb7DbYdP99HvcIPMEZVdrrM3/GXTnJKum\nUyuTgEKewmxUxqUcB+yT9Qd6uCrc+3nhmsrb0L8+WxASV0KhkoPi5Bhzgf3P\n6WG5\r\n=G0Zn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfklNIwmvyDeoLQIFVzM7noS5ggj3YHvLGFSaYVCMt1AiBsYBZVedX558Ufm21af64APpthzHxiEjBz7p0E5rO0SQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-api-pruning.20180904021531_1536027497025_0.8677513030480493"},"_hasShrinkwrap":false},"1.0.0-has-file.20180904121933":{"name":"@atomist/automation-client","version":"1.0.0-has-file.20180904121933","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"667ae265963972d71052c7742ece4218f00694ea","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-has-file.20180904121933","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Kw6mpBNw9LgJFUX/dwAC7+/G90Z745HUTrymj/H5BjZLxmo95ClqISc3YFvvx8i4o6aavlFT+cYEilSTwO/IsQ==","shasum":"8e4e675074f54bef2ba79e27900591d635afcce9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-has-file.20180904121933.tgz","fileCount":780,"unpackedSize":5256427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjnk9CRA9TVsSAnZWagAAWT0P/jquM2iHo5mWWXE5ER18\nRfI8lI9xZnMtNtKIiDLdAKf39pGj1RweNMOknnCsQv0J0QU14QMR18MfIwGj\ngbj4XEdNmlvWzxZpE1FxY8UWIys+ZwOGNz5f/cRfR0a6F1+spD42nwZpS7Oz\nxaMqRa85RmKun1z8K8JJy47OdjFdn7MR31YTYNnwRxpcADXuPIuiSo8obftR\nrdjhrvhG5tt5rJ703JIRKXqXhc5pEJKSLymX6U420XNzd1qFRAKRNGg92AoC\nsoOhZ/X5ldU+QN0Bbzy+5EeejXtqKCOiRmdJlseiG6knZ9fvoPyo7//n+6+R\nG/CrYg+rrRaJNn2t3+4xOShaSY10fhdKhAqYSYyx00/c2m/SaJA6ADSsxyuR\nxCJFYSOiMb9vioLnedItcIahzZ8bFA4HRyQ4VkLCpVVwaCJL99NCg/T8LLsL\nzS2v1P/JBUak1EXmgiNsjM5I8nkY28YeR/ASZIik4iWcLokNLBX+SQfXN8eE\ngKYSPw3jtghiVkcyfvgDj+w1jRGU/9KzugJ5405mo8UvHvQR400ba7RPDBsF\nqeUK2a19ABJiOpnrxCXPnLbgYp2F+SEYlxkAumO61d1Z611aA/HInoUAWzRk\nnClBzSTQKamFpS9H34qFG/RzErjbugfG92CYFovmle1PTqp49UyC8/UaC34O\n8sqq\r\n=YBYF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEshXTcrvopY2YPuZy86vT8p7amHf2q1y/VEpJZ3ps6PAiAoV9kfZjPo7ohMCg02OeAEdWtZpX+dKddOVnELK2a3sA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-has-file.20180904121933_1536063804669_0.022804508383942323"},"_hasShrinkwrap":false},"1.0.0-api-pruning.20180904122200":{"name":"@atomist/automation-client","version":"1.0.0-api-pruning.20180904122200","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"a927264148888317a5d4062ded13ef5855a54866","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-api-pruning.20180904122200","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3ZjrKOKboyuKqTgjGdiUEl2qHa7hvvIU2d+AMQ3MFNpO2FYqaH+SNNvioO/0f7yopYWGaUxPCtf2c58JF+qCjg==","shasum":"91370659f7c0c9672d1b8dd6245d01766d661770","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-api-pruning.20180904122200.tgz","fileCount":776,"unpackedSize":5251464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjnq0CRA9TVsSAnZWagAA5ooP/jlXrFYvIy2Q90g/r/yu\ne7VUMjW0p3Qyd8sVN1/VtyrIstiK1rYBP2pxC/c4PkHYvC1zOBqgDcRA0R/p\nrT6qJ0QiPOC6goonL7hjMKg9t2wzNRSZjg3eBPC8q3SApJmkaZ8GIgPK2tzd\nH6YK4xN2xmk14UrlkKps167b3b4ar+ASfJePh2TS5V1Yxs9Y7tVFicJ9HX5t\nNugnr3M+r6k4kNK+yRGAGKK8Mo6IIyFfMzIK+4WBeezqWGQhYdXJIx3mSBgL\nDiXXmDKFqAwQ85h1ZI0JwtW/w3tgAySBr2TV4jwttrsXbVCHnHnWTbY2y2H/\nV96E+GxA8DdPOhuhfhOXQsjxAxbdj4kf7PESTY//6VvozNt46yIYCThHdiiT\n/zrRVzZcz5qUGaa+Y3A4EYA9XSHt9PaGQDoFxWMRTguf6mo06aBBNjZkYO7r\n0d2DQFXLzXloAB1SrLYqCEek/IwdOJDJNbjKkGfFhNG8dnSNE9QehSaohPdc\nsSu4RxAz2Dk46N3HkqE4mlTj/m/XsTMwWqPzKapnCCFcUzJJdY4hnhyY+1lz\nQfKrJNvQj5742EA0X6/IEaHz1hEJ1HBD9PziZsDvUNvBQQ4biP16MWdl034H\n6RWhMg+p5ixwqKLf0Sw8M/I0dtxL9vrZRoYg0tuY/mPR2+lasX9jVqzTGfZH\nB2Rb\r\n=oXmQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCxKPcAzR3zsp9gvE6BlS8KqHvZJnAUN8n/USKtCtl2wIhANuHHZZfYMV97oNZN7IT5/bDwvobybmtJGHfQPD5rwog"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-api-pruning.20180904122200_1536064179552_0.14265986138353037"},"_hasShrinkwrap":false},"1.0.0-master.20180904123624":{"name":"@atomist/automation-client","version":"1.0.0-master.20180904123624","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"64cd4dba8ebf6c4595360814c59a8857b73af76a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180904123624","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KxlU1mNGln2Am9ApMbWq3xLmM4VaVqblyvtAGdCD6thkNtsZXO/HppAYMF/Wdxl2eWq8C2BixmuwOou0vpm+Gw==","shasum":"fe1b9aeab56a8c44d09a9f8faa0edc23efe93e48","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180904123624.tgz","fileCount":780,"unpackedSize":5256425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjn2iCRA9TVsSAnZWagAAm/oQAJFUHry+IpdERQ2AXEb7\nD9lIoKkz+ENP32ctNAlA8o1LK7Hu4PJ6P3g0huPrRhe1h/Dleq0vmBUokNmq\n9Y7EcOKOu7GjKyvIiVmYTxClA/ZD6VISvQ6Z82B1k3G3oCgN07AN/AAANVEb\n0f7tZi2MPWXnJqAVGxAOOzFPJUSJ8YZe17vZe8uuwkWaS3SSmKK/1jBcLFnP\nQB8Q2fH0JHHA7lNLpD7EBTFEJr/ukSO/9ZTApQqehlHfh4k+JTEDLbF39SJR\n2Bp7qFIDcVFBo1U2u8HsoMi+y+lj5Nelp3ovqF6buJMPk4VB4K0KDuHOnMkA\n1hrieHpqt1NVzva16ioDPh9D7O6NzH6BXhj+pFryXJnKt4H2Aljpsmu2xvtO\n2e2QDrlxiEnM6SC+ZWrrEVKJHq6OFMS/+HIdTeAJ+Hdc9FXGsXwKjbbvbaUe\niQoaYfuCqGKWioYAbONnY8Ttb8AbQ0nTkWBnuWmu5iP8eRcvfJvlB9Dit+rc\nq11EyNAPyjajxOQ518/FN5i7RfIEnse6FNgZgqQ2s5Qx2p0zoSbYhuI6HHY4\nVOskfIE/dfd9ANVngH8OxFWkFVewgjOrN9tisbXdpma4GxFz7puHoICYDMzA\n92Ybln80AsivtzX9OjhKLPBZaHoJGQsilBX7RHtkk17gm4DzKYt4kMQbZc78\nv727\r\n=+Mvz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8RjobCr+Fv4ROWqE8YrTVCHYiDQHmBPmexM6PEYJ4iAiEAjH0i/em1WmTYdOgwJJk4EznMyel6+Bdf2QChSEq5/no="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180904123624_1536064930249_0.24166082304881442"},"_hasShrinkwrap":false},"1.0.0-nortissej.error-message.20180904124228":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.error-message.20180904124228","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.0.1","ncp":"^2.0.0","npm-run-all":"^4.1.2","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"npm-run-all compile test test:api lint doc","clean":"npm-run-all clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"npm-run-all clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"npm-run-all compile:ts compile:gql","compile:gql":"npm-run-all gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess --exit \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess --exit \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess --exit \"test/bitbucket-api/**/*.ts\"","test:benchmark":"npm-run-all test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"200187d230194413e28b8494479668fc62f4e8b9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.error-message.20180904124228","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-M8N85v6Cwr+zvM6JYE5OIiQPAU0waBStCB3mpsMuFASkBZagwzxCDG+9I+MWuf7iJoecCllKnUhLty8EMjGxkA==","shasum":"703d4e9339073a56d86e2ebf3979f03039215c04","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.error-message.20180904124228.tgz","fileCount":780,"unpackedSize":5256605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjn7NCRA9TVsSAnZWagAAlVAP/1eo6nAFR0+dZ5tzPHUx\nAm+Zj/CBt0JiPqt4ZCpBAXIucAtPR9FAQKD5kViKm5+VpZPQuRFtFXHEb57W\n2GPGX/ieyFs5L5sFaW2YbXUe1GlYFsLbz7hxkoEv0UllbJ+KWHRMYugbPJ4V\ngzczX+SrEUT6D8XEZd7Jlo/RnqYQlYiX0OfD8MLnPrKzXrbXhKOD7rlQL+bi\nL6sgGSkI1T1GoVxEqOI74U5tkFs8uQcxTiMqKHQQYN6oeMq0V+EHL1MxHDEJ\nn2waaXsGiB17Xj1BcfYSGuXu+Yx0Hr3KcoZlaMHovSVxOs12fbYY33J0cr2N\nFC/KcOwmV0KkTER2v+d7bMpOpkGYLP8kXuagvRsbXuLvotNS4qls1JEMFAoh\nhlmKhRIbpivTzDEIVa8MqvGlWcVB9FVGVVMTBzMrgLt9d1H6lhz2IAxuqhn8\nxFoPd+JUorEsl+hKxuoQ4UPz+Bstm6FufKpdXdcz6NeoioC8wTxvg09eMPq2\nybn28T23zCafBbzGcb/UfYsSB/y4zL0rzEpjwrZ3BGx7ChfwyBQ5bDyE5Uwl\nQ8t08VBv3q+mzvaO/AFPtAEP1bc51jFplQbtjlKie3T4FO0rlFM0i/Ocprc+\n6emGPhmSUucZU+yrTzTLjD4dwmeTU2dDV87cmo2VB0WmIxhlI4hDt3+xpfnE\n35gr\r\n=xAW/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGED7mDU4mSc2D4DzDjw/BQbzEOHXHHTmOaz30o63Qq0AiEA/kQJmzwLAys3NnBpt5QslL1tdKzZnmGx4nybkCVes3s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.error-message.20180904124228_1536065228484_0.9074717558763694"},"_hasShrinkwrap":false},"1.0.0-master.20180904130035":{"name":"@atomist/automation-client","version":"1.0.0-master.20180904130035","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"ec9faf408ee5b7e2b240cfc9fdbf8d3e64a9eb09","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180904130035","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wIm+kOiN7DxxUVtAKbzPv2XIcw1tJvZX/ljdQMpBNVRvSZmc9HDdCKJoIkzQUDWPDqRFB7Z12sREhDWMV5IaNg==","shasum":"8b770bb659b45003ae5a61a34316770f1749bb1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180904130035.tgz","fileCount":780,"unpackedSize":5253364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjoLvCRA9TVsSAnZWagAABMgP/2heGL2v1Bid7qqWl1yy\nG5XqjaIi77I8/HG2AXQ3yaY60Mcl2LEm/+p11NtTgyeFecxEXTq2J8WzWI2v\nXB9yiRtBBBAz1qd82l8P5ILchADyO2bRznpJg5K/EEMdQkFgZxLAcRVnbCGF\nyvhecxK6t/BRq5LQZ5wsXMwwrrCVckvPiFiaVS8M4XV7MGbDWW/JxS4uryfu\npwI6zBG4mMiaezS7irtE8etddvIXaA2Qn/2QnGnxGfZBELVQNBPAc98Nau9M\nzWGNRHqHkPR/OnbCOR+0M+91G3e9TViNkindC9Joyo9VVMnzcKx5WS7eJpX0\niWqRLxCNh/VkJYXrJGBFNW9NU9qlJgQXQdCUSFJ+yzj22OchMVeFzJVZ7YWv\n81jjvHnpr9FqMpquOYYXmuJQXX0KO+3YMlu9dZy/hdm97eCc/RZ4O9AK+c3Q\n7+FV3GA93hS8tIM2dsKKSyapP+89lpuqrvljxvbgc/FGocrQfFK4fGjirYsn\ngqjml99Y9r7PZ9kBpXU+xJ/TW0EJ7vp56x1u2IkyKVpu0P2t0b1msZTuqisb\n0x9mPb68QQBQ3AGbR5lH8dHRXokefi/7Pin2nGuFYOWq+qQIs9Xi98RLVBez\n2VjQd9UMY0yiinbZq3YqcIcVyWuN1I+OfL62pFEanlWY5T58X+E7OkEv7pyM\nZiy6\r\n=NUsI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHYXKkOYjXDOgckmKVOyASawI6WGyfHo9RVZITsMmqcVAiBg4z/DtPyk9gYmngad2Gg9nK09KyGxA8VEudkN+deNvw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180904130035_1536066287111_0.5754767132148557"},"_hasShrinkwrap":false},"1.0.0-master.20180904130139":{"name":"@atomist/automation-client","version":"1.0.0-master.20180904130139","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"81c8f59eca9266d10eed07e4267bc79789d088bb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180904130139","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WhJQvUOdujPhAfbCj7A5AIfbBKgcX4AkHSC2ZVzCIAmQd0t8D7Md0k8Y9bO8jl08ca3ctoMKQjrwZ4eF086V6Q==","shasum":"a39d96116f2e1278e0e014240a2b85c8cc7fc601","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180904130139.tgz","fileCount":776,"unpackedSize":5249746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjoNHCRA9TVsSAnZWagAAEZ0P/AgqReuPaL9JBdjhctln\nSFWDNBaszpcHLTrMyEHqbzLmbiEnDLJUaBd7rBQH4ilhkx2CAJ2W20CFDCQn\nKwEWLIOHBwAqsFo9acLZng++o9Rs7dvZNE5mSzjQiIG6vwEL1J/+zzUQbWzK\nVu6s/49WQe+FOgLiv8AmDjZKFFRTc8A2PpEuBcyOeNJ0EW3ytVLSybRF/0PT\nnNxQPwagqLeL5p/M6bTPq9R1WYkr3hDYzbVVzOoPvKvikoEWy4NRdo1UVac+\n2iK6r+neYljXQ4ao4JhESBQThhqMh4f/OQPGiLF3QiwRXgKijciXbwSc2xrq\nGH5GdsPH84A6Yp0/Xu103XuVBKXLz7nzdOWLe772TT50dq+IbRM7OeY3nuzG\nGYQNJAT8TccQHcRoisgGrUGFe5m+oCGdRM4mUoEVWEPUXsHuHkfIqnNg8hSG\n7vK0nRES8rZwHxL5kjwu33tHWfwkLefeklmtJtMdJtkKYg2mp2NnPJfU+cxF\nWGRhihJJ23VBefc/0D37wJvWunHPlM4SqVsqjoNOCr9e/VWGd7R8Rb3KsN2Q\njUVWh6+daljLjsIkBDkCAIPk603TGWPQzBxBAsVtw1fqxHs1fcR64U7Ceq+Z\nnFVgnAMiCsAfnlTuGPGN4Tv0JhxTIXPosXB9IlmDWNjvCPvyF8Y8A4+JkZyX\n36jH\r\n=Q3A5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkFKb2sOmWYPSv8KY/jCuJuCz5cSSfGFmJXEfYi10bMAIhANlUpJNoMPsRoX30apSVuBvo76gqQqgQGlJ+wy7FhTPZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180904130139_1536066372973_0.8048584293801224"},"_hasShrinkwrap":false},"1.0.0-nortissej.error-message.20180904130812":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.error-message.20180904130812","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c83e28f0c4b5429ec0b5d4d8def790b9c2e02238","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.error-message.20180904130812","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PALSvs1SiMdLEhKyHbnlSI0jmSfNEp9IyQcuojq2oE4uL5Tn7WA0zwbYLl5uds4SOdOfLIUR2rtqO3JPCZ4DzA==","shasum":"6b9a5f26aa34072095e83b60d74b61c096756f1c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.error-message.20180904130812.tgz","fileCount":776,"unpackedSize":5249928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjoRGCRA9TVsSAnZWagAAleYP/0Qr0QHu1I7uQN2I7v+M\nFmCSoLPq2APM7pQqRoG+jqd+0oDhR10ezfH6QRYPaXDeBkOnVnUC5LnX4L/R\n2/jVj9qhm1VS3Z7VclvQ1ca2uZGzJj/jGVafut5TTT0E2JYGooBBxthH/GyM\npL2J03r2p6baCYYhUh/yoZBKDV0nSqCU5eMrsVAY3+/tsOFFgIZmYXHouXRq\nMAt+QsWcsHcK/WawasLWfK/3z6BpsDIb3MD767iIqtSRQMOhUhcVOzjEBJlH\nIafHNcWhJ4QApNgxQF1qF/i5JpXLn3qEi3ox1Z+xrut5rDQQuwr1i5BL5UpS\nN9EokteLSx39eyeJ9vgqX1VdPf9EZCqw4LxZGOmWudLsb5f15+NE8e2RLDwJ\nWPzgDq03VhnLz+xxzjPaMgstfRmd35lAhyJGKi0YrCnB2HwQ+j/5UDQdE6u5\n58DTxEbPET6I4NM8ALXA0wExHAGBj0yzwoFuRK4BkV0KWL4EUszTL14WUAPg\nzhXgmSme22MyZ08C67+7UJLL6eOSNjGSvz3rwkQ1w9fiUDvgqDQhOfaR9kcY\nMWHRUei3fNyJ+ZxLvZ5HSjktoqbRG3eSsIBm3rbuEjqMhj7OjuUu6xNy2wAL\n4FqJX/PPQxsnvFePgRnUHhGn+I0Ep4dTMo42cmu54Ga6y1flta9uAwozwZLx\nEfoZ\r\n=1MhK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIBUxdUV8ml9cPom0ZGc8uwvPY0aheuPBP2i3WXg/WO69Ah9BNyQotoBYhudjJBANjsveTa8Gm3iMvOdyfSDTIhnr"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.error-message.20180904130812_1536066629453_0.9350590023469725"},"_hasShrinkwrap":false},"1.0.0-master.20180904134011":{"name":"@atomist/automation-client","version":"1.0.0-master.20180904134011","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"81c8f59eca9266d10eed07e4267bc79789d088bb","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) [![npm version](https://badge.fury.io/js/%40atomist%2Fautomation-client.svg)](https://badge.fury.io/js/%40atomist%2Fautomation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180904134011","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sNcB0qTDMWRVQfbGq2sRU+yQJ39Qemmsr3Q3vYUE2SDzArf53FS58Izf9Eu1D1WDh9/EUxLtsSkosu8+1gCb0A==","shasum":"a58324d193a439863a84fc53f0d623e84c7a6e44","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180904134011.tgz","fileCount":776,"unpackedSize":5249746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjoy8CRA9TVsSAnZWagAAqWoP/1uumxc2tdO4+BxDQj1x\nmec67QLZlbgNGjedcuB2FAB4kkNMWGCuyFEjWHhWqIk9UaENSqpmZN7Elvq9\n7ktWyOKi4bQmZS6zwCHBjhC9hbmLqjgTwgtc3T0E2KLlH0J3lJn7kKSBbbp+\neWqUffPxlFODgh9tM2ecjTdx82MpQe6nQW3QJJkOTpN1ow5nBpe4+K1YUDz/\nsAApxQtdmuLd1eWK6KZbjDrjZ2lmJVgJ0ILz9zwx85+RvB3VsH16K/DCOOM5\nuWWa/EMKauHMjD5R0EmUjLTRYk7HZn7PEUv42bMYGg8ki5MZa63a4WoK0vhE\n6zmO0qn0QM70sCNkzcFeXWrP877azaodBRb4CTLc2V2hsjzR+HHGyC242kjI\n2OxHnTBEwdbqmNqYtHxyIjVb7uwXfQvI5B4ANmlpH/s2aqjv5Ap8oB9Xjb33\nkrKmJHtHBbNQuXk6KL/pCT0nQCaXjBcy8y1W9w1d3VhiMQeaIS77YgGRy5/H\nUfy6GIdVhjUDNPI+BS97Rfl4yr0yD5s8oYKFXg6Jb3bVcRr3IFy17A3X5hNX\nRUa9pygFTzzzPFBNJ4386QAfWhYhok6CV6OMXKRmFu8VAfBpmfNWNt0UlfSQ\nHFVZI1E/k6zL1F8hBa24x0dpn+Ah/IQHuo3PLR/LgOpAficnN3q6iDndyjDM\nqB0p\r\n=6gqa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELvala/0kqkKMaiS6Xjp8rMU7wRWW0ZUjMlwjaKTcgzAiA5ByoG3iitLqiW6I/b+8f6iD8ZjOUj1dBXU0sZhTi3/g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180904134011_1536068795041_0.8560687770368329"},"_hasShrinkwrap":false},"1.0.0-M.3":{"name":"@atomist/automation-client","version":"1.0.0-M.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"81c8f59eca9266d10eed07e4267bc79789d088bb","_id":"@atomist/automation-client@1.0.0-M.3","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yZGQVbBRp0OCMm2FTBr2pHWusLPjEmd31i3g0uONwWA6RMcBCl5iEzHDlgLy8QNa3Fj/kXRRcSalySIpgVbvrQ==","shasum":"78ca3e0793adc07474f150602d24ff852822ec1b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.3.tgz","fileCount":776,"unpackedSize":5249728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjpVQCRA9TVsSAnZWagAAeb0P/it8e9NBu7Tsb7nJRwEx\nfLsk56TpgzKySIFBgl98bFRWYQU6u8cj1I630+JRzMPcVi2HLWfQJteHruXR\nQncCNhCK1Oo17Muu5mMYtIdoRJa46H7/1RdXrzeNytFQXI3bxtB9ZIVDRTXb\nbYd2DjHEJ90F/SIh9U4hPTWyql7O/9BWpagF0onSxFVkSQLzAjbmdpRTxpps\nsaLZNfL9WlVekSfjHjG5pIz9HYAKFNYFMcOoK4uP8d6e/y27I08j2YacGGa5\nqMfYbuuGBbNdscQM+5wIXprtnSZlEVmrJQiO2i6n54xC/ufL2s4fi+Q5YeJc\n5FDFFwrenKO61hTq3xHrJlUq0WHyZxOwoGbp1rAgFnIT+Jr++tT+I9Pa7nyB\nYIIQZCwNWo8z1dsUN4cxUOzZPle6drXySIRIucbwbKoFMFNrf5JC9Hka0NY5\nY0bXdTVhMGej6loast/+/Pr/MlwfIzUj/496yLyUm34vZzpuv6m/eYDizzuu\nsAw6s3htkBajipaI9OJWgzxJMLBQiMRNetrhv+N73C6LHN+k0ip1OZ6UL1Rs\nk7rqUiIVM8f15e4oMHk6Nz6XmQZaTRtnPcT6fkhQi2XaZwRWGEnWwCEnRttG\nS1ErsRgpl2Ng3IBYmJtDtmpvdvIfFdL//kxV28dIX8unkqJjh4BLjkMlWxnl\nXMaQ\r\n=Ec8L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEp7CTGrwgtQA40vTmBL+jKD1cJHgAMC2ahTU/AsYpIoAiBanUBsVpW2eM20QU+mw+29z9eBul6E35YGbe11t66jBA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.3_1536070991742_0.7963617219682511"},"_hasShrinkwrap":false},"1.0.0-nortissej.make-reset-goals-optional.20180904161017":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.make-reset-goals-optional.20180904161017","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"a5513c2c22d0f202b156eea8b5a7ca8a6d26e974","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.make-reset-goals-optional.20180904161017","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Ui/BZ3FKkJlWj0Jzu6JCY1fY48tJfCEkMGBOisCFQECZUvcbYwuhdOMH5NF/6MUgJz4GnsMk5U/1r57F/921pQ==","shasum":"be9eb79a71e0771efe6a52934be4b2267bb1fc64","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.make-reset-goals-optional.20180904161017.tgz","fileCount":776,"unpackedSize":5250520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjrmbCRA9TVsSAnZWagAA1iYP/RzMutILOXmyoF/VycdO\n/SAHSCXuGc1SrJGGk9TiuZQI6F50DrW5pO3fZ6UwOJlhkZ/Jm0G0SkR+pnuD\nvOsa9tf9zPDEdM5aFDfioq6yDRwPYKydsb3+BjFU8DO2NqEVYIfpxmetgnF7\nX5wlWa5xMC2aC/hyRE2CHsKD0iRhWwwxyBDD2UdHbwIiNZkVl98oTG7DuuOz\n+SIV8LeyNaTnCdHccDDmj5/XK7PS9j7o6SsNBR6LuC6p8L225YKDHlFAL3zQ\n7H4PIra0OVt+aYgOgBICLpxjBxFhwHJhU5wQehfEF8Fe6IJkn+vafz9qnQ0m\nn4ORbVBSctfCIeVbokWCzMsjOYQfvpuqe8Qq7LAUzr7suw3Fe1QEf+mmBgPH\nUSQDY6RlU1E52yYF3ApF0er6W7JoUFqMkmvUYCQirUE5GiGD9FY1xlgYXWSb\nNfiUoavt9/SHyuZQZfiPFSnas3rZaFKyDtFiC58GoyaJulHGu4pxWLPUGe0e\nDgW15ftNo3WO7GXvVVjU27ia8369LMCrO3gFUQ/tFRPBYYgN+0oFdcS7MUlB\nQKgwjteCMDuws7fTb64YgDXzaRHQGqhFwS4xUZ4sLsXx6fakPaj5A/ycGH0K\n91vi0a/UdauIY+sDuAbe+z+6dJQ7Anhmzx7oTJZmN71YhOeLvgUNH+kox75b\nGSyI\r\n=DSRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2Ur94AjNxRhHkyuvXfpU06FbBc2W58yuGFf4BBus2vgIgAxShgEShKBGnylH91LGmvlI2UlMBFH6rO/0ZrfAByWo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.make-reset-goals-optional.20180904161017_1536080282954_0.07158022431965816"},"_hasShrinkwrap":false},"1.0.0-master.20180904201520":{"name":"@atomist/automation-client","version":"1.0.0-master.20180904201520","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.0","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.7.1","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"448f89aa8bf9c8bcf226f29882dad26267fe665e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180904201520","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TVklUH/fyjhDQRWsB6KZhFz++bIS+Jwbokx9qN+kOpSajxvIrHPV3KyMcV0neXFgH55mck47LMTaIR9jrY+D+g==","shasum":"84717cb4c4e202b3b12317963c9ee98f9057afc8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180904201520.tgz","fileCount":776,"unpackedSize":5249936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjuq3CRA9TVsSAnZWagAAAe0P/3UvEbKYOS+jjd6elGr2\nYxje5gqxPsM36PhIuei62fGk5PwIVpshoMFVci37RBo2suyFRDdpWB2mBdTM\nMPdGNRhhCpmeSN4oNzCVeqkb3MkbF65hRxtsu5KcLkt82ibCD5T+HvC80PUg\nSHuaIIoKv51zTo0226rwbG2QAmzk4BOeb4H+etLf1Sq8bItrltG3DKg3NI1I\nvbho5Cu/eoiRcWUDYBaB4gghUH26K/viIfLtrzIrMqUwQUVDMSjWBzcG1DpF\nt1jMoYOD1Pb09+vyLNieqSpcvIbDuSwEqicSpsrrZD9f++UxqRWmNnlyv/W1\nhGyuCnjJdwVb17Q8bFqPvTRZubOBWNv2+lv4VNg982s+eESYxNPi/8/Szinq\n3y5f7YGqsIojoUvMXcrPtZX9ckCf8DAqoeB82L+IV13Okd5CGCbcq1Y5WY86\nZqavVfXVU5HkDiGn5l0RP4IAc7rdoSzklLwE36xegGGsuLPdhzxWJNmXgZHV\neO81r7QYu/sERdps3SokDNm3XiDaL3Jnc7a4qGXsAvQGrZF8eFwH5aelE9tB\n+qLhHtw21g7HRzijuO2qtx/UvYIPTitXK35dgD852yDdh6WfZuexUYYswxeN\nOE2F/5ElfnvyxfCjZIdeA+37jWGPdHQCu3N279kpUhXZ8/HL8EP0q24jF29C\nBALR\r\n=G0QA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2ttGL0bq9UxwABinFjTkCRTtQC6o8rPOv/u8Nwz7iggIgTUgcC7NtDgHLJBRuXSl+4nDv+wAFx8xTpC77gO3NHYc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180904201520_1536092854344_0.17099073045547852"},"_hasShrinkwrap":false},"1.0.0-execute-bits-345.20180904225753":{"name":"@atomist/automation-client","version":"1.0.0-execute-bits-345.20180904225753","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"ffeca895c43735bccccc7f40640de38271dd3fc6","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-execute-bits-345.20180904225753","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ChrcV1eGYmF3TD5vK7uOGXJ0Kqgr25sgpaf16ydsnpDxTnV9oPLuBtIXXWj6QmV9S9bCZTn/chYPrxJJhS0Gxg==","shasum":"74d7db86c4cc218d67361e3078470ddde5520a20","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-execute-bits-345.20180904225753.tgz","fileCount":776,"unpackedSize":5250680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjw7XCRA9TVsSAnZWagAA6HAQAJ7QlkJW6kb0ZsuVlenN\nhgOGyOW0l5zXEaSY7K/9mPicovqDuscVuWTv+p03/5RoVLmjEAggc2i1fhIL\nnjX6Dbb0zA1/HMosNoGYCnmKng75j51jfuZD5g3y2K28xGbF7JkpZ9mgJ93G\nCz9Bo1PdmAF9NB2ivPYfxSqpMKCOyavBeKTl1PBxDAFzWF7ZeoBL9c/3sUK4\nTVaEzuPBrLVPDJoyra+1cX00fCf1FSphJHlo+UrGv2doh1b4JP0qh4Kw7zfD\n/+M6fDXnO9NNrX4+Z5pYOJC4T6j+S14WAsQcsxPeaDVG5Y0zcpld64PxoCh3\nHHR87bXLvyaImSoiqxOqs7Wn9zxdmhg95GqF/geZyKgD2eta/aMiYG9+Wv55\nbGtW2alpg9WVWUlNv+MgKueMZomty6k3oD8oGUcdanLit+jzGuIUdJFMsTkJ\n0oraMWDI77oCoVlrpcuvhsl99CTLj/H/O0vXZfaQRaLxHkiKBGVltvOFD2wq\nwtq95H7LklluTus6T0a0QgfdUXuzhTQlEfZq6DTVkww/5D5myslv+WLWU/7U\naFXnBGyvFZHHvqbhn+qxrdICzLFwL85awyqur6/ziUUO3WHnTeKSR4XiazVG\nQg/RlqLTXu2+dpbm1j82IRc4LMNDpxvigIKnCTaXbk/4/Ugfg1dQAOJfkSna\neIh8\r\n=2AZi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6zwnTHo9YnNA/UZn4zmrTwVa36JRlpWn26PLVQKccPQIhANIVJjGJWDJn9eHI76N474PohyLrzPIEba72skDoqg+Z"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-execute-bits-345.20180904225753_1536102102372_0.37637349925184016"},"_hasShrinkwrap":false},"1.0.0-master.20180905012114":{"name":"@atomist/automation-client","version":"1.0.0-master.20180905012114","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"dcf4d1ce27782732d73150090029db8069fe821b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180905012114","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ex/eGufgNe0sv5qc0pesqIDjSaLMKcaucoKIV7msS1VTI1bcG9I6/8/lS8rGCID4aev1GAABCB9YHKcZbRAwYg==","shasum":"aa4fd38b4563836065ddc7b61aa5c4fee03924e0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180905012114.tgz","fileCount":776,"unpackedSize":5250795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjzB0CRA9TVsSAnZWagAASdQP/0ufkNyJbvfWWlbyxakM\nY0xrRYhuuZZwBJ7PMrLgse2TMRW5+70sipNj9bxuvMhlX6+Elv1AZPrgXwdK\neY+o14PwYUzbl5WUaVumdPlYDJTQ5fhYhR2II9ZGLYIKsYtT1i+I6EgYML1g\nHjgcR30YGNdpuso0T5YOalpbjYeARYs7B5jZAu59ecJl5E0e1P09oN9rP1uL\nryKWjT9oFY/MjU9nPvwkZW0l3W/0RRtwx/DdMRgRJUHKPpfJdvCUcncXlbie\nqxl+AXKxdIUtMUgu7Aw1psADXeZ/6HpBzo33WBYNdITZU65oUdg8nm8r83hS\nCuf2o5m9J9MuyeW+FVnjQoBvD4Sy+NTYKc8sRERYPRuo90fp3WN2mLZbvMfN\ndUHjxM/B7xEEKHJH4DmCzraGoRfiLFBpnLRN/vjPlbxF/v8ViO7xUmKCHJ0T\nDE7dQkZ2n30QyOONSP+Fw4HUNxYxWZeENW2F+PS/uk2cKikn1cBROQJWolIs\n2ZU0Pdp/re1A+Nk/bXQAzjFyipHNcH8ccIysXNXUOR32TzLHLHw3Gcz6jOcc\n5d1xDyJCd4Fz9B9BgSAHVu5RuI+sk02ShnHdcHczIVPtBIY1+cVUnjYKKzFV\nT6B8Zm2PqYPI7BnV5Z02VL1ZjImWrnpp1nUP8GJUfp+uvhv7dJ/JJbiiqiR5\nwNSo\r\n=IEri\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCmojaPXrqg0v+zClrk+JYZBznRwrNubcPjsZJbbkNSQIhAMSMqHBMZQTYTl/U+J0DUvYx0Eh9N2vhE7ahfQABEAn+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180905012114_1536110707816_0.7329497570633998"},"_hasShrinkwrap":false},"1.0.0-nortissej.error-message.20180905012528":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.error-message.20180905012528","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"03f3ec8a0ba92bcdfb302e570cf6cd44e0f801e8","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.error-message.20180905012528","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1CON+IXjBUv0GydkASxbdnoFnF4iSyeED7ukzlTTE10idJ5+K7Xgg6aA/Rd28rjFoBGOwHqkvdNznlWxDOfF5Q==","shasum":"4911b3ba3c830f2444998d84e166c59566a85d3d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.error-message.20180905012528.tgz","fileCount":776,"unpackedSize":5250975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjzFuCRA9TVsSAnZWagAApi4P/i0rhRJAdDcmin8GY2RU\nNfj1LIR0EIyn7LMPsx65Rdi4XKazcxkEdlKbO9ahE2io8OvaMOkZvCGQFjKV\n8Z6G/RoIZEX0hjrjhMGiFzUj2TiWr5Bz3nZGTqvzsola5stHlW6NtVT7b7YR\nBfxarN3uxA84WUKOGaD0/G4q9bUhcMnvUrA4t2UDFLpKSmnEgN+Ffp/MpvFX\nHMYGiiS1BiBS/ldbkF8kDi3M4PPS53NtH/GUKShLgEs0TC+f462RFFFEovS/\n+/OA2RBaCICfLigEWRsY47x4bHMPnQ8QVzofdH4tUlo3N90CN4bROofD84G8\n4kOlGdZY5e2bx6wLtCaxgJ4hjICLiv/AqDzgfuV5zU27oOfEkdbQUwAuGOZg\nZRD/pArX2nswYpFku316oiODeJx2vI2UoMNd/7+MZP4sCDJHdyXZgtfC5r/a\nPI4Z0gWBFYeD0rRO5D/MzAguOociG7ZRdJJc8mSC2DwoWmqbbgRwbKc4Scc7\nR5W0uQKNV8fzs1Z6kSv/cMUspvpwv6EZi5cl4Uty5FbXQIX/E5MOziy1cbsh\n11KhQwdoAGoDeU7bHI8JNMXAk/iaGIFQIJs+H7aF8VyrlvfA4KwU/wf5cvak\nEkE/EissAIt8UO4uZgFC986KNF27PLOn5/ivfN5mDKZIeNmyPTkLyzQ/R8ZP\nLHcL\r\n=Opd0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWK90oGq0tBzN5AFzjkdi44izgS/sGhK5woib04s6N4gIgQYRMMhe2Nc1SIfm1mTY1RhXHXkAmDlX+rw/FCgzsWzg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.error-message.20180905012528_1536110957942_0.692183421668783"},"_hasShrinkwrap":false},"1.0.0-master.20180905082419":{"name":"@atomist/automation-client","version":"1.0.0-master.20180905082419","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9ed45d8baa91572eec2424987f22368a6101f69b","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180905082419","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NpEweK3zFWQ6yYlDw7U3SbZYmbiqWWEr1bb6HIJWQidf5NsIE4ZJKLHasZhNL0JY001YQWcE5mF5QoaTRZ/Tmw==","shasum":"773c633e9ff6c7b5ffd612e6c9c95a509f60120a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180905082419.tgz","fileCount":776,"unpackedSize":5251136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbj5OICRA9TVsSAnZWagAA8f4P/RhAQUEH5IECkV/haT9T\nR4dkypmETuaC0eFcY9rTXraJWN18K4Y8VQHVKRSd4biZfeJkzpTSaWWKvlcU\no8EpKx3hj8cy/MVsgYhpt3/HQ80898HjWWrzYy8rrydsKRcpJ063J9J0nFLx\nZ5zwrW5kYQfLyrPoG850j5oo6rGuRgxYS197E/3Ek+Baj0qdl4Wg9L2KwbQX\nFYcQDqb2gdGiLkIRzdS0/tSPfrCUVrFfYBwYGj5IYzeFyItBXCrwxkBXt6zJ\n+ImvlSTUkmwO5nbknQaGoWBjFsDlwurEjJHNOk7iYMH0vUHbdToxaZQI1KWN\nqnxCve3D2d+ZaX/ipeKC4PJklCeqWTDJX65eLuAUqNtdF925NWUpw1mR3l6o\n89PoTAg+1XZrEBtOgAykEW165JfgSmQf+egtg9uZy3OEaR9Gh/bTQjgmZCVi\nvAQj+HdpLt61XenOBpKGe3g7cbSJ0vYaV1yGo0loCILqyZ5Tvalb9iP/uDjn\nns1bYUmFzTMlUYS4X7tyvWFhgMVWgGPchSWUI/AJaEfEHTwfDYRhX5h+rJwR\nea9GWsyh38kK5NdEuL+weTL7TmlYSfRHIMFsFb9KT92AYaZ8Vv/FUTvHVfzu\nQexZ8qLJF5camFS1EEvtbGjcYYD2frJfVcHHYzkLcadwzIzxdbQgy6/s5N13\nG0su\r\n=LCcW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn06q3mfxfp1hoAN5mzDdPOBflMZf+yJ9Bo/zdHXGygQIhAPCDxiO0XLfZwIyc+FY/yoAK7LjK9nN1D734wSG3rsn7"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180905082419_1536136071559_0.06577520941736292"},"_hasShrinkwrap":false},"1.0.0-master.20180905201706":{"name":"@atomist/automation-client","version":"1.0.0-master.20180905201706","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"4410c0b45544536766d061ded92bc2e530caa677","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180905201706","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8RAuMSFljTjaDWsgWsudkCF0YAe/JjUgIFYPRTt3nTi7fyshwSt3X74kebARGlV4vlrC28SXBlq0iB+NdYTJtw==","shasum":"637cd0ed1383aa596dcfab986a4e3f3736052ccb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180905201706.tgz","fileCount":776,"unpackedSize":5251526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkDqtCRA9TVsSAnZWagAASJ0QAIfKBmzW5FiRvKogCY0U\nrhTz0uUCeTduiOe03B/N2lPLXyu1hJVU+YCsllRiqgxDtG18d3PUCAeTNgpG\npr1YRFahjZHbdkC6pFlF1kXOPqt3mqo1nFRc297/ZgkB3dkjFE1cIDBXKxvt\notFrVewznISbIW0kGjDXiWgOuVnIr+y8VHgO4PDcTOsBrI+CZNOPqASAUlfu\nhzIZ9RYtlz8SiHITFQgcV4vQ2z//hOQWn1uAwxOxdA1EktnjFqCds0RswVVM\nOVPRPXVSjFhb5KTsWWaqSsANrN8Tt9qzjt9BQGNHKVS53ModVDcbPd59Aeof\nf1jgL+tkhSYNIBsFa+MK9lL/2qp3iqasy4RNkel4Yml1DENKvPsHPSVuxoys\n6De4dRaRfBhq5T7M1JC6E0zqpEBBut+JZJMOZ9ANJKt6vlaeNYEgoDo0sYke\nPrw/u7GeCB3kI4mtVjV18R8PYaSDR4+J2ndZHqxZJ1XuLot8e4d6szgIVQFV\nTL2p1YmjLkYGtnMDLBuzp9NkmFvkKev/L9RlddKKHaIy44123oUQ3s/Y3Sbj\n2Q5JuVdkYvHgTPt1ltVLHJXx9jp4X86KSqBE1GIv9iamOJJhsoBcXFwUdG52\neeVA8tYZIns9TmWnMldDtzno+xYwdXCbFQfJaSaj77d5BCQS6KvDFzv8KYQw\nk6BJ\r\n=VNv3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDheCpxDIf5n2HMPD9p0lFjSMxqDpHmq4yHETRvKXULswIgN/5gayePzFPBtwCRaKt+Rjrg8edlO2/bGK9N7PPhS1g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180905201706_1536178860447_0.5293214313257915"},"_hasShrinkwrap":false},"1.0.0-file-directory.20180906032509":{"name":"@atomist/automation-client","version":"1.0.0-file-directory.20180906032509","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"71a53754da9cb03fbcf7552c7b3c767ef1aec3b0","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-file-directory.20180906032509","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QOKCBhd/19wXIp6JwOYuNTefCQqu/r2sgiMFqQhA/8vDtm4Og1Lni5/l5eHy0nkjFhvbX0nrC231ag5EVVrmIA==","shasum":"abc548011d77760e31ac7b9b30c8a7009bb724fb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-file-directory.20180906032509.tgz","fileCount":772,"unpackedSize":5255085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkMYcCRA9TVsSAnZWagAAJkgP/iFrFrMGzDya/hJCuj54\njE85DEqFyhf1Kc+RP2TBISmq+3AG2ZcP7dnW6AEfMvZ5JCPfwg0qM+4OZ+Xx\nowhS33sw2oHb3TmasLrioY/D5DZ9VCeqr9XfN55cBp8u9SBg+rB19KYnRDcU\nfPoQeC5W8mee/Py0uiibenrsz86FQmC/PBCKzrUc1w2nKYaosskdyjtn7r6G\nGSke74AbnXh1UqvLd203HZg6ybFO/ZXgPMy4nCEdceWg+YiIHfc5zUe5BRMN\ntSshjFy0a4V2KnjkskQOpBJHFtQeoEyJ21ByO7jNKqp+6eYnMqtgyYPRxrOJ\nrmjr+3VhJFn0qGLRiJVCTD9G+El6qAo82eOqIgnMjFSTmrCeXaMPAUbrT4p6\nJA1H2sTKMB7iesMdY1PqwV7CLZHK/sJhbd6y43oagnyRhTMKfZbIno+PiXYT\nkPM/XlafK90qpE3CVu2bxv2YahaoH77cC5ZzLLd3MRhfPgtyoYtba36dAmEI\nGwSlTBym0NGVLThtav67Qr/SIwH3quxu7U8LBelkuvdD1Xrq2hjLTbr8z/5x\nvSJE8tu7LXJZec68ZyGZONsw3LX3y8A12JdpcTbT4aDUAWaP9aRm5CZO8zAz\nzenGIaPgxxSUCRfl0ivcz+a0H5QXd/EALMHeHhZocxA3iHgWpz+LZRA1oc5q\nN4JG\r\n=DWr9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0Xt8YBFolV5zCf55/lujdAKNkx/YeTEWde54rUtxZFwIhANXI/fktZQjdiM267jnn91n76cNH12RovQuTEWn/JPkW"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-file-directory.20180906032509_1536214555219_0.7820690638992163"},"_hasShrinkwrap":false},"1.0.0-master.20180906143609":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906143609","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"866a37707574b21505285837241b3704d93189bf","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906143609","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Q25h4+c0S1Xm+6/7M1gPQjR3ytYULlGZLqTsOM1Cd+G92ZwvzvyPFq4f7/9gbgszctdUlfYWrzdXfPK6BQXCDQ==","shasum":"dba38dcb751882c07d94ceb44594f09adc424e8f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906143609.tgz","fileCount":776,"unpackedSize":5252429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkTxoCRA9TVsSAnZWagAAgpEP/jK8yZSs+29X46pJG+gM\nCB91AwpMgzAQIQCt2If3fPBq6mRQ/VPrKozqJk8nz9Tas1cwRb6Vhn0GIVuo\nTKjjK+C8WLaf11s5NGQW5IdpaDFIn8wwFVM5haLGzeRZvGnN8C7yePdZgQFO\nf/62UtsqlBkFkkWzlDmLkfApiH+9aLQ53VDmvCh6FqVX8eZMQaX9oREuquUa\nej+rYVQ4gAKayiAGMi+LLcDDECQC3A+jq6UkHet1bjX0WCJiSfBa+Rh+VP03\n1ShPTvJO/W087V7g0jgtSXVGBg3ocdGpuQwt2CkffOQs0efOUFPhfudRmpMG\n85eLNZX7BXwRQ7J7m7nVyjWfBMN4k3LL/9I3aWtvY7tW7Zi1Wa53CcBIefZm\njYpMPE1FMjBANll/8ngc84CFr8X5HVEuBilavdtbIdWfpGr+IEdSHr12H3wu\nyOCFWDlMdzjjZlubIx9RowKp8SahjQoA+5Y72FCmZot20HzBl2OQ4iOwau8q\nWPDLXesYFKD5H9/lCphALDJBg4WM+2HiTvcldXvdPWYcY+jHihfVJH+44cSx\nMHdmiTdkcaHBTZAx7biQzk4OH7vqO8//U34TRV2zQrqQncSV4guwOZfvZNP+\nApFwfCEIsUVshu1SEA7yYo3z0AsbXgnlsyMH/2Qtn2Iqyj/ucmwK7VsLGh1i\nwmwv\r\n=As5n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgCwCmRBxEJp/vrXvVchczdWuWHWEnXWAFkYnq+ol77wIgDNxQm3i/QOXsDaOay9JPYVvTv5mQf2NYtJT0dWcA37s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906143609_1536244839240_0.7037620697707119"},"_hasShrinkwrap":false},"1.0.0-master.20180906171251":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906171251","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"c9ee61faea9b3bfd25c65efc5249605abe3611c9","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906171251","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Wxpj/92hmihCUfRsoUhQhWnDeJwIsr9y2OtumafKH/E+gK1Fcw8ujfnh6BPchdd9zzdD0gAjPhJqTQhIG+FvMg==","shasum":"b77f4106d8dec410ca1e18cba2da35ed2040ec95","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906171251.tgz","fileCount":776,"unpackedSize":5252551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkWEmCRA9TVsSAnZWagAAzf0P/jlqDx9C35qfs95300eQ\njfxnrRc37rQ4BR1sn8JhFGy7ZGwRLBkZHWo/+rLR1rbZ47MP7nn7KuIA83oG\nHtSFWqOKfwVXpP9Wnm55psQqUtXLgwjUKDBew0X5JHIz2i346K00HO63WIEN\nXKHBP3lmGa7hHJoLhRQOAcCQ/KrCjGcpyB0Siw9x24SFiQV4wmz60mmUYdW1\nBDGZtjRMxgTiKsFuIbdkBbc4Pn9YluW4z3RD/kA3T4e5kmB+mACcC5zUnq3C\nmsPcqU3DMAheXTNoPrsgvYp4uCcXulf2LQIUM6SAVvHfdalW6fLZ3S/HktfT\nyfxLkzQfLe3nNlYjP3OCZKxU8UrJ9ClqH+bf2Bh/VGjhn+fSHu5byKVre8IU\n2WdLOY9mxZQ11g2fVW8fmGuRNRsoYB1/KzW86xcI+1oshy1wZe886wgxdz6O\nKworrRmKEjE0FFbPAZgKLJiQvtF4qIhulUIKZ615SaKzOlNBNF1qXGt/JGzI\nWJjR6XEO/wM69bt7ebda0ntEq6/vribJbHnad7WsfOdlQCvxO236fFZ11pTp\nD0RWgnKsJwENXk83I88hMfNpvidSQrBlNTnfpjRcPVk7Jpy7KlrxDT+PXjhM\nH0bg3EhBLvdJgmF5P3iJQDFpd6ZQ5rDmWZvI9/9souC3hD15E1+Le1RdJaKK\nSVn8\r\n=d5jL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFu62ddw7gmxTjZtFWnMAnawdr9gqW5vZrwaw3DYClJgIhALdtHs55qUcNzCoJPDRbsIdC4azCSdXyhlk9vA7MYuhs"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906171251_1536254246335_0.3506862148454808"},"_hasShrinkwrap":false},"1.0.0-nortissej.doc.20180906174130":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.doc.20180906174130","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"ad04dd7a3c25934966c10f4b5c73405663f7e752","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.doc.20180906174130","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VK1fZi2B2q1GPMnNItE9hwqmiV5Cdm+CJSNMXzT74q5ubuZy/ZT9X8ZLs44MV1pq/sg/xrZ66shAZCyhVZlkbA==","shasum":"6cac8f106c285a90209407af7f97016a458f8d15","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.doc.20180906174130.tgz","fileCount":776,"unpackedSize":5252542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkWfACRA9TVsSAnZWagAAEf0P/3p/kkso3Cs7mKpYE9nJ\nmxfBDL7DGwdn6X3A2qpqNVbfv6zdHbHRFyNbTX9K2wv6fUsYCQAaZSrnbWUP\nnEyfbXZ4mOvXtwbYoC03672SK8tlA6qXHJKC5Ox2o4PbzvI0QplsFP8XGMJE\nu9DaRT+r+O/p4leX2UlQlxvgFao178ivhlu2muoGon263XUTTSPX4JCC3jW+\nB0wkQ4Qw7hJ9LnhgkL+CjdMq7hkmMRF2Gn8FkcIg0WFhs1slo6PFb6eAkMQ3\n8Vzej6mHW9J2HY4rKSoAtBe0PbvdAKPx9Ba5SGpKIRcmzPuHtluLBp2QRAcE\n50m26Nh7/TIfyqXhY8ya0qoZ1nhtX05WTkeeU+lTcO/3mCNVvpWtsa1SjXah\ntQn0Zbbk99aQRMNCxWFZRuLH1ib30Kc7CeE4iG7o/RQjl/AJmOgmYlLXFpER\nRnopTq8rRxtNai7XHYdiuQDLhkeQ5iaCjkLFtqHg0EP1oiOsalt0DU65R2lP\nBRuFdgNcHKMBT+UKglcPSMuTVGYJb/HctjyicUzn1vE2ClfonxGOfxTBQYxg\nqM2NDk6hUMFmFZp9vRcnAiY/PJz31E2l6J8vM3Ouakqg0MIL+8zpza3Kigq8\nxYAo7M+481jH9Yy/aRDkjU+4xEOAQEu2VZQeVQqUm1NTgSGFVkhpKhHuJK5W\nB+Oz\r\n=9jsP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUu6JY1I3WaheRUfWauaRzymvYLIbHPbGtIqOpFf64NAiBxxUHNzL0N8pgbSwFNIGb3HSxwFXNGk3pWfehHNsQPLQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.doc.20180906174130_1536255935081_0.2636466783597853"},"_hasShrinkwrap":false},"1.0.0-master.20180906174556":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906174556","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"7a012ee6819b7c04385bd3c6ee854c4f6323606a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906174556","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6XSRx4D4UhvVHn5hQFlmZNQ1SDNaO9xOnMsffBXGbethhyWAMX9F/tVgUICaDMfy6DPLaqvTxvqwgvMfF8oYgg==","shasum":"8820b9d30f1fdcc470cab7eb44d219ec34bfee2d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906174556.tgz","fileCount":776,"unpackedSize":5252535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkWjiCRA9TVsSAnZWagAAahgP/1R9l/7OeKYJHuqN3ZgZ\nrkOULIudAUqY7s1ByPDNlcCQFNT33/rqOYj+FIx1kO9CPuy88WF2tZfw4Awt\nNxGZ+YT8CKuodpAsQ2OU8UAmCYnHJRRKnJM7S9VHs9Gcnu2heQU6zF/kR1Z4\nP0m+BwlFHBkQzYI4XFIk+wBEuZfjpH346ItRcgqvIwFGTzMAjY8BsjzVnqtL\njIgvU7+oswXT4dMEONjf7pXAvKoH6IKMNcIMadRQBtWjNXjzH/+hh+4JlQf4\n7g8g/v6Y0edx8MGzjYVmEIQK1Y0oY4UbNETjUWAIjYXo+SG4ieveiUfst3T6\n9tCyW29KE+kMTlNtQMAwG7OAOIZ1EJxjyVsyMWxNXss7meunEeNCMa/kmeJm\nTT65cJa6v2ukHIz8Rw/fsUafkmAkBX+X2d/dB7bX2UxCW1kCXYVGz8cdQ6C0\nebw94T6UECpO46cyGdbjBZRMd6bU6Dwr5R1Jqa/tUK7KwezHlU3fIraF0fZH\nid3vJokrcV+vZQ3oxDPBghoEEIwbAGAVyqm/ijELhRZ8RgXJw+II4+Dbd7Ip\nisrVYL4WpGVQu0hUFhgr9wzcgai2CWTPbYR+95sQmvCP/3TPyC+3o0tWsEVm\n3ucJHn0MH+RuNXvOI4MCeWyYsBPhk6sguS4gC37ST9K17Zb0dRVODWVx2Woz\nO+Mq\r\n=cXg3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOVMfo6gbWfqtmZlmQH6txea5QwLYN9lB+0q5TOyWVdAiBsy1qHqfgr9Od2emZ1e/duAsjhrN1J8FMaSL2jr4Yqjw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906174556_1536256225732_0.10001938058066395"},"_hasShrinkwrap":false},"1.0.0-master.20180906181912":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906181912","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"fb10d7a082a28e1174c19f15e8fad711fe96d27c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906181912","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7sltUVXYJgAFjjqwCSmBRaRrXZGfStyaCDHM8wiqojAY8Nv2xaBvWzA4x/5ZMV2+sMHTp69z1bRDz+ZjyIKBTw==","shasum":"d1f5b04ae9df153a9c8134d58cc343532a49f8bf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906181912.tgz","fileCount":776,"unpackedSize":5252698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkXC+CRA9TVsSAnZWagAABtAP/jF37LZassXc6nIvPKIT\nqMlak/2wNFY8kBWX96q+Z4ll1P57065flampjkmoiuoxVrzx/nqQdlAEVM67\n5/ybygTRelkAk0KbzURFkMVnArRTfdnMrdsCl9VEy1CUbYiCv2jX4HHPeDZC\nVDSNjAhXOyAtEs5bUCaWsBgg+3Q66yd4Q+kLvoSGCb1OymGI8quU7r5sruIy\nVTUJUNikmZpPJ/+phsGXoO10WZ+5y5omqLC0tB/fY5oEACe5zEJ3yh0EIwaW\n2FamWt4xV0CcpJ+NMV86Df888XrrJLeog9G1H8NfbDY0MkmwueIjZpWAZxFo\nHvkj06shQx6nkCvYy3GKRCcX/C5O0PKY/Y22Zy3HIgztAffy8RH6jOmYAX3F\nMeyIgnFuwgq1gEtoZCtTElWlRxG2V3wymbkj92KZ6mormqB8q8G1FvvRuPqn\nyVc6JSoFwKvRGswq6GLq3qkvzrSjgbLcmaUsydfjwCMj+WSfbIxSdPd+FB61\nrW2fuklHnfjkepdPgzkB2m8omGFIXNScqO1gdyGwyZM0LZUcg9BeTOlb/Lz+\nAG3TAq+4P47uaGZ9eNXqqlT34L1mhjbWAPyzx0Ejo0F0PKAgbYVN5IEt9wVy\nUo9hyuOfLk1Tyh+RDreULcwR5gpeibGQDAg1oxsPdl5FaUjOS5hVsJmbJIYb\nl7gD\r\n=r0Vg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBTqaooC87gfYkm5hZAENf1ERgJxNzKG7NkLikEN6xzQIgKwZVaOLHqPlzhNzCB5qXjaUkzYFRJbFwcuETk9LUagU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906181912_1536258237507_0.1428950121544703"},"_hasShrinkwrap":false},"1.0.0-master.20180906201756":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906201756","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"07cf39bf79fc2dacd47a390a70e145003e5b682a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906201756","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-P1tQDqOBrwTSeFSa63O7CaZixGptfKde59Qp9xSD5aqRD1qRtNdp7TCnTXPFUuc3uqUNkp8chvZ6Wg/+j42m8g==","shasum":"aa40702b756e02cdbc80212cf24d047473422c39","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906201756.tgz","fileCount":772,"unpackedSize":5256089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkY1wCRA9TVsSAnZWagAA7A8P/3cP65r+ZHPlokTk4dyd\nYJCyg5SauRgxM664zcQNXGyDsfhQKejMtCW+StEBBtKnXiO4ck/k93UhAH+W\no4FaOKDI6h4l8YpUMPpT0MjhkRUugb4vbKT0ZK+rwlCqwQmitPyjM5MyR0QT\n8QTUSr/P8pXSS8w+f+URlylW70HnUFG0hVFOe9thsNgHMc7Z9NncyExHjmo2\n+VTxDtnfWkZAvSLwcJ+cNVGraP8rtyof+ZEiWo56twHqB0QuKXz0V6x/h5hk\nrBZdPZ+WNLgGo1b8rz12IznL5OA080Yx0J4Wx0CqMjZhKEoblrqC3rfPTKyd\n3h9Oe0GAtRoQXbzZK+jflgXMmLNROKHghQC+AvPY+MOnn64lvDOfrcftbGKW\nAPkuv3sDPyi426fzyqu054QG3jkSjAnAfrq8EYJ6BZpeyGa5+IefKl/ThMcE\nfCxlCoCmi86cIcckwCso8rsgDSIyJm6Nnb22G/dtwRzqcktedCGkAveZ8bZn\nEeOCUO7irAGSSsRmF0y4fnmCVeY7bJlQ6LGQ5hfpIHQdXB8QXMQKMjCWRfl0\nhM9dr4n6fYU2dyQ4sxf33aUT+R78kyML5RPIdNGtpyejSRgIBUaImECXYAEy\nPiqC/4b61dmmKKAFsC79szFIK3vgTAc4ZiVgNWslJRyYwgKuIN+Lk5cp2YpE\nA8/R\r\n=BZhs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG5xsn7yS0WeJrf117YKvtdVtVv2Fx3hXVm4O0s7hUPfAiEAj3o1EaSnISr/pkYFICK4YtHI0Cjl3I0nkb5AxUqt31U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906201756_1536265583391_0.6993086705801201"},"_hasShrinkwrap":false},"1.0.0-master.20180906203426":{"name":"@atomist/automation-client","version":"1.0.0-master.20180906203426","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e34ba28f5c5642fbdd80e5859a1a50745361c310","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180906203426","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HoSqkS46Mka5bR7cbMdNAdsLfNRhRJrJK5FIQRFy0mGtSSqfRKdAqezEne7HaU0yKJ/Ei+R+PRZ8jeOqdEICyQ==","shasum":"8e1e4902b69e68d9cf9f9a82d0c4a6f25ec74a1f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180906203426.tgz","fileCount":772,"unpackedSize":5255955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkZBPCRA9TVsSAnZWagAARQMQAJe9quh3x4KkJUisuLNt\nSsh0bWxC3y5SGCGCThsqF0vcl70pUCxZWrLyFWfhI4qT9h0SFA7gSvJnWsXj\nq7NXq0yC9RdgwCjxdbPwM7kimKnHYyz8vuznsX+bJ828PDewM0psCFxRPcTn\nMPoPEgaMUflDyEyiVLl5oNawes8D6m39uyF3epcIo3/axNIyQYOQjywhIGLl\nROSHmEqlcTJikqEYtyq9a4/f4/KqaSm8j64M95FFF2G73JUcfeuTqjsV6ut0\nAH2CUfbwio2hLqMwAaI8BKsAScb2shevrxg3UcwkFSsZ/SdlTNflFndapkej\n+FqN6gN3b9WYPM6elNby9t0ndO2zYNV8DB5IGafBFnA3OuD+gYRU7EcL4jOL\n0DKwFv8KPheBKTlCeUdpuowFL5RcVWhor+ot5gzCjfyv7qmQMZHhMjHCy4iK\nLrQT2wczQgQSa4+0fGlikdjO6m1tRrnq6v45ZDAeEIae8Fy8gfnFxgdQovVd\nQJfhAwa/YztXfzBj6Alc69LnZRWwSoBNy5iYxgzHmrIxYynRaC+DfGbw2mZl\nd/uJCXz2t3aQ72qVJ508CsyL/7/5E80zZcVtT1M+5nU58gxgNhPs1W4oRQ4X\nSE94ujkbiikAQGmiA1VP/HlTmT8lH6bufBbB3EAJtGn7tt/gODa1GxX3f8D6\nr+qW\r\n=bpXC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/iz0mXo+pn+jJPObwsObSuqcTcqzjIhbR80h7dYFoHwIhAKGEJAHmIWSWRJyO83ZEgLwV63UgTU3S7t+F1dzXnLs/"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180906203426_1536266318945_0.6481494748646099"},"_hasShrinkwrap":false},"1.0.0-project-utils-update.20180906213507":{"name":"@atomist/automation-client","version":"1.0.0-project-utils-update.20180906213507","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"835e1297e065eae566b147fb9bc8635db0a6ab83","_id":"@atomist/automation-client@1.0.0-project-utils-update.20180906213507","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6wc5mDYEyJWEU+7cEsqW4hHW0ql3IJX/5AlduXBSFmtF6bNdIBXtWE7dV8q7NLUYMAXZUuF/HCVbkVpuT4AKVw==","shasum":"68c3400db54c6d7081d58be962e15c5bbb6e647c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-project-utils-update.20180906213507.tgz","fileCount":772,"unpackedSize":5259114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkZ5dCRA9TVsSAnZWagAATVsP/2QVd8oM8CNHZsIsck0U\nLTscEPZmalKwQNM74i6McX1X2VK/SkPm+wGaKFdgFsuPNtfo+L2pgwRPGtaJ\nfpd9VBQEkVpiGoonQYjqu8DmasPTLW7KSsmQ2zLSQpR9KFyuRifvJCUR17/+\n/VcKOMteqJ9pCbNg9XE2+b+Gn60PfyIaC0vSnE8nW1qQYW1+Blcb6OkbAdfx\nHnWHkDQvHBhNxez7HUUwsf1Zu/NGs8A5Dz252ebGZ7LMqzeVeJ0lJmmsexp7\nrDjX65AmL0nTOhMTXVxaWOoSS4JdWox9lujamZVGYkM2p+EUaN9CL2KJAS9R\n47bGD46Z0nkoLjo7JnDYRylixmLwi1Ze55WKVEKorGLSpGsBTqR82XZpfkMw\nRQ4tV4CZb4xUAYR0wsXJBFqPS+K9EENW6o+Du09FTBnj88tX/CqaU78adKVb\ntUoDCr6DHnVyi6yyPnUCjFsJDk5ohcAaj26zdfwbAeqgGGQ1AqB6a3nsziAB\nots7DT3G8nxskM+4Cm+iALuBaLTEriqsiVeost7+Bv/OhF/J4N0szy9YRTRC\naQu1ZwkJtW+M2l1m4hC7tTuxP4v5aiq/VBhK95UqeUsxcs5IR98nT1Ho9pyo\nM6A7J7bCfn9NovZTEG/8saFVIQZY3gnNyIwQ3Xaf3J7Xz72V/HuZMcVe4rh6\n6yNe\r\n=I3Jw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHeepwukTLcR7Rzgn/FDurz2/Oja0WY2MlNhkOpaZHHAiEAr2JkKE33uEEX+YzheGy4K82zDrZ3YtYkM+SUFdY6rJ8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-project-utils-update.20180906213507_1536269916666_0.9173303074675481"},"_hasShrinkwrap":false},"1.0.0-master.20180907083717":{"name":"@atomist/automation-client","version":"1.0.0-master.20180907083717","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8ceece22662b0b3889b95d51db3aece9e8b53b7d","_id":"@atomist/automation-client@1.0.0-master.20180907083717","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nl6MUPTjrBE22N812Ge18EUF+GiII4yK15IHsVCA+SAD3WklWuFDqo6apQweX40lgoThhwTBnFeeEtjXLtrrLQ==","shasum":"a8e394d8939b2c5ce88fef30d77385add7799432","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180907083717.tgz","fileCount":772,"unpackedSize":5256385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkjmkCRA9TVsSAnZWagAAGFQQAIK2bxoGw5NEk4IdmTz2\nQ1CnhDNzpenjxC8C7OCH0SirDivpr4BvMHx2Ikvh2wPJqzesjCXGFHU+NPLl\nroX0TGacOvSAZHDUxhlQO+wvDDRqM6LTeiaq4aRDChCCpxuq/JF9MqJR/6MF\nldk5+v2r0ogqt9PvK5eUZwt9XPRiQhmY0FPelBND14qdgma6o55fLRenkdSK\nx/tcpeyDEOB5ncxNkFgceZTNBDTeHrIeWWVaZik3OAQqH8iAqvXgu61ea6Qh\nFAaSXAK7OTM4gdv1Bfh3XNAJxxxpapmysGFg5MUyn6JFXox29xTFD7Xw/f4m\nLB7quEQeerzxWxgENrOGtBTgZwDjiWXwsCw1Z5UJ4PEAQkFQT9f8CdpCCJSi\nr0WwoqkI1mXXiQIDGbCpfobpJUbn3DnV2DGuLjGE0o47pf3+JB6yyBiPYWUa\nu6SymPHdeibq2pTKnUYnal94bEfeHnvZSDbv11wYhbc1DVYhqc0eG9BjcUk9\nkvLLadrgMqRe/pAWfwY2vA8T2hFbDxB+QB1Fk0FLAQqHTyAZgL620pwF/ASS\nZJOuhBpt8xMWBM7g+CIR6BezDk+C5THqDQnDPYcBgxqpSbfHozpTptKlR9ow\noaHmSuipGyNsn1oIF1Rt6lDawJOnRgX84uKCXMgGbk7IZFa3Sqk6oYlyMvVy\nJfGZ\r\n=hu0/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRJ+5JF3qvBOPIW7ad8nFME6MZ2CP1BD4ch4HEYaAKOAiEA1ceFfgtwF+9wVTdLK2AOJ4pDLqyL8PVAvHJO6NUgFxk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180907083717_1536309667266_0.714216474230041"},"_hasShrinkwrap":false},"1.0.0-master.20180907111850":{"name":"@atomist/automation-client","version":"1.0.0-master.20180907111850","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e4fb7ed07745f2bdd8b6a077cf6f018f0b2ff5c4","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180907111850","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8ry+uHnkp6MQaelS20RNrkm24HGBFdfPGG8GJCvyTigQW6CZ/QJeZabMDSkXbbM/A9J+aX+JxWEg2IcPxgm56g==","shasum":"2a59dbcc8efe99e4567e9a9af4367cf7001454fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180907111850.tgz","fileCount":772,"unpackedSize":5259530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkl+GCRA9TVsSAnZWagAAY2UP+wTG6QIOr85tbfyTRuAp\ne7OFzIQCItVzmtvHwiez9VzVz4NDRLKxHBw0BOeQKRlQCKDGKqr1ZHyKIkaR\n7V0H9snvg5GuH9FpVVJUoO3uc5DyjiD9Q0B2a/tCA3fGF0RrWNgtb2PJbT/x\nroTnRHQaCHgPDnuiJajPTZbBmSPsbAnPvF/+a1U/qKOthrEQRINeURDGNSlE\nTZFvYvqMlGdTN+f+hHQoNfGwUPm0Ewqdow5rS+r1HyUEUOc/kIyNk/4b7XS5\nhlh5lUMnx5YP/smRRzaM6Mx+q2mDTcVbtgPYlhFf5uiwmwL8NHJrkgVSk7tI\n44AaXCIqPYDBsWBP5QA8eo9ARFMSmWFH4uo3FLg/ZEl7kpqJbk9kOnNd7QOm\nWQkR9aSFYvumjGF29jbCRRpfRkIKe04Rlek+q1BZgAxdtPD4I7FNhn99FxR4\nz6k6pYlyl+Sln6tsvgHpMKVwB6LcmrhUIja/XgXixXljYm8rZvdF8l8BBDXa\nUEgA/X/QOKsfyWDHqpzxMAe/K51JNhOlkUCaphCZ8r+wX200ViDkqTRySwdp\nNdzgUMfzd7sCcRRzLC+HJLWWtZspeDtL/558FE+J/OtGRDmCkrBabu3FTsS4\nprqxeDqfN5899aPNA3ig+DnQT6zB+NZ9lHdmhpu50HYC0WCy0YVvj1xtpcYb\nlkSU\r\n=QHAs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3fQZ0CxBVzjMyTt4Lom6ZVh1ivTPQiEiQVeuTzxuRAQIhAOPWaOLe1GkYdvmYFT4n26l1ZvkUrtYoIAaC4KFTxEx4"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180907111850_1536319366098_0.29625066800303124"},"_hasShrinkwrap":false},"1.0.0-nortissej.gather.20180907205444":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.gather.20180907205444","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"53e86a612b0413e6bf2a60e5b9cfdceda59f8daa","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.gather.20180907205444","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oqe61k24g7Pvx9/V7iEmHi89Bqmc+kuiw1gQ6r2H/Cw+RH/sI+pxDo2zGv/tDYP1Ck6tJJC5AYqc72R017Disw==","shasum":"1b21f9218573b52dbef16bd3466658ee7b53e45e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.gather.20180907205444.tgz","fileCount":772,"unpackedSize":5260757,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkuZxCRA9TVsSAnZWagAAXtYP/3ljLTkGk+XttHPOSWeC\nZC+vlVS96lqeJ4NKsQbLqkfmzANFHzBrT1Va3+x2dgBmClGaTR38ZqKo0Stp\naqzwFFQotds/6ts8fk61T1EOhtwDpJUe4bNyxhHBwSPQFLXThZ6LeXbIBhff\nHcIGT+fLY4SYmJtqLzT61L6LtVS8dXzDJoKuIKvzJIng+X+qM4Gb/7MlpXUT\nDdPILeB8bBvUbwTVi9BtM4l3LrUu5sMG7bfVp6XksXsCBzwDFFpq6WK4hs+t\nMKbvhNxe9GD4L2uwJ6ylETma09esL08rztJMQ/JlQi0wYUiTorWOCg9r2H9m\nCNs+f+K7h7Ut3OcmxNjNz9rMLLsBb65YshGHt4AwgxQ61sYGg8+dJiTiMXLV\nRtVJoOlnvDnbLHev/UaaPkDKZEQGheoIku3q0oweL8PYHytyft+KL72YUor0\nBaEvhlodlnot45eIfGczmO3Iez0yGJuNVQpMiXIZn0f0C1S+6eVBud/eUtPT\nchlF0ce9abBwahoculaJvXYgx9dH8q5eK6b6sIV4hd4Fm7I5r01VJnCE7MGE\negeM0ZULXbFmt9ptQgv8xirI5Kzu3MyY2V2t/qIQiK7NHXkVQOXAV5U70Zvy\nK1c7jih2XEQilkU/K4xk4IZ1qCmTlIGFDhL6NIGnUL2Djul4D2wPqXCE8Lx9\nwFaw\r\n=NfCT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHoC3VcKS4rfhKa1vv5JEpX7aCdnYEaHeOjkUKXDVAYJAiEAtDpIyDR0uxEQD0Xe4mIurnIoybUYN/hFYNBsd4+z54o="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.gather.20180907205444_1536353904544_0.6047077789475661"},"_hasShrinkwrap":false},"1.0.0-master.20180908012014":{"name":"@atomist/automation-client","version":"1.0.0-master.20180908012014","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"11182d1aa1dfb1d426111579beb6aa578c18c85f","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180908012014","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Jns2bzF2Xgf4t4QNMM1LISato5svMCXE0ExcJyYppQQkGnqMymYPzJE3cowkw6VSe0bRxPtelwYztw2H30Wavw==","shasum":"a40453d27e2616b52f0f841e6dbb59631c2d4c83","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180908012014.tgz","fileCount":772,"unpackedSize":5259530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkyS9CRA9TVsSAnZWagAAtcEP/0q4RexaTSmR6S7+8axQ\n911lZDfjGQeHOSuZvUwSZuHdknc7tMH3iuMH8z6qxMNdcCtnG5LQgJXfl/x9\nkDj+UyQAy1xjioFXRMVE083bZDxtAu3QmCYxZY4vSLcXWLqY0NgP8W5/bBIq\nwm0ou6oZSX2EO0Q5vK3l8X0JFpDyECQhMQNW+86bdmUnfF4FRZhwZ/0gUW9S\nM84eeoHEb8pY/oWcQP+cBozRA6vnGkZQavcXyZIlKAEIg6SDjnU83Cdb/dTp\no0DqRDfOoANYMF57wJ5TKhd5y8h3qTn++kABUBrl/oPLA0fRPixtcEr98Daq\npWkfjCu36CfmzthMRLSYezrBaeTpiIx+BYMFUjyZQfrIEATYWybPgP+WwPIz\nlvdbGxjfHzToTZjU4jVN9XMgxyLJv11qFXY6+sZee19/NNDjt03vp0zHmFQS\n2vt0Y/vcubct0cnk7OYl2n1Gkac4e+rJ9lYldLU3Ic8IlZsWty+Vhb87LTS0\nAVUbFeDDHEumVTen9sbY/ul02rkoTmXasAx/z5szXG6plr67bf+OYAkICZJW\nvKy9WJHDeh7Fv26vmK6jNSPyna04uNLjW4+lGYkh6S49ga7pbmSKwyikri4Z\nE5Cyq6Nxo1CfPIXZ2Ytj/NEs++K12KmYSvpSU4OuROXsewZIUcPvA3dLcQMy\n9G9v\r\n=cPSQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhKp2KPNGrFKbFIyXzcsoxhgARHdpjXyEy/xf9Mr4HHAiAV37HiPDT97tN9R5MWtDQFvwyW3/t+NFBI2oz89QMiug=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180908012014_1536369853071_0.7041375700834136"},"_hasShrinkwrap":false},"1.0.0-master.20180908115540":{"name":"@atomist/automation-client","version":"1.0.0-master.20180908115540","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f66adf98db318a92522ae30e1aa7738245e527df","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180908115540","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AWql2GLg+dBPXU/R+G66KlBviNGPalnvpwmeZGvTRZz1FQB8+2FHb2xraEENaFJ4Hfi/u19t8/UrAmd3kt0lqQ==","shasum":"bce8e941740c8a6d0da0b482d95c1cf85d5c64fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180908115540.tgz","fileCount":772,"unpackedSize":5259979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk7mxCRA9TVsSAnZWagAAhdQP/2lC+pnJeFbEUM/tocJC\ntisihdJs6nUY23znSLtR1eCyFvL21unqDVA+ZqhitqY/KtRFDugyYme3Cmp8\nHK3lYK43beho5BZ6KqhprD1x768ij1edof0A5n14lJMvrbADgsS9YaY7F47K\nih1eR+1W7h/OIsssOGnTISBSB/10fvu4oRaWAh0HxPm52WeO4lcyijL+Ar7/\nBm3YAUyJ32QQZSCwju2NfGQIfYy8KQwwX6rWM4RfPfNXuX6X7nDhQlVBy/Iu\nR6BFdlL3ak4YWhG8boIUaNObfey9T1Cc80+gItZKyNLIjJ/RqsbU9fjNTfMg\nxZhSLlpLbBXbWykowAZzOtc43zD2cWokMO+2bN5LGREbpZIFJkT77DmAesS0\naKTkwaryNJCsA4ysoWMXcTrqDBkWrpEPC/I1VCPYyY9yoGXzTMUGr2/ylEYW\nGEul7oe8TDnf56GlwKxiOPugSXHB6XU+nM5vHABPREd65vc1SmIj0eS0e3XK\nLZj5c88PxO0VrjAclK1XHHwWNN/1690kSh3ofqd8H6P+8S52etHSU60UmJoc\nuQc6FtxoyTxoNGw9fG0XxRslNa9kk9MkIM7MOV3w8097UHRgcSQxugRjF1cC\n2lh37W9jFQ2oAF+YHg1Aj/3Nqyof/GVE/6KYW2PDVjI8vl20ot7ogxt+bah6\nkcCH\r\n=/8Tm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbnN5svUxmPsLRHWyU84c3vPUgWNHbNUbQDRXBXnfb1QIgNg/LvvBgeuzBZPKdnET523ByZR2iqmRc+9+rv3YIpII="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180908115540_1536407984238_0.7006255776837818"},"_hasShrinkwrap":false},"1.0.0-master.20180908143715":{"name":"@atomist/automation-client","version":"1.0.0-master.20180908143715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"9768eafeb185e9b4acb58bf9e0fafb2e23125c8e","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180908143715","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mwN6JjcbjGkLVoT69O1MkxCDfI4aH/tGhqOB1lcBkvu1bDAlX8TJhfGsJjuwsqbt1egKSn7Iy/89q5Q9JCmJcw==","shasum":"1a4d391a69ea0a24e0dd517220b3a0e64f07dcde","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180908143715.tgz","fileCount":776,"unpackedSize":5265108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk9+oCRA9TVsSAnZWagAAjBkQAIhyzIM4T6vhqn9rGMBI\nGQH31LRc92/0YlQZCD4vxVnf+Otie7mvCpNnw+kfQiQ6sWfcsIN9QGWSHsSv\n61+CJ9Z1UCcdkF1QEm7SyZgNrfZX70A1PuGlOaeHNjJk2FtAe3ajACozV12l\nQCr3YZrxV7fhnUSDfT5PA4CFZJCEjOJK+61UC/TSJwKrROIq4jGmlf+oC/4g\np2oDk5qZ8P7RHmkzvEJYWdV7FynWIIptdT1Y6sjtpxTYL4G8RoJn0oRCRBS6\np2hnu8tYR5O3YGO+x7Opektcv3pRtANbGGVGL3dIiO8XmEh0r5h2DNIpZHQB\nJxA4AlhvHCLsBGMl5QQy3QAyHYnCQJXW4ZvmfTuLcmhG3Pw+BiIXCum9tZ3v\n00p/T7gZHsLWZqIfK+ole8wAtu5M8n8PG1RH3vkhbz0+CaSYxDFwwAVyffaV\ndE8X9rslP3lKjqyb5rs0IwzapeodhVqcuzbxh9tYBWl4IATB2WW4cRXeKHhv\nR7j7618xS7LwMMy/HcrPbsd0TWArUcGMMp4fDXY6ZXKqcL/lz28TBWCf9fiN\n1ao8QmNNcwZ2mqZnT6Eb9irIzdrv7DOhP4JHo/tUva6L15Ay54D7rJyUHAmK\nJhumGpGW0ey3UzONKfcJ+qnRh5Aqes2E6a5An/2Z+9APg2IEYwK71L6gR1nl\nomP6\r\n=2XMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0nj/hhs8Zj+hvX2BBsdhILEjyhH8H9hcC7EPpTkwEhAiEAi7f/l/9SKpZQP20C6ov1PrPRWb5cBdVITC1/rFkg1ps="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180908143715_1536417703386_0.25351684137728436"},"_hasShrinkwrap":false},"1.0.0-master.20180908173001":{"name":"@atomist/automation-client","version":"1.0.0-master.20180908173001","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"1ab40697e7c44cf569fe4687840aecb47328ad9a","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180908173001","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FKUg9q3Z9JkzudW0pjXIGd2iexUU9NdYwYYoI1SnJQoOMy8jaO/6ypeLiY8xF9rup4qCuUIzK6NMk4UROnBdyA==","shasum":"f4a46f1b391749de859f36dbf21c918bfc9e07b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180908173001.tgz","fileCount":776,"unpackedSize":5266466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJblAgWCRA9TVsSAnZWagAAVvQP/RcvVZeMrH5t2Forxvxb\nILuYJMeuOaNhAijH6Zaj5awK+cQEiN9CdvmdW9gyYrtf6fVwsEcA21nYIICW\nXMVoI7+p8y7g1GjxfN8zbO+F7tEF5wCmTh47x6KwFZkBaffEfpS9+KTK7vOp\nGA7fcdPXCjZOag4raDL+j7M+49phj24QbZckuOPk9ED4cxST9u0+rP4TXMYZ\nLj073c1ktQTl/8gLIqVy7sTKHJyQASRfViw25R3hRLpsjzrb2gh5jaxmJfBN\nmqz5CIT+4yHiWKzR9Flz8bRdeAdkxQMNQ174j/5F1RmqV4jk7i09sSLLVk+Q\nv/byX3WTxRn5iqkwtLZYwRglMHEuf7Clwq+bacLm1xdYYTtXCAq1k9yU7x2y\nk98oxTNqh7zPxElsozfCvJq9Zqw25BVWhb50pWgszffFsl5Lsl24XqfSM/MX\njCAXr5S26C/dYeKSByC4LTGm8Rpok1Yt+Ie1Dgb17u3m4SjGVcSE0jduo6Lc\n3NXaSJKhA2POjZyw5orqG4d9Fj8HuUO4mJpsSHT9kOAfUKi1Dre4GVdp//CO\nrlS7CC2YIHXZmgP2J2n7Kt3hJEH77Kt8XDNGb62unL3L9G06rXkyEb9b5ex+\nFwQ1H1jNWOwce+ZoxFs85Y/zpUuOtsrrJ7baksOqY0SsXFD3qL4PexpF57Cg\n9ZNc\r\n=xyF0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXBtJTSSrLPj7ZrnZQB0++vMr/ZyIvjXVv/draOkUgUQIgTpa4JE66p+k3nPdlYm/1rXdtOZgA3eNlKQ8HK4q/VfI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180908173001_1536428053761_0.7008372402536687"},"_hasShrinkwrap":false},"1.0.0-nortissej.error-print.20180910194841":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.error-print.20180910194841","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"6752e1f169e55adf4942eeb966d225a6edc755fc","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.error-print.20180910194841","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pc2HoXM6F4XcfqJf0mXZqIlq+3F9cHoWGxRXclXjnm5JQO7p8Fn6KQoUhlD3twx68VLmjkZW2LFp6CJjzT14Pg==","shasum":"5f9cfb5d02fd5d431ee7bccdbb70b9a9af1051ea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.error-print.20180910194841.tgz","fileCount":776,"unpackedSize":5266578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJblsuCCRA9TVsSAnZWagAAlZEP/jVFEbVN2arUahmynJa/\n967zXaw1K0PGP4QaLQVcorCPcuJLslJQ77uQEM+60OLgZSwjbE8NmhMo7768\nBKxTXgYZGk/ADCpyP5EVAtrgbfwxxgm87hPVRrCwN1hCfy+FSj85yq8RJ7RE\n2q0LRLfKVUpPVFGwGvO5Rohen9kfsSZLxgYjJbqmPpvYrLGPICG2ZRrDNlxF\nx4CTll1MXXr9auoFG9PEOXatHakKXKbJdl8P5yZ3E74h1lf5kcDCaaWYGvWk\nlxUR8ApHA3voXHDa4VrkqIK+cQovYuD6d+ZxAhwdkE6F3sw5D0wbMWM65TRH\nqfvN9pgXHDL28xE8dSEzE45JAqubv3WhGhcLWVMoOYHpgXB+p79y6NiNKjeC\n9rgZ/i1423SOiSAZV5DMbMrkgJQ/4XQOL30FJHXhcOW4HfRimwVDmxrpLm6K\n8y8AxSIbIuryZgUnwWm27tNGPNSnC11sNlwH+Ycpb/GU8LUOgG/s8hlZAVhD\ntKZ6DXJpThluJHQTqCh1Af/pQJzraDhjshi7qOYRtsV1RqikpUj5p9YJNeXP\nQK348eUfG21NV6QjqA3fP7dJvO5Zmp29tvwpDqaH6cKHNd70kidHsdK/BGm3\nOjSG85y10GGAjoivxMm6evY7b/wskVYeZIbN88rqhMTMYb1SoPWJHK1qfQfc\ntfNR\r\n=wHQc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChIQH4wVu9vYIjvELfuvVUU92VvSuZV3rscItvKG2psAIhAO1LTYjHIxG6Bx3opfH+bhg+dl2nlPy4mNZTuBBDriy8"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.error-print.20180910194841_1536609153537_0.6062087427252174"},"_hasShrinkwrap":false},"1.0.0-master.20180910201053":{"name":"@atomist/automation-client","version":"1.0.0-master.20180910201053","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"0af6e0d29455f27008627efbae140e298cbdaa24","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180910201053","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-BjqTLTL38AYv/fEFPCerh+3oiP8aVQT8j5M8yA/EJKVCR1LoQE6bvw0gShLhOPFQvPW0s07h3BK/yUxFjdLGyg==","shasum":"975465c8bc5394ca5a4d779d5249b7c9b225f97e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180910201053.tgz","fileCount":776,"unpackedSize":5266563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbltD3CRA9TVsSAnZWagAAyswP/Ay2GSYqAynCoDyLfv3Z\nGEHqh7cDgIQiRAhImyN/C4g9gEoL0Mvt7VkL/QXbhQKIaoNr5JntVKgmoHD+\nyrt7yvR1giBdUEo2/1Q5RhEnnERp7sxILxjeLCiYERv40bxGZsMgX9ye6aW2\nEkUl13CZVqaLPuDhTslHCsHRwTE2D2KSR3nqs7XXBc3YgakZ/RrsU1+GkHeR\ngJg3wm2PvADlrd+v+nqKSQm6q+abriS3sbGuY4hNV3jLrYrW4UzlpuMKVwTo\ndM6kEL2Mq/7Vaym0WbFRTHOB3jW+YS3tZPGBRYusbEuQNWLfXzfzmEFAESlD\nVxQheLIN3hZFAgN+Ne39uPMkAf06FyvZa8npn4IThohLWzQQk7YH0Iww2SZQ\nKNQwOHjTstF2eJnY4d1tJJDvM555jiZDAG46GfjyWHs4i7pB0wGINZENX80Z\n2S+YjjwBs6ogrZbEAdR2SirpB1k8zWLaII8ron5T7HyAzarSXj/NiufxVznV\nuBDYHfsJfQX1iHBxlAW+7sgtvXwRbKhQ6XQBVkiQ+h0/ZbqAHO3C+3t0rJqs\nSD0IG90qE8w6ws2+/+gxIQJlBD+cXFQjRU/2Ps9oygbLNvSnlv6K4+rfCiFg\nfK96TtRv8+5HOWxLu+yDRde9bNIsdxUGRxqSQi8ovlisf0vfEzg4Q9fjTnpT\nYAfS\r\n=raKl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXdY5rE3xJqt645mzwvkILCaTlBunkBSrY2U3IQML5MQIgbDbdHyStZeCCw79H9XWFFParc5GgTSVC9d0bzIhh+d4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180910201053_1536610550354_0.593136887419009"},"_hasShrinkwrap":false},"1.0.0-nortissej.retain-branch.20180910205640":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.retain-branch.20180910205640","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"3fef4c89440bb9c58a0e649f2afca81200c84810","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.retain-branch.20180910205640","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ryKGKSXgGCMUFXwLETFDnkmeVYzQ9p5b1zaLErEQhAkq/cFgdCqxBzVWhv+RxkrzSldrA8R/PKUPP4tnrNGF8Q==","shasum":"296e9a76703ef001f5ba960e039fe5aefeefee9f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.retain-branch.20180910205640.tgz","fileCount":776,"unpackedSize":5266758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbltt2CRA9TVsSAnZWagAAzHwQAIrWT5c87tDMgH4G640C\nJqdIcZZuSgDzcAhjWCpM536dOytqVcl2xDAlJIoTIxsWjFe0sIblvozQSzoS\nSBHoQSrdn4Am/1EaztIGCFXzZREmg12gU6SSuy19b+cD+4/ueiS3N0vZIBqz\nq4vdEBrkBBsL4MbSGpAtaRCIjrgMPCYf+GoBS5NzYkIBWdBSm+/N+tQn8IJ6\nGkTISkizWUMWASnYJJ+VHbnVyawDYV/VTuajzX41djj4DZmQie7jIgryUHc7\nPTqG7SU9DwYIDXkGn2FZgsozfkxJ0U4SxKV58z4QyNC8iZOmE0mgXdq3OdfN\nMEOOuR7E/wb6foVm3StLClpyzzNgqCWs68zTEgTtGiKfvTfn9IHnzkflLckS\nYU2PiUwoVKU1vqh2S1wRzJsWZL4fwnjMCtfaAZT24MCnVUdOZJA1Fs6Vq0gq\nlsvGUtTNozi1KKpfo/MG665Q+aDp0VG8g0ERjMVX+fJnc+uKmD1FDu2MtZtq\n+W926pJZLcIa4vOiWGJ7Wg7tZhQTemACao8HXftMD9W0E9wq7DxuIxHSPOMv\nW4D+s6ZFNCu0hHWwWAB3ZfVwFghbcMkC2z+D8f03IxPu7IQvAq5DLQuCH4YE\njyg9ZZO8wUk89mF+zTgeixnSePjtPi1K4SXbbwh2lpWnuk8X08eXViFbN/aB\nWKTK\r\n=rf5p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbRgN/xqeQJ8J5a5XYqFBC9r8RNHognd4z0hGyc53NxQIhAPjVa47DKEP0paXn0hLAdE994RUoCSIAImIJu3+6zYfb"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.retain-branch.20180910205640_1536613237378_0.965368419126216"},"_hasShrinkwrap":false},"1.0.0-master.20180910232423":{"name":"@atomist/automation-client","version":"1.0.0-master.20180910232423","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"48e435eb1deca733ebb55c8ef2d950041241f24c","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-master.20180910232423","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-klTTIAL5aUp0TLkcgUvEKU1gJsgOXGdZBy8MyjZmhSC7dAAOuh6J9EZt/YpgeiD/NU6qon0gvQNMYJ66NGkXbg==","shasum":"d83118cd53a6a95ee1283ba9d45792069266597d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180910232423.tgz","fileCount":776,"unpackedSize":5266741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJblv5kCRA9TVsSAnZWagAAi9AP/0xWza0B9QlOPi7YhTbO\nMtZxqdrEzz+KtHhaUkSLBWjT2z9HVYurtr9LItypafjcaxrKtOrc4jKQ1Xn9\nBQIp9TliqTkiz8FmNlET9OGUkyeLq3NxELZELnyszugh19NSaL732+0FXC5C\nNSTJ1FXHgCJq3e7WJGhym5FsFnby2OFGSpia6JGAOHEYhhfri1Z3vaGSjMM+\nyRh3JK04kbWqUpYLCrjophRMaiHyU6Fydw2Z6YIe9pejxa+GImY+u1lP3RCh\nHuV2Xf+zRyO1gKTOQy8b8+eXKgoWbSeIfQK4afTWRBBObwi8p1oRX+LCTx9B\nF0slsbiqhsnVNEp4SJyPgBxi/xTvPikPcrhNppDShXQG5eF2UJAaTIaseCrJ\nnDU4dxy7HngYOXmoY6PaavRr5pwVPwJ6CiOd8xgsEsOF/ip3sTaSTUIC5AHY\ncP54kV4arCanbMklNxXw6AwCmHFPCRlsCsHWULxF4A8sjdSbM7JzO0QsA6bN\nhrX2tieYKMCXWCsRQiG9QD/C2GtTyE/iINp/kxA7LVnI6Ov6foyjLkYh7oks\nKhpsv9LIiLceAA0kQexV7BiOafFXyChC7RYx2WdEYFTbM3m3JsLTEe2ojYxY\ndNyLVuz/f/ahOZDMQIC2DWPs1HfX8haMqHxvluSDcmcVYd/luhy0E39gnstY\nEvz2\r\n=YqLR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwFrkGTOuuHD7C3otldlwp+W1XWKbWYJla1dPO3NjriwIgMJ5FzbFISC8At79gz8hfCiXFAObQSspfMeG/+AX9XiM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180910232423_1536622179229_0.3987074134312236"},"_hasShrinkwrap":false},"1.0.0-nortissej.checkout-branch.20180911043314":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.checkout-branch.20180911043314","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"bea71b366b9375a612134e5abf15aef9e14b1a13","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.checkout-branch.20180911043314","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AS/IhNzh4xAsJotv0OKSjGRPlpg/i/E/AfR6nxiTKyscSzcD7+Bco8Wpbd1bBDvx2XT9kUKxKEUfCRDh//Vsjg==","shasum":"beb904162efb74755ce8203d16e1c271ede8adcb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.checkout-branch.20180911043314.tgz","fileCount":776,"unpackedSize":5269231,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl0ZfCRA9TVsSAnZWagAAVbUP/19/B8Td+3OnSa/w6sU4\nQswD4Eonsk6cU8uLZtWJx/lBc1vb6P0ZIkYttIa2IJn2CyWDbiI3DVkj6xWQ\nOn1dILLUtTKv34q4n+X3S9wL4o+tVdsUn2EVXdr9/Af4AuKKlK5RIWpG6nj2\nLmnOFnc4vn++exEuy/xC+HjWr5wHIBYQXO9PbmDUnarRucPy//AQIp0i8puw\nulOnnb+dPuDxxaDUL969kxWL8YN609HslpVHRnCbrav0zPTaD0Qh8Sy6azhc\nNfNqs4AyL2BteRgVSmZ1ygsifE3pL4rYmm7p63tgac4QHHhoh6lAkFKsTE9y\n+KzSsvh2AqWDlsBHCxkjilvLk3jJTEirfcLVngQ8ACCRuY+hdof5fzBIx5N1\n8Y9pGBRcHUOsNq9RrXj24pw3UpSyxeaq9hxYkpks2xw36vQoGnWZrvfZ9/Td\nzg6rJjgec6LpN/CFhXc/QNM0JyUf8HXgKbSEueWp98eJa1AtleMUitc0OfNj\nDic1jP9DFX6KFSwEe9lVbTfw8X35R9sLw1XBDwSkxzzIzeJ4TRZaaCyHEbYg\nOU0SB2/GPpUYLaObiEkO0kjZFQk3+ne8gCqwWRMw1FhzWLrW2LxQeNgP5gZY\n9ko8mD+rZ/wWLBldO/t4iV44j/7UOMhC2Ae8GzaNETKZT/PK7wmqPy6QdVCz\nr4hW\r\n=Wd61\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAeIiNy1UUIUT2iDKi5R4g7AGcop0YnHgl01YsnFRbrcAiBkFQY7zI2MXR3zVlR7pOO0ml45ySbUDWQ85zf/hVRVZQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.checkout-branch.20180911043314_1536640606989_0.9004913673826553"},"_hasShrinkwrap":false},"1.0.0-nortissej.checkout-branch.20180911051036":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.checkout-branch.20180911051036","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"0c3d6e335a9a4bc19c38be38bf914f207ad15050","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.0.0-nortissej.checkout-branch.20180911051036","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-p/sxBMsf2a3lN7WUr/Q0igxeoHaOt+szAm/wFz5lwIsrpHKu1HFZqsHbo0bMupew4ju8uAOmh85w36GMAlJRhA==","shasum":"67cd14c6902e8da873e054e04052946b058b98f9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.checkout-branch.20180911051036.tgz","fileCount":776,"unpackedSize":5268962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl09ACRA9TVsSAnZWagAAkUQQAIJta7+u02QZ6ZkFlV8k\n0BhAhyzx11yFDejQDQnP7K/pNKQzpXD+/IEtxnMX1HmHW7aJQF5IAxEQpLVK\nTg2FkUgxaRTY39xk0UsgvyN5XnbBl1pXUg79muXV3BUcaHUVomOdsT0gPHy+\nXMzV6wHSGMaALLSuLO2+FH8KBNja8rts38OwMq6NJE9cK0jMYL3j8YLNFHJi\nI3TAn+eoFgUYnC2y/m75/sLyHHKCQPnR4lbAzjhMPh8uS2NW768uXhQekvuM\nfg5ycpWo+dXLgj/kHekwDabKn1PQNGLDOcJMAzgYh7okr9u+bqBUglkqvIxB\neR+qJ5W504rg58Hdc8S455YPbR21j2wQw2+yNDGADsrO2i7XG7CS4ESyus3V\nOlu5A0OjyWSq/L8oLnfj/Wn+YvjrJ0/LeqfHm38Jl78hayObrhYkRgniJfgH\nJWtW1vt7JfQBb/yQjqzfJUV+ppQXOWbBrSEFlfOVsWOq7ymTUeU2l9b82bvG\nBfVbZm/P4P8CnxB/E9DBxaI9nmi9aKfJeNnAFoxTr8YA34BV3Yxp/kfUS8Y+\n1j4hISdmkcqw7qs+Z4Kda6iOPtU08IFGEAX3ALI11fL+t6NNxpl/r99Jfq3l\nVYHMKWz9zAGDs8wxt6GrC+0zCcpUYlCV7wqVs8GB8bt/alzMhwZRQQteRMGa\nvwqB\r\n=h7Y1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZNtZskQVvJEmYDzWgxolCqlFQU/8g5abxNVKdOGBJUAiEAnU002Sh83oR9JKAjc7EqErvYMWt4aCMChyBRDL0xucc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.checkout-branch.20180911051036_1536642879407_0.29204970220408866"},"_hasShrinkwrap":false},"1.0.0-master.20180911085654":{"name":"@atomist/automation-client","version":"1.0.0-master.20180911085654","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"576a26fa00bd1d38a625d957612d66c007fd4538","_id":"@atomist/automation-client@1.0.0-master.20180911085654","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JNgQgF/+bztIMkILVqOws19TtLqnm4sgzzzO5uQnTyI0mI5bbDG/B6m9Il/Co0aiGCgT8k6JWj2eASI3kUnTcQ==","shasum":"dad556d47ea4dfd4ca9b1b14b2605080317595ae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180911085654.tgz","fileCount":776,"unpackedSize":5268943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbl4bcCRA9TVsSAnZWagAAp7IP/joj32Bxg3ejME3z9ldn\niO2kJLoGXmaqgyfssEybB7EwIYdY5DaEjzsQI6Skr/nvoYl6MQnrEUgf37Qr\n6uqrqSwtCKZfur3Chs3+uh6iY6c1w9eXwqLb19l5paXO6xw6r5oweS97xltI\n+in+LYmaoe52NuNSwsjN5gvE1MK2kn25Xnmv9//kvGC4toKbOg7lxrG/hNbk\nAG1g1b7qr7lLVjlmr/dZBCpWp9Q6UF6CkNQjAuepSOJyJkNPyiR4A6qBVbgu\nx6dNN73fN8zz7514QR/vG8UAWmHIh25cOoh+ev782135lDPV8BJ/011kwpCs\nYja+xe0K6RAPdBGuUh93dO6KYJjjAOCuhQcCYKBJxLTnm29sf8cybaggfyie\nrdWyBxjCzR1ThsvkyAQpl3jyWgVt+KUKyciyikJD/mRGxXGy7Hf3PVoq+5UH\nbOGXJzLI1hReoYD6RVE27lKnU737VX0nl9Y7fAUqlOwRZK+phdMJ66ljBPYq\n7uVyZPyGG+34IYchGQvhrm0hOLPwhO8huY/yAzoSnFYOQorw3fxWTu/xAfPC\n9HaSOn5j3jWyW1DTNLfdVqygKt/Brx6R18i0eECStoPSOaYliP/p4S7DeJwO\nLbaU31dasS/2K1cnY2gw2Y0gM1g4ohQR8uz6HyjQqcBhQE8fw+UIgqy+ZXVA\no2in\r\n=j0yj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPwb64y0ewWyKNrl5EV87CNvAybBD0CzF2YdmESBwM5gIgdueFx4FocfZi4K6c1yadVlXDMUqjVYink9JLUphSKM4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180911085654_1536657115813_0.870666101593925"},"_hasShrinkwrap":false},"1.0.0-master.20180911182544":{"name":"@atomist/automation-client","version":"1.0.0-master.20180911182544","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c1a3914336032a42738d9ddb65aee46ad407a4dd","_id":"@atomist/automation-client@1.0.0-master.20180911182544","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0McbH6CkNLNuIgo0kCHAYdPJM0Cp1AZ0/RS1BOEPMfbY9Xav5BvEzc5AWAXmndwMEYzQd0LBSZ5sa9tWHbUGGw==","shasum":"b3dd939defcdee5502be76f16ee280721cc666eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180911182544.tgz","fileCount":776,"unpackedSize":5269076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmAmeCRA9TVsSAnZWagAAhY8P/1HFU8i6nC5k2bafVB7k\nqOZlDWRos17AtNnvBZpWZzrZppjuvcDNDRTpRck+/Zj6oPipPyyJXm5Q5yi6\ncCYqXcppieod2qKYVW0ERmDBfWTIWgSRy1oSP7zsFy5DGsHf5J0gGnfXDQec\nazco7YZdNirpxdQx1vXHtwg2VTTZ0RBC5P3hvqJ0L7YtJWWPR7ZLxYgz4uop\n0OJXNJhsP0HJKsjMzp8dyUa3sfeDCgliM5/+M/kEzPR+razhPwk8yTKN9Cd7\nVI2JjM57dhtcQlhXOpS4vFc2dnLgOIjcy7S8rtbdJmK2lBoVesjVoXuC35Ge\nSm+pC8c9UF/btMYK5hYs9RheIADdKL4iWiZdQzSkZh2JDAzGb/JN14pX5HBe\nccRJPvqq15WWmGzzww4uA+eLrdR/aXactnRHoqX9LQHCCgrX3i/9DUaSnYNM\nzHRlfc8qenP9ZjZToig/olaX8j13N+J2637ovyme1abQ9fICpcMPUmV8ZdYO\nObRtU04VAnaTrbSwHH3YjHgP+gRNZyCzA10c2K5LtQ4CgAod1fJARkINYaU5\nRwkoc/scN4kAG47GzMs5ihLiF2n8A1UFe7cvps6aLzqNFxEYjTVAPnK4MNLE\n3UH1pyFLOapTxJxDA61QCH6iTWjkC1gp6M5UoqPTdo6M8FBT1LuULyiPB7ip\nmf08\r\n=vrkz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4xwKbVffvARugvMkNgqESLiBapqiFhURMJ4sY1k1/UAiEAjc3n8nR+GdvjEk1wMKVqfso4DY0N1XSApJq3ibIdxEU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180911182544_1536690589923_0.1006449261974518"},"_hasShrinkwrap":false},"1.0.0-winston3.20180912092138":{"name":"@atomist/automation-client","version":"1.0.0-winston3.20180912092138","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0de470d7c773d3fdb79d6cfd0a2d77cfd38160ff","_id":"@atomist/automation-client@1.0.0-winston3.20180912092138","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jHRpy9J3SaJkPyFldmh4ySJjLqJiFKullripT5FoYRDtJF9Kd+LJC1DCvahVYJWKWTe8Go+So318giq4UAr0KQ==","shasum":"8b15477b02cff015267dc6dbaec64c8872f0fe35","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-winston3.20180912092138.tgz","fileCount":776,"unpackedSize":5274693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmNu2CRA9TVsSAnZWagAA2FwQAIdfsQgDgFGk3LApSTJF\nigxEs2o0QGd3Gu9XGnvQgtwDsEyrLY6iDVdvUX97CATm8i6+6sGTcbpUjEl4\ng+HPlpS62w35qbITN2+OFqy3P3j3np3QYwyFaFAa2i/M8pmyhH2cm67PYGOd\n3K26HFzfIsk3JChP3QLx2WaL6qSOGqcUiq4XQIBO0hnogdEmE5Zc6bjvnlRP\nn+CcCrV0zXuoGUYwDBwX/Lwn5zDt2MnKEzBDJtGq40Iofhn/b2BlC7Xnc60w\n/EM1FWxnCoCGFCTnoNUSdt2TPj+BYDToykBN3NlI6YKb0ZoVp2uBZLJWmPcJ\n3s/5oIVDFWsLiYQbUftwehBD9eY5KGkh7MbAmIqB3hW2S25uiDy7CASpcgq8\nmwNSvpWr0oZ3BHIcOtESx4COkqrHczsLnLokdYz97uHxk5YRvViuf4pMnl10\nBvrEz777DEjScQ8R6D3aQZAYP4E2L9ciOAxsbDVJ98e9p/icXUxbkhUnwiRR\nVZpcpECEH7PaDWle7C8Zl+Tn8iZ9YQ+l0R2X9fxdERFT/+of5HpHKm2otn3n\n2nJK44JANh7srObSYElN78kUAaEH+d+C5ImMeOBTOW3AuJfMFoJcRPueOTiI\nyxEkrKNf5DMMbqFYzdgO0875jT8N0BdjYstwm36In65crOJHcrsU6k+70923\nFNAi\r\n=jUvk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf1BTe4/OCDBlTF6W+X6Ujgk0wgBDeNc512HysWBpK4AIhAPTxnrjh9G+obdwwyjOpVVQQKOq7k7SJk5iqQQypXPRf"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-winston3.20180912092138_1536744374136_0.10205876521571988"},"_hasShrinkwrap":false},"1.0.0-winston3.20180912093517":{"name":"@atomist/automation-client","version":"1.0.0-winston3.20180912093517","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"99473fd66a4260506d9dbdcb4e0aab6d8e348e8d","_id":"@atomist/automation-client@1.0.0-winston3.20180912093517","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-idv5c8llhoLkdn/kLFHD5rd+Xh6HFD0zO6jCxsosdsbvO9Sdl5JxAa6hwWXuoGY8JUISUTKVhb/BkRsJXYbnKQ==","shasum":"40b335a1ba53a9c8d5fadb53284b60f03dc29a7f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-winston3.20180912093517.tgz","fileCount":776,"unpackedSize":5275068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmN7dCRA9TVsSAnZWagAAFRsQAJG4LqtVC0a0b7pXkZfS\nAeSpzQb4jWkXfknq+j0OFEFcLqxXJUpyq2tzYcOvB6Rthe028D8uiH3bh/F3\n03u7zg6ykMfoRKOAAUEKgTMbP3LEzJf9bA/qLPT1+TIL32N/HHzlUVyKxczB\n5Z2pSFBzK61sWu4WxVHMGOHo8aWpwUaX6VPtSIor0ByN/zWnoWJ+vQGpfOV8\nynotq3g2vKrqpzRTGZdW4ijItDwRUdrpUv2GYGDttpsNRVlOT+76/pDKeso1\nyKrw1fvxPaFp4SlManisCgWWsjcMT+REwxGggKIcfxRIQbB5GkLr5Jq4ZL9l\nTBMXSvonuCBgEZPZynxSFK4WDmPky60yx/Axq6DBmkSaSZlkQWrhSjMapW6u\nbrdLkv698LzbkybQTMb3Lkd+fuIFn3y5J38mw1xOntVdury0RfcZYaMYdLLv\nWt2NyFQ0x1YZE8pkrrLyx44a4qMjhKgIb0ECuCApLdzNLV8BCkloUhAN1AB5\nIbOoc/ir+8up3k0Lt4p4bhLgT6o4KV83lFycvTVagPjKreWa/QRxT7H9/RVo\n8z/0RQRUP/uG3YZpe3NuIgpPykpb20xMmbS7yIu9XenrPlW7mQdeUQatkyUf\n2S+oGtc3+YxMRkP6pebdYykTO1bbQ8/VUC9PQQKpK86k+f9NPTfmpD2ZukH4\nnMyK\r\n=if4w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUTmyCQvL9jdMZYG3OfAvtHYW9tgssHqWatB9D9/vnYAiEAuK8kAg/kQ6i767qm7qpUpiMiTSblyEfpOxDnyC3vUHQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-winston3.20180912093517_1536745180913_0.3794589828917425"},"_hasShrinkwrap":false},"1.0.0-winston3.20180912095236":{"name":"@atomist/automation-client","version":"1.0.0-winston3.20180912095236","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c04a4ff5f220c9e938cf424f236616658ae5c22f","_id":"@atomist/automation-client@1.0.0-winston3.20180912095236","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KUJ9l/7HU9IqaIZHguVzTQJ4AaY9AEKVhNQLd2zJaokm3Y6BmJto6hFH48/+ecr910XlTL+i7zdN/xLK56I+uA==","shasum":"9bfc77ab0ebc124db04501efb1da43924b85ba09","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-winston3.20180912095236.tgz","fileCount":776,"unpackedSize":5275068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmOLaCRA9TVsSAnZWagAAcZAP/jXqt0iktwVybcjJqjb9\n7BEfQYvYxV307tDWKeYbpQIFttaCFCpZpcxxrXXi/5Sk15leaQ+QqQ0xSycw\nZb9RFtOS+5cNREzsJe6m6fMAwBwX4yfwqS2dSZYnWckdhaNkLxuHNvKvIfN4\nez8Ffwxw8mDKbyNa4USa0uQcij8MU/5j2luup+Bd22N7bm4dX5KRj+yKmg4x\nkuPy7p1fg9Bd7XI4ytYmmpNH34ag/XjOO9M7iwDkFC36gT7tQeKHN0JB9PMK\ndraym6QXjIam6L8346E24Mg35o5jbBWwA927u8bSNe2YlJARY4nArWIKR5w7\nZ4z0e4MzT5LvrIkAyj3jSYH4fWpvPl48hlIUrscvVu0aqtT2Tpgk1ep6GSSr\nJDqsG+hvUh8nQqK5p9vfARzRe2wpuis1tHrxA/z3ccfcGtqU+W8TJNJpJqig\nhwOqLY0QwrK/KnRuQG0MM8Rak3c8QUu57Qtt5/EoJk2Ki2igoZz3UHhrvkFe\nfJsX7RrPvwAo3PID5kY+KDdFD7UyADoWjvHlVi5gO55keXiUWOXr13ksemWg\nNcWWfP8I+lqCPEbUg7uvEMbBYl+G4VOI4YdhXp451voMB79DzQ4/ma5dLHRR\nlAf4rPkM4xdkgNuUJTqyipA13bdScxPdmWWP6FGGBJ/Rmqw5fCfwNoFAesvP\nluix\r\n=ALX7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS+skwNZbNNTOpt294ynjqrUL/EXJgHH7mI0hbF339lwIhAM0rgqRAHmLZRvlTnAbRWWOA7Tc133W8JKdKFa7C4EVy"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-winston3.20180912095236_1536746201496_0.8639391995145083"},"_hasShrinkwrap":false},"1.0.0-winston3.20180912133203":{"name":"@atomist/automation-client","version":"1.0.0-winston3.20180912133203","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1eb30748ed5166596868d64dc8f6ad27da82e824","_id":"@atomist/automation-client@1.0.0-winston3.20180912133203","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tLAI1dR70z3243lcWwRAbQyppyUU2Ps6+bLLwh2LbUA0NS6v36dPZBqQKTXqBtXChWSUaOzpJUPglBezVhb27Q==","shasum":"f7c36f24d8e2e86b3303e1661ad08e02294207fb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-winston3.20180912133203.tgz","fileCount":776,"unpackedSize":5274642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmRZGCRA9TVsSAnZWagAAMmgP/0pQ/TjBfObo2fa/nKhU\nBsa33PbGNJ+R8QgCGVV990Dtktah0DS4D76/rSI/ZDIgwqo8LkF8kF4XK7w+\nuIGTfs1uba5nVx7GANLN1KVFRjx9ioDkujjZxAGQ0+e2cZID38MurYBUpkWB\nAWZb2R/TdrXMUbgEhgWwussGR+vlCV6sNwz5u4w8plt/yb8K390QmUnrC5kH\nbRAuebNp9Hyx1x0nk7H6Oxog78z9AN1N+HEXofbTqD5NJgcGhRovUEWmfOnI\nVlDzvd77mB79MHwS7x/ndMcXpK/+eHTs78jUbzALX4SMQgeX7MQxpiTJ1oyx\nXdP6UlRcHAeafaMe6qkuwYUk4N7Y9fMkrNbuvMwO1lVnKB73gPS21+zPG2IY\naydocSgdHGTc7CNIdMKbK853yATBNT1Z/BKIJMjQOf8aF+CKEUzQGKLu0tro\nS+fuvM8YKkQG7WVn9a7a46lQ6APmwiM0trnLm9fEOrhgz5id7ET4QIP2brhA\n9BAeaguxEjROVY7QNzhXyn4ur/zwHTgz31Fo4yu4/HmC6PzWO7JoCDoWxqDz\nfVl9mXphlT56AU8amTVdJH35PcoaALP8/OxRywdFhDT9WRcwJFwprpcaG4kH\nTRuBaGc1U++Ohdvj1zHKEvh1gxDtzqsHVpjMB7tDMOiO9Et0s45sxntmR4EI\nCles\r\n=u3Lm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkMHkuX37H5gU5YXb27pxGPY9eZam69Og8Wj+hDzHXzAiA2v745h2dpgovLg8PvormkaIe+gd8cM9mxHnw5Vo1FQQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-winston3.20180912133203_1536759365545_0.06054393537674141"},"_hasShrinkwrap":false},"1.0.0-master.20180912152058":{"name":"@atomist/automation-client","version":"1.0.0-master.20180912152058","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/winston":"^2.4.4","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^2.4.3","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f53a7329915df6304d4714a92c60d8a823b8b19b","_id":"@atomist/automation-client@1.0.0-master.20180912152058","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lMFtJdN53VJP3NN4U6HiNq2hfdi78t1fljYqd92oelnPtoOWJRjvrLu7JusZ8zwvCg0rHRKKhb1hQVDSM6Rq5A==","shasum":"a80a6b4bd7a1cc46a07cf20ad66b875d8aef5467","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180912152058.tgz","fileCount":776,"unpackedSize":5269076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmTAjCRA9TVsSAnZWagAAJWcP+wS6YUmlZ0z9brBeObq5\nOmoP+1eYs6JGqaZbxsuOFF9Wj6Ily0I3Erc8fAvuvRqJOBEXF2KvX6Dv6pTQ\nxLcyFWEzSBQ2vH1i3DhrLg6XkCyZztt5Wf7ELoz58vAiz7uhuXkCPw7kk13p\nry1CDVzWVBI0B6TailPV+PpsajrzKwlxNBzsLvhzc2e4IZvZL9QQOh53C4BB\nEiRYAoD0RUu4R4U60mu70ej6FVgW+tyJ8dOO07by7cmA3bdz2Qki7/Gwy5uV\nl7JFeViHDEAPGktjtwih+XfrOLwvdDqwVkTrbouSxvA1rUXQcDjKa5A3dAqS\nATKMVg7yfWVCWtIXJnS41i+fOznoVcOMVuuBonSfRf/kvhJPiIGZSFUYepOR\nKMAik2KN8wNJErli2mYJcpCrKfOEw+BD3IrETLemHbdTchMWrK2zuShXBULK\nEArEUz5ZbeR+r2CM8a1qDY6zSJhW9tQ4GaiD62v/PBvIRV+dTUjMg91mfhA4\nHnEIQv+wfnebThnWQsiB2b2bkfNBULqBtP9SskHSYb457cQ3ZbyAhy/fZjZ1\nd2Jhx+myQJcJH6jOq0RWCWNq4+nR3nN8lLyhIc3pv/aRO3PFcWa6y+4eqvtO\n/M4IE0zgi7KNWTPLkYFge+EyAMEs7vgB39zn0UwSQPQlesZ78+UTPZ8dgHog\nkPR1\r\n=wovD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtfFUftaQRGwemVQM/L9Jc4bcpb4NKGCjsrq0wZHNx0QIgY6J8vnEfQJv4EyvsIlp2giAneVP+8TmjMeTuNgBnkfA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180912152058_1536765987030_0.10097740988867754"},"_hasShrinkwrap":false},"1.0.0-winston3.20180912151525":{"name":"@atomist/automation-client","version":"1.0.0-winston3.20180912151525","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9a708c8efb1a3e43ab579fbc8eef9fea621eb546","_id":"@atomist/automation-client@1.0.0-winston3.20180912151525","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-m5hK0Ztr0Ye06yKcxl8hyr6M97Ch8Uty1kisCOS+K+rYODjNa0A/Mmf8CnH7tdD6H+k322wbT/yUXMXDDoCclw==","shasum":"2500693ffb3be115629570440e193c61b538ae50","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-winston3.20180912151525.tgz","fileCount":776,"unpackedSize":5274382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmTBfCRA9TVsSAnZWagAAP1MP/R1NzasJNQCIo797R8iz\nXC24dgY60ZVqKRZvdUB83eAqkzfMFZF918DEok+FfqZEohHjS//YpcYjp5Gx\nAxfrfQzhc0WBlijK+3MAEqzOg8f8gaOMK9tAV4RQQKFHoBKV0PcDN2DmykCd\nzQRzv47FOXQo1FiAomoTIqmCI+u+7KqpAae/1eOnxzwKzqIkR/3OH9S/u880\n/Lz4wNTkxnOoUXhrLOuIQNKoakeV23UQui4/oE2K25H0XhyIeb3qca0TvI7f\neQR9grTV7F+doFcVCQjgE5Tczj2uPuZ6H4jDbKJMgMGBQ7xogVlQRK7MEJXt\ndQXAaCEL4q00inRf6cJVbas6QaqDA089FGCSMww9UyKcXnP1pLk8A+ehs71o\neMlXgZBVnitJYZ8opfTktiF+vYSlVM9enaV3A17LBFYP3FBjRugB6y7og2Rg\nwd3E4qo1yhFSjPoVLljbdg5JAUqT9K3wCjxA65tN0swgZltSXGFpTg+YDZCb\nvCk+2GcgdUGCb/WDKOJfi7YHRaV6kA1fEy6+6xsSQo35onGzGiKlIK4czGR0\nyG8nHYg2IGo1TjNLwSGxWLZ3SL0+qcHPF2FNfrVeenxj49RXsyASTgbxadE9\nm2md8GmJQNS4PGZUpF9/PzYG0vd/6umt9wxBvM3+UuvtkrZUwQeDzNvYe+qP\nxRgp\r\n=ibPG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5dxnG5luK48gboIR0kI2+MQANwOGLeNF8LH84dy7dYAiAP+ojkaJJDm/cEXI0HVQP6h4bhZg9r5BO/zC8+zAcVXA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-winston3.20180912151525_1536766046543_0.925731835178164"},"_hasShrinkwrap":false},"1.0.0-master.20180912194336":{"name":"@atomist/automation-client","version":"1.0.0-master.20180912194336","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1b54317a6be1baea677eb43c47776177b3805b56","_id":"@atomist/automation-client@1.0.0-master.20180912194336","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-kvq7X3NJB0rSpB2deE0uzXMdPORCNIyr9/qJqPR0C8nbrFTuQuC6+EufbggckOuAkB4Ts8Q8yYCxBcZhWvldZg==","shasum":"5e827d7de348d33237586fcd1607d1688e67875c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180912194336.tgz","fileCount":776,"unpackedSize":5274690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmW1gCRA9TVsSAnZWagAAYhQQAJACfqd/ZN5X3lGrHGHv\nzbsmpxQS0Qm93HvDRQJ+9pts0n/SKHo7rOgxi+7thigc1/7CyUIdcLKEo5JR\nbMVkiY7pRoyxg8BVZYeM3ejej2jIpeBwwD69EGTg5lnDFhgRhjtvTTHLo3F7\nTHrynt3M/xZ0j84llV6Lkbo/eOyqvye5ZiTyqLZWXwAVrNzi8ZVpFklNhsPy\nixyWNLT3afuIb8PtHnVdR51ZCq7wPqaFDU+wgZMyz9S8g3HRR4iBdFnSgKF/\nltk6Q2OMkJ7SyFYh18ItaBVP8FJVg33nSWk/DjBSkAv7bYogRCL5UfJF5OV5\nurcE+OhLNz29gpNxOrm5InKeqquu9RQNtiJw8GgjU/KbHnnL/v7p9RO2KH/R\njvahugMv40FtK4d5cHjU+ERjHnUcLcef+WmSG+twd+t7qQXn84ilY8jukgbA\ngJnlPXKAq1BHl36BE7TuwEmqzTf3Z6W/HL3ZYh1zHKyXwSdOClhdPoAkcW/P\nynX5vD23kM9ckyXYQCnWYkhRSRhJfyIk4gzvVWgpLBID5dJcJe8nUH/zF0su\nuCVlobhfd4Y283GNqdPTkVJ5qZ/s7woxGh97EpvtnBoSgRSNfo69ty2gucLs\nhsdMFQFedYK/ksPfgVqzYtXjYo0TIFkZgIVvQhbputijE09Ex3bVbucp0shX\ny4C3\r\n=f7CO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkDChkxtLdKbgstRtiZSMU0sH6FbwIYADfZE4d4r9n/gIhAOpvDe8xytfjMdfeoTmQl0faQYiUAukT/PEbg2et7S8a"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180912194336_1536781664176_0.1739893303133302"},"_hasShrinkwrap":false},"1.0.0-asyncHooks.20180912213746":{"name":"@atomist/automation-client","version":"1.0.0-asyncHooks.20180912213746","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c8a2b6d694bf9b05d760306db79d6745479d4dda","_id":"@atomist/automation-client@1.0.0-asyncHooks.20180912213746","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7O4bxe8G5cLjzETS9i16fi6+VCvP/GGTAVomjSn89OrG2IKFIJPrexPStBXIGr5r/rvU2ak3jzmk7X1/2G1K7A==","shasum":"d68767922e525e02d3ddbe72a488d935fe31025c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-asyncHooks.20180912213746.tgz","fileCount":776,"unpackedSize":5276674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmYgTCRA9TVsSAnZWagAATeEP/jdWahBAQXZpducwN5G4\nk7XWogBGHZ8i7A09E4+Jd25mZOKActFrLMNQgD+9oPEcfCJ5r+pvXj86V1aC\nRJHFfl2DiiyshOBk7R1M1wIlaumKdNcR7ZpGMSF0KJ6UIpjFgVGtv0kVlLG7\ntdiFhnzrGGfsSMt9xQujhx8qUmf+V54A/p6e6M/MhPbOn9tSrxi0Adhj1+n8\n/P6OrIhTbHrFZAmMmdSUJtXBPzQeECCt2aiaajJSyja6IRqKglYXyVZOLIlM\nz+sqzA2OQvgrSl1KkAQ3M/5C5C0A2obFAQu+jhMPPCwmKeodF9pkP9fU5tK8\n51qDAYNrDrce4X39jssoiqy6BOYPf/ZMSGoNxqNrkgZrKfrpg+1+CK84g125\nINxqwkNF9f1j9hBWP6JNMVDS2zBDi9tJf0uYJRCJKOnl3ZqT8Z8IUGG/h8hm\nlYdTO2XDM9017vfmVrIqWzd+sJeIRs7Q/lsbpko9skoWgjM8zf9F4ZreHtEU\nTey9CjxWCZ2ZGue4cxLI/tVrAPy1z7HJBarH2mhKJoaufryyPLmGF/5vSJa3\nwI+vxLZPcLGzqYjEaDaVNcVaFvfWvAQ+cJ8wMd7pU+4e6TNeqaVlOjMGlm24\n19bgN9iOAQWTqqcvXr6+7eMvIlI8sucEWzYJfbzIxpwI5DaWFbAsuBaGWzza\nazqZ\r\n=DGVU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICt8O60FJIqyrKwx4cgPLXrzT+DZUvks4YuKZt83mJ/eAiEAiI0rmIbxkyOKXaVOKC3/uldQr7BxzcNljm7XAFCvh5s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-asyncHooks.20180912213746_1536788498496_0.9348754743502297"},"_hasShrinkwrap":false},"1.0.0-asyncHooks.20180912223310":{"name":"@atomist/automation-client","version":"1.0.0-asyncHooks.20180912223310","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"eec9999ee8edc4a966b2bf1912853141ff7653aa","_id":"@atomist/automation-client@1.0.0-asyncHooks.20180912223310","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gfpjm7cctj4DC/aAhs7Aj9v787izUMsRXFfH8YFg0DZlAD3TS1vo34tnZoGpGu09bfDDq6479OR7uq8G9AjHNw==","shasum":"4570d9edb8e92b86d6c1aa5601d017258d81f4a6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-asyncHooks.20180912223310.tgz","fileCount":780,"unpackedSize":5277335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmZUJCRA9TVsSAnZWagAAQ9cP/1YC0lxhjamFkrITWIiE\nT/uX5bKYAUi6VyEMcbOTbX886Ssp07sv/doTwq5AFeOkYCHKDgj7snzl7dnS\nkZ1NEKk2oC1EjHxq8oztagBw3O/I2FGOvjr3VzEHh9Kzqq1Oum2hgocAXR+E\n4P+lqnlUCdFW04orxEc/jhRPmsfi8zQhQeZn9bFEPD/U9Zu5aq6Y3Kj38y5y\n7dCe8AF4i4oWkjSPpExXoUzgg/l/pFufAHTK//vQXSS/pqd/hZ7q/V0nBHGy\nXTbFk4k4J5t6KUDZjaQtLiMJtWQ7SYp5s9vHmmmxlCv4YXSWQSOXuVyquXUR\nDiePIGvkdTnN7odIdqohUR2XgUDawsWlitxQZoSn6dvsiTczf/8CbziZaR1U\nrE52erl4sO7mStMS0grmojyuWO0PKjH7HpMbrkPPzNGcCloHGvV4x0+U+Eqa\nOZxx8UIgzwZYGCl2+KNo3S78aYszPLeVFQ6WZS/tmg0UgU4lcIF7/KWR3qiP\noAl2RVQ483HkEfzmR0QhkhLn/XyOy9IAkh0zs9Io350MPo0BGxtpZAOpWqFg\nx5X4lLuvvinz1ryOoS3cv8K4Z5PAcAkuWVjYCSBmmYt7qEXfn4jl4isXG8BY\n2mbhHLvpsKTpKpRmnnoLpq4+Tn2Tcqd3+327CBlJLG647sV6PMSD9H0g5MMF\nYc4j\r\n=lOBq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0nurNm3fBTxwFuNcvyo5PAnCvfNsY5w+BCMxzLXkdBwIhANrXi6I1g3G6I4NhOq/wTOfk2kn/odKQei+ZT8aS+qSe"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-asyncHooks.20180912223310_1536791817124_0.6589584821995955"},"_hasShrinkwrap":false},"1.0.0-cross-spawn-git.20180913011127":{"name":"@atomist/automation-client","version":"1.0.0-cross-spawn-git.20180913011127","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4fa712f9944d09229cba108a2d91b0b2d6343140","_id":"@atomist/automation-client@1.0.0-cross-spawn-git.20180913011127","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nzTr/RQRmMSRB8VoknPi5QrXj3LSlLqh+dUw3s0IDrpSKQUX+i+G5ml5GqZGoMisefoyFpjM5yuT9gu5+vARtw==","shasum":"f578eca7f55e9cd2ff7c109e51dba8381f94d24d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-cross-spawn-git.20180913011127.tgz","fileCount":776,"unpackedSize":5287355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmbo8CRA9TVsSAnZWagAAeCAP/0ZFdZPhhjbSHfb54yO7\no15HbSfZ9z2a4rGxKBEeYzGmBFdLMCBjZJnu1pu2yZHrAiCCpDBDsPGow2Ba\n9gUYHkTWK+fecauPfzV7ZEGoJzVs8LmaDO1w1u0vxeKWK4xaKh3q7R/BvBX6\nxUlAPLxdqZ7hdqRO8CB7uTUBV4VWAu7dbkt3odeyhl/Nw/HaicWV0DgDfIgb\nR9zMHMxy+1/oYGshN4a03L8B4p/TNz+o6w8WXxTnmAxu4OQDInBXnZg6RLdX\ndRaK9HqtJHH9LQfqUJD+3HcZksSVtYEjtiKnFnPijGay9PNVzbiORGB8wbkH\nrIjzFNPhXzJTvYLkJ5RcmkiohlgB3DAwKU7EwSFwXGVIh45kzrJn3zczy93r\nJSn6lW6U5rCGiHHH3VQMbmO+IJYW6BPdoKzErBhiiY0KkwzUIYYzXOOJwosp\nzYranlKvCUxO4VzKdZgHG0cVrGxANQcWFUXNXz8NFS38wKX5KXr9zFQVlUcK\n/X8JZpqf7k4NYpaNxKgK9OmTr1a9yThy7TMOMeZlrMxCUIVkHn2lhcnKELLY\noTp8Nuk/Yx5tBSbH4OoDqGfzYm/XseaVDjAwwO3wWstU+/iB73VcHCSC9MYF\n/MuNOrQuq+avBlIqBexXsi1ZFb8Lxr3A2Kg38Roa3NistXOyyGWCd8VT+gac\npJyD\r\n=XF08\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZUK/yvEZFOKP3lRKQlBh67iICBGK/yfo9RnRxjDuYsAiAZ/cINKuToVP+aXMdym+PxTzI7qu+KnyeZkA/9RwdUUg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-cross-spawn-git.20180913011127_1536801340228_0.17773392700450996"},"_hasShrinkwrap":false},"1.0.0-master.20180913011618":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913011618","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1b54317a6be1baea677eb43c47776177b3805b56","_id":"@atomist/automation-client@1.0.0-master.20180913011618","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-p/yZ52MvClIaEh+3F1B54DniL3YQnZMi/orbOmZ9ZznIKrfi91/JG1W7GnZ3hfFp8kv11QJN0+wfVw5aTPxbAg==","shasum":"ef987ae636bf940cc8824bea08f8b1c81b800c61","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913011618.tgz","fileCount":776,"unpackedSize":5274690,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmbtUCRA9TVsSAnZWagAADZ8P/37p6RHkD5btLzUrS8p3\nSAOmIm5+egC3OfMzj6hN7Jx74EoI5/K73fROtGY8B/dYKMvOXalAMvkyr5nZ\nl/R+aKwxjh5dNLmymTEoKykq9gOFP47qNRh1Z5Dzf1/mjUczHAyUcyy0uzme\nmkwXmdv/qJwMHCh+jXomQSp2mAtSLSBv7IiQDznEbnwhWJtTF2pmRBcsiKQ4\n1IEf4CShIT9c+C+QCgO4W1FuW6Y4VB+Kggaw1iXmO3MOnHA4c/+32SK5vu7O\nNgSaDlRsGseE+a37HBYo8dvyM6bJcv/CxJL1FXCRR7igDNjHMgB9Mz/N1/QA\nf8lv8XE1Pqo97uMVA7jtJhPxaYGdCmKoCi8HZMRJnqHrP7zpQSlgkBxeQvqw\nAO80AVjy/zM5UgQurDAJu6hAK9V/xKOXi9hrtITRjJBJKHtrVEcp6O4NAWQo\nZNtYSp3zSqQ+MRy0bWEvVzDROvlaMG/HfKkKDzLKvSKediZC2sPt0K4zNG14\n/RK+1QsV8WPiXJ+UBfRkmFc/YWvf75oDjl0pyX/ztThw84HHtYJR4ZqnBrga\nQVzPvLUSdoeTJIWBQOjqM3PK6j3uGiF2ADQFCBjaxvC8g7sYidY77yj6utTo\n1JbIhzbA3H6SEqJCDTFvQ4Js6XmqIBXLzifA1pL2ZBkb8nXZSdF1leut/655\nalpo\r\n=xc2n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVUz2Mpt/b9YbCBOmxx002L0P19rBhP0vdruJifcsc1QIhAKcYKdH+zTvozDtscMaXCT/2ukk6Ye5xVT5sl1bY08H7"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913011618_1536801619340_0.9303418083139083"},"_hasShrinkwrap":false},"1.0.0-cross-spawn-git.20180913011840":{"name":"@atomist/automation-client","version":"1.0.0-cross-spawn-git.20180913011840","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"^0.1.9","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4fa712f9944d09229cba108a2d91b0b2d6343140","_id":"@atomist/automation-client@1.0.0-cross-spawn-git.20180913011840","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Sm6dsqDMMAt+SKzvNu+eSxCx6bhIyRH8i+IOmPGjnMOQUsND8876o8imWzjpomrrNDOnu1I3fz4nxbdEqkH0dQ==","shasum":"04c4369e85c78d13cb72a89240f28f80c91a7ddf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-cross-spawn-git.20180913011840.tgz","fileCount":776,"unpackedSize":5287355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmbvzCRA9TVsSAnZWagAAAxQP/3LVk9mXyeqbNTrPI2WT\nxYummFlVJZtWx9143s7VoKgYEyh9dZoeVgBQ3+0LHILdhiPgDetCPmFKFKmb\nvvfuinPLZ7bxJaIfKddlAD2Gff0/AK09CZq4YPsTrzmnkN7ZO4nh5p2EQSLM\n1OLB31Rs8zeNLVBOhhlvZt3FznNAK9V9kimMArThBkqUFrTCQMvqBmW4UaRg\nf+wLQfdW0zCt8H5bnGgWe38EAaHVxCYX/yvKyyX2pL8EgnWfcFY0dFYKyduC\njvbBdXp3cTeJVczP6+gkUOImKNoxYC7pHtaHGE7lLptpaHzRAc+CKARrofsZ\ntnBZ5oXTJTltedPgkGEJVycjnQU5QmOOefn1bPgFihanxQnosS0SUDPXb1xt\njI9ET/+poKWWa6q9qRb+3Sqkw3bhKkQ5CSrAV9pphz67YeaBpodMBsNJhd48\nTum10qqusV35UDigalhbRN/hEfY10jMIr0o+bC8tqOzVROWyP5PzJy0Zzw5V\naatWFTOgNytfJ5BCXHX8O+g+M92MCO8xQPKNxjISLKzjxd+s0zWXhJkAfIdU\nGw/81PNcwiQGbp/TmS/njuZHT7rofRgEoxXzHTqMr2VS+W3L2hKpO8wzA29d\n93KzPY6bzjoTv9CPQDLxG0wlBSE0DqgVuHfgk+pq2X8toM8NOVxug2X607sT\nLL4M\r\n=aEzr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1UurFuw+ESCD0m9HDTJuXp/ONPTe2VFSozu+ICiMSYAiALw3p6fp0exSPci/8ScKQe4OocD43vAy6tsPaifg/Esg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-cross-spawn-git.20180913011840_1536801778751_0.0948443364188476"},"_hasShrinkwrap":false},"1.0.0-tree-path-upgrade.20180913022125":{"name":"@atomist/automation-client","version":"1.0.0-tree-path-upgrade.20180913022125","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/1089073149","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"110e9613034f495e88c0c7a926323b4adabbc3cf","_id":"@atomist/automation-client@1.0.0-tree-path-upgrade.20180913022125","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-aXUUJi4qW4qPV+6JtiDmHeXGJLJfig9IJ3/Qhw+QdCxf8YHWzDiCwnTE1T8iHtNrO5qEgl2hzR3HX1I6//WdhA==","shasum":"ec07ad669922373f4fcfcb463385b313a53c9a29","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-tree-path-upgrade.20180913022125.tgz","fileCount":776,"unpackedSize":5273574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmcqrCRA9TVsSAnZWagAAvNQP/2SIc6e/t18yOgjN95q9\nB9v9Lr79HLkWLHR6w5cW7T9qUN4gSx3jllOvu9eek2BruSJ5gvPW7CP5YAdg\n7kt20hZPQ3rC+Dv8Mi8+EWZ40oohLfxiwRc3ZtsSX3AycS/AOX59aNeb08RT\nYcd13E5GgNQKXFUdwGh/gaOUYvkNQaKL2D1hUmBtb75nqXD8Uwm3I4mYrJUy\nKBPMc7KPIcuk9ymMuT6q9rBGWqmz6ihIO2deX4I14YClO5pcrljqTXQ+KSug\ncG32vkpHGjgvKnmWeN3WtsjylZqgHLHjKKWa5vkLsc/i3gFflsF4irqbOiY/\n1iaIpxOf536Fq0kbxKFNBV+sNxJLjQ66CMrkSrhx1pp8W/aEow/6DiOOWEl6\nHAFv/xaQNmdkH18wy5tdD0yKpLIBzup/3srcIShSKWjVu/4MymG+iBGriTxJ\noAwQrJFn4rtqdLUVy9/hoanNTJzY/HKDCdYY3khn43dD2NSCocWG3S9JDM72\nmzLzXZ3UQ8iy1R3uA3I2YCPpx3pHub1unRwqd1x0/xfxqgz4gOXYSKCjEP6h\nIjGC/i9DSFkPc6Q4lmL4GRp0Irhf61ZjEo90WSzyYvablRry4cgDdkMaPPBs\n+sftM5KoDhBhLyuBykyq/WwRVNysGGdAN6U8lsbjS5X4ZS9V/xmc+cbo5D+Q\nT2gY\r\n=OExh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLTbw6NNvQSYb77zAk4Fmgc3SADNNB8LHwSkGu/tR71wIgTExzQuUj/X8wVA5qZdL6KqEFWnOy/NPpTEuRkuZ+NCg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-tree-path-upgrade.20180913022125_1536805546870_0.5244591604312017"},"_hasShrinkwrap":false},"1.0.0-master.20180913030848":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913030848","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/1089073149","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6ee45f7ae351cba11ae7c06e0dfad663eedc10d3","_id":"@atomist/automation-client@1.0.0-master.20180913030848","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/BwqjHhXa1U8+4Dby+dRVN2yN8VuftBoMMaLRcXT0YpH5So6HMa0ui7kE6nFnbzCI0eOjvOfLSmeHAqU7vCZ4w==","shasum":"5006aa9d3e27270b5152801f687c0c80a7d5983f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913030848.tgz","fileCount":776,"unpackedSize":5273661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmdW8CRA9TVsSAnZWagAAeoMQAIw3sHJ4bzDvin2BkOg7\nJBBW/+Pmw9bLZdIk0M0P8y8/pVz/eHRL6alxwHeNtBNcKpdAW1U/fZ3lO1OT\nvay7J1I7LYrNA+Z0ywIViXM8lpRRPhnXor2RLDm1esZEVQItatE8A0t6e46Z\nblZ1HDHdrz5MfMorqZUf6pG79BMferj+RAWRX9K1YFPcQb+UIxI9Os2k+pQX\ngaXPoAe3y4Tk5bt76d+DIzCP2CAdSDreJYyNJjTgkTzlItpkwQcmhAwm17sY\nED8LDas/nqTtzM1uM3a3YhNJTyXzQVZ7GJNSSNbjVg6Hlp9O3fxfl9usbi6L\n2gNaAXspOpPD8qDoX8YYKYCHzEEjEmBG2DFm3e4/C6QI878I5IzaQk5FjgT7\nj4RzcKWu1hPa7vOKowcdznLFLTLSIJV9Ai7k3fxMruv/RvW5YqmqiPdsnqY9\nLBP/YQ6/+bccDzY2h8n7oMRkkmKd0Rzn6Nbe+BFJupq5l8v46X56f0fs1vKI\nC65kaRXYbLwc2tg+JXDgOs9G0Qlgtx+ko2G74mt9pInHSVCbiYwGNgWgEjM5\nW9gt8wI7t7SqQzY87Xz4l8Y8ldrvh6wO4eJM9BqQ7a7OyMV82MBfrE4+7vkM\n6GMW6j0A8tPysP/gP+uPJumrVrA3BXmW5cYCixkItyv1svRnqR5zf7UwdjN9\nGiRd\r\n=abo1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCw0dwtqZiKIG8mW15XLLzzdmNJeopLfxnLokyEmcD4/AIhAO6uav591PUwb+OCAZngrg+569x68Z4LxGWKdBNiy8nN"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913030848_1536808374888_0.38944721294425366"},"_hasShrinkwrap":false},"1.0.0-master.20180913034607":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913034607","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/2838135010","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"150eae6afa79798c129a0e18d06e69de730012d0","_id":"@atomist/automation-client@1.0.0-master.20180913034607","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-NqHn7G7RnooWH2xPP75Zf7cG+Dc97Utjl00Jl9jmgaxEMSQtTobdZIfwY52f6AsnD1gJIOzJw+pS9ZsTSzYH3A==","shasum":"430109199fd3f36da20e91abb662e81831c661f7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913034607.tgz","fileCount":776,"unpackedSize":5275407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmd6RCRA9TVsSAnZWagAA4jYP+wRe4JF1FDxFQv0xnt1r\nNjyudWbaVQh1jx9GsKucCLmVB6soGGylMhZykYgY5YovO09Qia3HUf5xIhUJ\n7FNlCMZjwmKQILyPI3MUzYtht73n3nqEA3Fr8kDUA5ulldfTK5l6LdUKKcEP\nU/m+G0FxkJG03ffIb1sMYc+8+K6eGt7hb0DkwhSadYTVXpkt09qvquJOBzwQ\nzFv93QAxbRAHSSsQSu2pCtWW9F6n4dgiLUtOzwx0pmMTcVcwpBMziwAmNXDs\nCIL1pUMIktca8CGTvO6yGvlERWgItxN3QqxYEQFYJpkD2gN1KLYaIicaGicb\nYx9/CG7dLldDrTYn4iiempmmNk4BDQ5PEChZILe5jeBwbzuMrcx5m172d9W8\nj1zC1LYBj4XdXPF1H9MuCc+nDBosSY9o2aREDIFaGLQKDyLWbanH0uQHvqQ6\n3g6TqO+J8eBzLd9HFnaH5Et27bnJsvYVOodEPkfrTGcZNwQ+IomCPpJH6HK6\nYHOHKj8ut0pkifmv0R9332e0mJyRQBjLVJrXoqO4dpltBMBGClv1UQa0Z0o+\nSseNraAj89YsK6mFX4K5/zpRc7QEbn1VFRjlU+QeYyFeKE4Itkpb9eNaB8gL\nf0YTTUblUrx6aj5M9s0bnts+IxNIaRv0wiHd0pwivQLET7xYwpX3llAx1b2r\nvywr\r\n=2aST\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGv3/ZZY2N5NytoJqB+qxF6XRFVJL/10VFsPICY9Q4S0AiBiYoiopUVr3m19uVYFJdYZ7JO5a12AG3H42f9//ZHICw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913034607_1536810640960_0.835342100069216"},"_hasShrinkwrap":false},"1.0.0-master.20180913035245":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913035245","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/2838135010","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5f1abe82f1efb6c94f438548939a7d4b139844a7","_id":"@atomist/automation-client@1.0.0-master.20180913035245","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sfjFg9g0PLNteOdd5qe3x4WI3OqW9c03MgamH5yiJl0Sg/puSw97cEsj5/nZHSJwVlLHS8u5BX6xoJVuLjuMSA==","shasum":"894e8982e4de632c46349918733b7a9a39100ba3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913035245.tgz","fileCount":776,"unpackedSize":5275877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmeBvCRA9TVsSAnZWagAA/s8P/iQTUCECclferv/ez0nU\nP/dbJb37jXcq6poqC3PjNizS9tEyJZ1aSZZ5V1UDsqeK6QwDX+CHL+bXpF7d\nebVT9AN1F31XXff6NU18W0Gs/wUHDPofR60ko1ZP0wmFw/1qQlk9zkG0DCKP\nSit+s6vgOdhK8j25nVh/NbUBmD60EhHiIbtGa/Uwrm+waP6LQFJ2ZXtAjpQ+\nFOAgcB9G7+Qo8JsDvjsHCQfx7Gpa0n0LBL73hWqz9ptxqKK1m+H4wXFDViP4\ndAYjx+W8O7DBv3akb2ebo95SjUgxggvlsdeBrvGbJkIgjeOQs63n4IlsdTqp\nV/Jbkt75RDygp1Oapa55iuq/xBtiSL2NNtjIpQ7AyuoTkuce/Ep/D1U6fNWX\niKrGx4pDK/s7lmkOUyZ0fyzWy2Tye4MEDS8UcOg5iqr7HfXfa4eKwIAu8Dh6\nsf1CfWXjVvWELBt1HCp3GZkKS6aChVSozt8c5s1hE1N503Ryzi0r4UcMqUPh\nRFRDgWy4OLkoXNytfhrXQ/aFord+LlaxE2IQlxCrcWa95V6Tb231CMFakngo\naaqn08HuZDRjVAoc0dULupDEjrM77nuWcWle7HXgbMvUNDURiIsBiRDqPYkE\nil7S/I4HiC93m+99iFjSgUjL+Ku7dzuf+YspuyJDFM8BHUQo1kXDs4tTV1TW\n1VMu\r\n=fWWR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBcoyIoz+6aP5oB+VirKKGKKcdE8rh3C6YLc31QQ963MAiEA+mrALP2htnXCgkBTZTxeJ8yQ9UanCd4eJvHBWg2YkRQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913035245_1536811119108_0.43885774807081335"},"_hasShrinkwrap":false},"1.0.0-master.20180913071451":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913071451","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/2838135010","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"58763396d304feac6b5a422d058251ff047475fd","_id":"@atomist/automation-client@1.0.0-master.20180913071451","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dfBYvhgKXPcDo5LACIJsqQBZXNUmvG/LIiZJNq56KGLvw1GSEWWM7REuA64h7FywKOr5xdOAEbyNgAhEakptDA==","shasum":"4bbcfb400df772fadf34a0e3dbe36c8c2c2e5357","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913071451.tgz","fileCount":776,"unpackedSize":5288650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmg9bCRA9TVsSAnZWagAAIJwQAJHaNJoI1j4EpOfVCyS1\nGQTtknazj9AXawQVRRxFQXUtPoX87PDJTP/SpwNuXd5GQNNF1eTg4ihItikI\ny44zJGGWhQR6z/NlA/VetftXhk2ECAANrvRzlbPngBQDM4wO1hHfcwAqPGiI\nR6SiUuo8V+gD1ovbo6sYgArwZw9QkPlGd3e5cmFUNgJGILyXGNpmt2SU3B2S\nFMfIZwh+u/LEi3CgDPZs6lXidoHqZUOHLL2G6l5RRirZCV9qU88XFA/AusxJ\n+HrnYAEKHDoFRg+jvoy51uiEBSbOT2YtT+8KJml5Q7UWWGwNaFOqjq4Z8PeO\n8aBwRdK7jicw/yIqBY0G1rKFQOpM7fUTntg0I1gFkEbgMMGCscx1q50vOTaZ\nuIBknGcjcbnYSzJvdhiZjBqeO/srU9bG04GYpWLcnCMYZsoDlABDmCdgjhYB\nyUNBTCSHF1VVWHO5LMG84hJIt6IQ21foptCzyDmor7OqvO7Gim+z7kHK54T2\njjVLbDCvhexRxMovjVtAFsYM5hHJSy0yn06PXuqnfnzFaID3kufCpS4ExKp5\n+BosS2NaoeEQgLHHUUu/ayJCWPO13catQNN/UCbF3tOa+Se+hFE8SKkEC1Zm\nmmK04e2a/PX4wqBDp1kppWZPhdq9ymEiYY84m2tpp9URFDAYFZYKRfYaNCam\nh3gu\r\n=rwv2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGIGzyN6KgHJP/2gsOWS+1nrDtWyypAggL1we1IGzAgAiEAwJ0a0grfLDm/fyQw7uxqlNWfQOZgrN6c6+eP0+vKl6g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913071451_1536823131263_0.9190350269238596"},"_hasShrinkwrap":false},"1.0.0-master.20180913093131":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913093131","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/2838135010","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4a821ccae87b711756554f2ffe7b16a1cfd92d9a","_id":"@atomist/automation-client@1.0.0-master.20180913093131","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hxM5qDj2S0zqyr7KHkNmu0jFyyyKFCOL+Di0JmenFwWMT75md41QhMMFEMrECQVZZiZBWucoz4AL44Prya/1kw==","shasum":"f61a1c81b42a3ab96e6eebcbbd821f545c39bde8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913093131.tgz","fileCount":776,"unpackedSize":5289385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmi/dCRA9TVsSAnZWagAAktEP/2KsmASA64IZcZwBq69j\n1sCJoRlvN6MdpEbWd5LfiCurVsYZkuR+bjUfjLs4YHobhT7wbOSi42aV8RHr\nT2uD9gdPP+fyNUtNMS8atO/IooW5iziy//aONJ1WQ826TbfQN0NCVGlTt/7L\nZz+9lU5vzHSjzrB6WtHGTmLdaS/K6bmiijcdmqrLPjFnG4lr7MG6PzNfPMro\nZrncJ056hGMxlgM3p2HaIvl0iFVCpEe90y0rXawTLFgjS6wqMcXTYXOm4Rpo\nqqioHRQHfraXdhnvU2yPF+cVeOJF4m61YY5+YotfOiHXP7uN/RpS51hMGG5I\nlLgWXu6IOeyg0PzxMTyiTFbB4bI2ra/V/sPCvZVkYvRzD0GtVz4kbE/KDBL1\ntq6vyVy3mE0KxkfXgEBFQ8XD24z5tTc5pSEKtpBl/lg3CI6032bIlSbLzhiC\nLirUwREBXRlhHVs5sq4ddTuyQ6bzItkK7DRcqmMbI1vimnU8g6PSUOUsmTLK\nAj+Hdox/4aJs3QLOgfixnxyfj8oxHVP0uEu89lQEw7ywiOnKJyoWOcqG+kWD\niTPLsVLLUIxRiVLx+yzk/3RxRRNpQgiHLxS5T95NJM9cgDDfb3O+cZhjSnHG\ndbBVsJ5SsjxfRSM54T1DerDV/oqC4iVcHUISoqTZshIYZimdMUJvcdd5rGBN\nhp/R\r\n=Z6q8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBprQcOCNBCeqpNuBXIjJv0B98akSR2PqSIj8mu8GJBwIhAOlrYKORlfyHgYrHNnmZM5Yw3dR/l8pNLMCK4leFuRRh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913093131_1536831452123_0.12684202597260708"},"_hasShrinkwrap":false},"1.0.0-asyncHooks.20180913093353":{"name":"@atomist/automation-client","version":"1.0.0-asyncHooks.20180913093353","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"^0.8.1","@atomist/slack-messages":"^0.12.1","@atomist/tree-path":"https://r.atomist.com/2838135010","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8e7564fd4ae55824cfad504873e8ae5e9b3a408d","_id":"@atomist/automation-client@1.0.0-asyncHooks.20180913093353","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+3OvxdEPVJElo920BgrPSiOqXc6PEiZ0bF5toYgRzSNXeItoz0nP6JWj2F5U922NIsxQCvyl4G0zI2hlYX1bQw==","shasum":"85cc9176f3b21e2e4e643bcd5bfb72760dc51015","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-asyncHooks.20180913093353.tgz","fileCount":780,"unpackedSize":5292030,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmjAYCRA9TVsSAnZWagAAJPMQAJ1wAvCC1COAeh1PNP8t\nMITEKYXpYY2M1xlsqm1bifMyXZiRVhLjC/GTgQm82PBIPBHndec+LKYacDoS\nVnBVc3CbAU4WqA381Gd/rpD0X+3nwpVKPJSZR6fdIO2jOW1oOI80iaw+8LT+\ncXqXAYPdDUBxSO7NPYJ8Z13FAn36whqrvG7zHPvDToqijNpTztkynDERiBMW\nIagWlIa/F1ob+j5jzkGJIIET7uvhA2RvM/zwleO+xogoofMUawua9APPSk/D\nu3pOzz992uvdUxmXghceGGe47Ftj0d9ku/asVMPBFdOqAnlstSzuSQk/6uih\nv2Ad1zFTXJ8jxnkEqu7R4R0elw+Y9n3+mKL/D53EXAp68Y6B2TL5PlouaVzj\nBrkZA8bJcsHSPIHjJZAcV1vwMpyQIHvGhE9dExhNZFZavIlfl4HNiigBIBCd\nYQMuSo+fcoDVbg++MzuLlY3ytuK1guK9mouombwTOhlBb6c963P2Ru+QbEV/\nN3uq+2vU7rdrTK5kefq+hekrCj+MyMoax3LzKRaTRGtazxp7RNv+vo1smPHe\nRyg/N7iL3cANdJefAgMSVXPjc5+6a3yKTzU4ksxi5uoEffl7ipw4e+dmm7Ub\nOxdLDhV+Q4xSRB3pBpTCLywtf3snMszlpUggnzmDxFAHI5zG06Y4iuiRyBI+\nXNXn\r\n=IiAn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy1cd28+I9kbjACo9T6jU+9nVan9O6oH0r+OxyjIH3AAIhAP67OBvPFiA/1d5M263bVq0pq8v9oksNZUkL4+i5uer1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-asyncHooks.20180913093353_1536831512065_0.05859811394033332"},"_hasShrinkwrap":false},"1.0.0-atomist-update-branch-master-1536840297926.20180913122335":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-branch-master-1536840297926.20180913122335","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c04d3a8537edbcd21a819c131121f334d9552bae","_id":"@atomist/automation-client@1.0.0-atomist-update-branch-master-1536840297926.20180913122335","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HvErwjFNpSlsl+vt5d32jZ+9iZ2HmlDExVLJT5df+uY4LLjxGgHo8u0GrNFO9+/0yL/ms3H+sOV5g3jBfmt2Fw==","shasum":"39118bdeb51de20ff37ed0ed14160ef707d6bce1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-branch-master-1536840297926.20180913122335.tgz","fileCount":776,"unpackedSize":5289374,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmlfFCRA9TVsSAnZWagAAi34P+wckW8UAe+tSRMiTTRmJ\nt/38cCjt6EouLMj/9hpA+LxMgVAgRNQftWopb8MMHC2i8Hd7s59l9qbBnOCM\nSaaT0UR12XKhW0R8agvmAUIbTsliBQZIWsT0BoLMx/Mll3ClMXOq6h3vhf2d\n8GeQajEjXm9A87Z0mv+goJf+wmEXghBFeui3m9EFfaqwAOV1cc5ukAsJGfb8\nk4bmbd6OczOwpWO5e+esWpgsaduDbtGMl6no+UzGXBe2MqDvFNFjNmeZ29yX\nQOa7ERc8P6wwNRrZsUZ3mB2y5mndJQJ79yyjmHNn3DqkG0Z8NNUGu967PDNc\nXG8iPAZcjrktFBeh56JkW2aUFPNsPJ3VmFnKL9iF8dD4/jOIgOyrBJ0D5TjF\ndP1VfQ5U/8rKsQ33TV3kesUkBr2IIH3XNZ1JT9ErmkSB6eTQB8q121yEnpGE\nQCZRZXfZoE8x7MEGa0g1JD5QuaLgGvTC6m54O04ogD3Wz3/6829NNLXoMuac\n322B31QJsQSxjmUockXZypwG5RKh3ONvPwbCTrAMkk8P5DM/BBRVvCwXXnrX\nKvHt4a/tbe6rVM/clM31ff5kgRfE4tn/WU6QVltYjvwGJsS0RLkYOwYP9nLH\nRvLMtfJ9Y+XAVSR/WaRAfJFLVgeNgEns4kKGbBTV+4AJ9O/a0P7kghe17QRF\nBLl4\r\n=LfKG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFc8nnvHg+JlqSehKvysBQmy3QsqtJoMfQn3f3dIpgbFAiEAuNNNPXWJ54iHSjC8xn58heYpb4uaDc1XGCYIDZRUyT4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-branch-master-1536840297926.20180913122335_1536841668816_0.3335854794399924"},"_hasShrinkwrap":false},"1.0.0-master.20180913124508":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913124508","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"76443aea8038e516d59aa00e23e8b42216675349","_id":"@atomist/automation-client@1.0.0-master.20180913124508","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HaFc8snrwDkShk826iTaYtMo4HB9R0N0Jyc4yGTf/KJ27+oVii3kJC9YVcUmM7krx0h6hw/gKSTxqAsGz022Sg==","shasum":"8969099578331d05d02b8d28b1b39a1f09dd9754","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913124508.tgz","fileCount":777,"unpackedSize":5329573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmlymCRA9TVsSAnZWagAABccQAIwj62xBcGRqUaWWNQ3F\nZ6m2eTCpE4rfguwrW87zcDckqwMuxrKbYwf4tRCJyRpFkvZT9W821N8SdvVj\nspbw3PEGLHeg7yp8aAKKmx9/kD83Ws233gcRbNFIEZd/mpMIVqTEhIBn3kNo\nEBSUzQWCAsYlro1CiMR/JnRr5KjnihI0KDiij+VIrlck5ZtvCmRFXUzjY4Vg\n3TKZtRgQ934E0gPOz8zqWr628OirZdFNerPqE7dxsftFdCU06EIS+9Co5EBa\nql2GxLXJ7aW9obVkRNhB6Dcp5Tu0Rtpm941/7tyDsIbZXrDV1JR1WYzOB4NS\nejqquCb86uwI4ASbeTpUGb5Yk0BhHo19GELiwvqlyuYeXlTd9+NVwai3UmLU\ns86SMc/hF4l2PmvzUlp3PVW7QV26u4Bedq+Hc8mWKLmJiZO+2E4wp0sqU2YT\nJoKXr2oHzpFx14zw5gjv47dlkfJC9tzUx3BcnEju5+KehPxnZo2ZjIaDu4by\nDYejag4oYPBV4pxaUqnUpn/BxnOWWknu3MTN6XAHq9wZ89/FTfJVx1JdFt3b\ndfZcYqy3cmm8RDKz06obTWVCGuL8hgFC9uhyJk0ZDhUtMAAES/ckzjQZKAeT\nkj8fYm02FScDwzIg4sH3jnSc40NnOtrNl48RtjcBGSLwFRjALCHBBJc3JuV5\nmUyR\r\n=0qpt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjsFUutrg9V73ayOUmNxJyuBOngxUhLyFRsnHeK5W2XQIhAI23Ez4C1JtNEGucn8Sicxzg1yF+xwNmApG3U2QM0Z0E"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913124508_1536842917798_0.8624849020980887"},"_hasShrinkwrap":false},"1.0.0-atomist-update-branch-master-1536840297926.20180913131245":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-branch-master-1536840297926.20180913131245","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:doc clean:run","clean:benchmark":"rimraf isolate-*-v8.log","clean:compile":"rimraf git-info.json \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{lib,test}/**/*.js\"","clean:npm":"rimraf node_modules","clean:doc":"rimraf doc","clean:run":"rimraf *-v8.log profile.txt log","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION lib/bin/start.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dbccb569fef8638c37eb493d576d400c588cf791","_id":"@atomist/automation-client@1.0.0-atomist-update-branch-master-1536840297926.20180913131245","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/GKjlbtQEmlYcwOeGzaJnQgbDNTS64p1ACHcUsmY0GXyuKldKqODj8rkh0Eca0khv1CTRanG+T74pAOu3PLsTA==","shasum":"cf21dfada7d8077d0e1e2bbfa32570d9e4d4992c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-branch-master-1536840297926.20180913131245.tgz","fileCount":588,"unpackedSize":5129832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmmMACRA9TVsSAnZWagAAHxAQAJhEfzNaBeSHuFsBZMS2\nkTnQsWVNtbcVMxsqM4tm7fj/regGfmHYpycCQlMI2IQA3NMUq5jbtwpOYNDp\n/DCAFrHDFYfc+ZUft1cWsIU0Elx5ecut70WAIL6YJUiRJOxUS+I2qq50UbN8\n1uNQNrDLkq78/QJoS+FuVC938ftJojf0LMFIIps3gJ5MSPuB3P//3WXl+neT\n+Lrw4z11bvpVOoFLLqycsZn2MDfU6nXLOm02vjTwrq6vKERX9CtCzWrJwbkR\nQirRteHcWB+PBhtzSzEzIOY0EegZfFsLgm5Tb/eJ0NeKu/A7ULHSogVELLQC\nhsK0Dk/QKujaAA+qqJQTbI/tCWyps/nZET3g2bw1Nmk6TfUPfAt0Hj2oAWIV\nCDG3xHVSf+U0VjpyOxFkOXgbPfU5JKaD94EUTg53p84fsMw4YmnDAkIohkyg\nqzE+e2fd4OoViMy07EGGnx3AvRMKOSeYK1y2eUiNKlt+hvW2Jm9PO/qyiHv7\ncx/+8wCw25mXUGAgSwT9Zucl/TzviyfqYmV1HKErckNn6CWNs3XWRn1zB/BK\n/IWUXDs8+dpkgAmo67PRJZIbc7nC9oTYp+oxLdnHaGKm6Bw98U9DZ7AGwBTY\nJFCSZ7shzrDYkzWQAPCPHotaRI7b/g1hrrrLmHqwCKokX2Z2swiT9bTfrJwX\nrJE+\r\n=w19w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk0ztBsPrH+4S1ngejNul/27Lu/IeeQIfsnAUJNQzNMAiEA/y26FFOP1wZLJtbsnGnVNLAQHiri2BfgiPvQuwf/pZc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-branch-master-1536840297926.20180913131245_1536844543901_0.99344490313925"},"_hasShrinkwrap":false},"1.0.0-atomist-update-branch-master-1536840297926.20180913132055":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-branch-master-1536840297926.20180913132055","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:doc clean:run","clean:benchmark":"rimraf isolate-*-v8.log","clean:compile":"rimraf git-info.json \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{lib,test}/**/*.js\"","clean:npm":"rimraf node_modules","clean:doc":"rimraf doc","clean:run":"rimraf *-v8.log profile.txt log","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION lib/bin/start.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e4870ac2d43379da0ab28125365a2ac957cdbd96","_id":"@atomist/automation-client@1.0.0-atomist-update-branch-master-1536840297926.20180913132055","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3b0TwxK04uRx9XAKI5D1R06DTm9KtyTcGe7Y5SCNEX1KlvALw1xWgQuckDkCh4w/AcSTIQUeCVNI7OYrwDNGCA==","shasum":"04a3717520a0a15bff0fc9cf8f5334869fb220f4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-branch-master-1536840297926.20180913132055.tgz","fileCount":588,"unpackedSize":5129875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmmTZCRA9TVsSAnZWagAAgWEQAIhRwCJaGk059yBunAJ7\nAnWe23di55fPquFmer/jd6hsYFC11LkiyuMnmY13GXN2Ma823JN+mcSBa4Zw\nznZU5kXB8RVwq19uIQwFiApelg/5NAMljFf2wdajfB3bgqro2cWeDuePNdA6\n8BaYcogwccDhnk0kMe1IVX4OlTATZ6IOJjGPf+342YpTB1Tlq1EjpqIp7nV4\neiNKufzxHjOyeQzi4rML7wqE8sBQanQszflw7YkmLuAd/rJijdTHVi1P612f\nRMnYmAbwch2ojQBJfge8HnHjA74BY2gdq4HE/XP9KB14IWyr71otSvpQ4Jxf\nN5WNFUEB5OjlDymEVw8JrvK6G/w0IaDxE8ncAuNmOQBCwD4Dtri3x5Dlg8IH\n+hshsVbmzkpflnNs22KUbby/JSlvwV1lwQ9Q7+8Z1uO5gId2S/K31xSwuHkW\nqV6aLlSkc5LCjbjDjLhGYO1rIFkRyGGV2zseFSE3X6HAbybMNdGb5GANCAf7\nEMUcdxyWLY9bgBNbU9NLElosnB9VLDOoPBdLcNwi0C7VX43eN81V6+m7EyoX\nFQyQx+OaNOtaOkx/7ce5lvfMw/LHJGiIvZHIzeIoXDHaadh6R+kw2nkHhXHB\nA5ndODMflmJDyWmUEJqYTwWceXUNMsDFPaP9nSCBm4n+iOAO9Wf0tjDaAxjs\nrqns\r\n=1TMv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAL8tK0qf4k0P2/EU6VW990JM7P/H85qlPjxekJTi8owAiB4vz+xSf3HHixIk33PI6FMPMNUnMJiI8AdEIL3fw7/nA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-branch-master-1536840297926.20180913132055_1536845016473_0.4827583160328708"},"_hasShrinkwrap":false},"1.0.0-master.20180913132923":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913132923","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:doc clean:run","clean:benchmark":"rimraf isolate-*-v8.log","clean:compile":"rimraf git-info.json \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{lib,test}/**/*.js\"","clean:npm":"rimraf node_modules","clean:doc":"rimraf doc","clean:run":"rimraf *-v8.log profile.txt log","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION lib/bin/start.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3eee0cf3ad00b36becfbe243af54ec534e93a7f9","_id":"@atomist/automation-client@1.0.0-master.20180913132923","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-X1mm6OLp6w60hSbTNJJCBqHYghYtz1BMzHHgZlkIP51iuyGRvle2zSUSdfiIl42oktVQsuoqN8cfqRt+0XlwJA==","shasum":"29c03802f6d894812d58d031fd8f6d139ceb8ebc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913132923.tgz","fileCount":588,"unpackedSize":5130304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmmbnCRA9TVsSAnZWagAAIZIP/j3jaT3E+4C6TGkOBBb6\nvp8V4VI7gU0zzdyJ30NN8mrT/lPGoPa8onhVCeWiGGkgmyfhRecDe8MV/MFK\nLI397hCENO2Mci2Q5+8hixIjsAtq1L7BrNI+LrLwppS1gMDamWWHuDX7ZDJu\nbKFcycSu0KD5d29oddXnthTsnHKbbTRvT0NFFGlWzyfJ4ixx1hotOCZRNIUl\nCSOGmqzlkXgt3sXPYXI7KT98cRULbAQxMnlwp/1F4kbuRI513d7ISdKFMmvU\nSxGRANw/u5VpmV+vwQ3K8U0+QHxonopxngAcw1MEnoiKGNrGT9AK2BnNevvm\n0jllp/wq/+NPeQwhc4wRXn/iVfQvhc7yFGTKatf+Y6ZokGELS5SUJw7PjO0q\njVyLM0g7qThlhqX3hLBiGuWTQrxBkMoJVnM0iimdaDCirI9De0MuscH5OT1g\ndSWhKo1S38J1JMldpphcb490HCOswFgOql3kQOe9Jwemt2086qRks6inxgKh\nCUeKgLb+Azmc40X9QOhIgMRtZOEewohY0f6o1B4+STZeqqI/PSwrXCePQLAw\npf2QRl9Ad6+TWmiGItesAkcTJGqhooAspsICarwARp9GMM/z98vmGqqa9Y29\njowawUqJ9nvRj5sT4sYDrJGrBDyWPar9zqtOB1cr1XKWQwnwxCdgGsTGWCeq\nMI20\r\n=Jn22\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBq2qlxwSxzh4PNiaU/OznVUpE+s97ug44csaKq0oqCVAiEA64Uj7KPA/4rSmJV9QhFZdbBLGlCdfiSS3odbcs7Fwzo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913132923_1536845542841_0.2737208560562694"},"_hasShrinkwrap":false},"1.0.0-master.20180913134559":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913134559","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:doc clean:run","clean:benchmark":"rimraf isolate-*-v8.log","clean:compile":"rimraf git-info.json \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{lib,test}/**/*.js\"","clean:npm":"rimraf node_modules","clean:doc":"rimraf doc","clean:run":"rimraf *-v8.log profile.txt log","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","fmt":"tsfmt --replace","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION lib/bin/start.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./lib/bin/command.js","atm-git-info":"./lib/bin/git-info.js","atm-gql-gen":"./lib/bin/gql-gen.js","atm-start":"./lib/bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6dd921f836c6f40b7d63534c4a5e32c7fd7e0c1a","_id":"@atomist/automation-client@1.0.0-master.20180913134559","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QfQQUUrMfONdqUTFYJxwGhQoHuEtrU1SQt5iBzh66w/6GQVqM/R07VQSHl1PcUo2tMe79PfkzaEusc3QPme54w==","shasum":"93c6af30e662180c2519397d012dd19e7823095c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913134559.tgz","fileCount":588,"unpackedSize":5130320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmmruCRA9TVsSAnZWagAAlBsP/3hnxyCczr96qSnBeRal\nRRAvZGne89iIIPvt7bX1RpkWWnv+zWAWwLdJ4/p1503CoeY8r3mejBdR5F3k\nKeo2vdAkLTSrjwriHq0TpLDBUIifBJHCSg2cDVbeKyptszU4qRizue0Odek0\naLLL8fvzjpTlHxtpMWLtxOD5a20tuD5OJz1b354j4HNkeqtb6+6vXP+PGozr\nuUblVQ+p6C/K9OVZeT0XQmOa5a3mcXTM/F8RwmRQMrtMviMUofV5XaMEFxnb\nHHuTaJRyM0soMiZ/LMt4It4T+5k2cbwZd6YYaoHNedAVF1Hcv5Y6Ic81asxy\nqA8RM9qq33pzxI/KsvpPD2Op5wkwVghniMOR2qNzWQ8ZChi1nWAqS21BssSr\nLqs1juCyN5KkaLttD6qdvcTzPD/HzsEx+V2JxmP2+KwIzyqE5zDJlLLPF7Xg\nLPqtMOHWUIKTLUKsedvuj5clBd3OVZ2sQG2HkgtVxnbN0GiPd68gso7REzqS\nyE3r5LZRdYzvnjRXPek85H4p1AjMZ4ABJ7MOgvRjBJnpJHxi66bCtHjkDp1A\nTR4dkvrkBhgX8B8Y3S5WxNwo81gNQocB/YHhB274NLK4T0iomkoJusGNHxBN\nn5SNw1NSBmHvoP0n4cIrXwhMNaYdJVskZ2ZmUVZSOeWljcB3vdj6mkatvmHy\narvF\r\n=gfkv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbd85Apt362CdbfAuMKoHgVhoxSf2W+A1Gdf3E4FYxpQIgUFVOsu1czgP05HNQVEiG0HTrRekMrKBBOioXPTNqdW4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913134559_1536846574220_0.8476660210110596"},"_hasShrinkwrap":false},"1.0.0-asyncHooks.20180913135347":{"name":"@atomist/automation-client","version":"1.0.0-asyncHooks.20180913135347","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autostart":"npm-run-all --print-label --parallel watch:compile watch","autotest":"supervisor --watch src,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:js clean:build","clean:benchmark":"rimraf isolate-*-v8.log","clean:build":"rimraf *-v8.log profile.txt build","clean:dist":"run-s clean clean:npm","clean:js":"rimraf \"{src,test}/**/*.js\"","clean:npm":"rimraf node_modules","compile":"run-s compile:ts compile:gql","compile:gql":"run-s gql:copy","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --out build/typedoc src","gql:copy":"ncp src/graph/schema.cortex.json build/src/graph/schema.cortex.json","lint":"tslint --format verbose --project . --exclude \"{build,node_modules}/**\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","start":"node $NODE_DEBUG_OPTION build/src/start.client.js","test":"mocha --require espower-typescript/guess \"test/{*.ts,!(api|benchmark|bitbucket-api)/**/*.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc","watch:compile":"tsc --project . --watch","watch":"supervisor --watch build --quiet --exec npm -- run start"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ce2c81e6c4bc87f91f79e78239138c232ce7aebf","_id":"@atomist/automation-client@1.0.0-asyncHooks.20180913135347","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ga1ERdiIGBvhfYQPBrmwyZqhuMmtj5KBytWZrA3DEvE9o7oYZOuLaUdmjdQNoD+qCZ7rEK/bO9NlxLLOeHYlPA==","shasum":"80506658539f9da4aa7521c583b27b3f0fcfc9e6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-asyncHooks.20180913135347.tgz","fileCount":781,"unpackedSize":5332218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmm11CRA9TVsSAnZWagAARlUQAKMmduP2ByNILD8SJuY6\nzOdqJsa4adeHLi+VIM8QQJZeZHp1VTuqeiQFGKYRWb6NgAD8V5iqDhZcMO9+\nN1xtCtq7OtQu/7UhC0NL7VkuHLEoWKQxVTF+/tPEn4dAU+GRBNu4uKR92n0U\nLBwUl69jf0KOMaypJ+xtVndlacgzudA0XWK4gVTZo28Uq8v9p3msVxnCNtD1\ntIpjwY6VfdU2dyrq8wvOQVvFs3gm0/1y47Mx+tzHfLPlfkwhnAGlimlEwNAA\n2by/mZvVt7brJjFIluiylTBXLRONGtaEE1U9p7N63H6eCzVXRysGe132yu1q\nNDch/4Gk6p2OZmAH9exVDrKCwFNgEaiOMnD9XZ3skxj3vmZxFKxeFy91Zvce\nVumswRQ46DsWbaRtJ2wImoO457esBQjj1xWEo1xOjoYO75sNG/qBU17/UsaF\n4fSwI8x7ca/PeUVgRVpLdEaR0BWxoyNt+NRGoZj4sqJnd/yqoXijuSF5Heox\n+hJBR96zUMfXGrxby6hGGGNXxkB0ws8iTx4eW5qOPBG3+WnuLTxONhXGPU/O\nx4Em6qyj036ImTaMw5lupktd0WaYipJS9tkiIrBvFfYhXUvkdgp0RaJ6y8UJ\nr7UiA285J3zLoUo9D7spDUq+ttOReGu07VVb6a/FGTHoTcFBLRNdznMtSD98\nDCQc\r\n=aHOa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUt0Rr0moR2d9vvtu4LZtIq9cGa4ZingM7tCGOnnqDAAiA+WzY0A+teC6oxxXRlTqVObMYakX7JZ2iE8DdNWF/7vQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-asyncHooks.20180913135347_1536847220936_0.15985181009138616"},"_hasShrinkwrap":false},"1.0.0-master.20180913144729":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913144729","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2d4c2093e6aaa3eb8022873e2b8f1231f64872c7","_id":"@atomist/automation-client@1.0.0-master.20180913144729","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hzqhk/0kyy5yC6WEpA6m6QAhDoSTckxn1EBmgQKGTT2mgNEChYakh3tgUcYUKalJWsl97prYVg/n9007Fu5loQ==","shasum":"b7c072a1dc069eeb0e1c325259a0f99415215704","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913144729.tgz","fileCount":588,"unpackedSize":5124077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmnlvCRA9TVsSAnZWagAAUf0P/3+kqHK+7J+Mc2wzmk/3\nljkFdUHP0FoGs76O13+m+2gIGhmEDwpudd7q5kkCCDw6t9lLb/pz5KnEFe1p\nKfvEKRRLsQUFdKV4DMTWYxoI13mRt8RZ+orF1UoweE1Pfq3CU18anHdytLiK\nS5VHpyBZWzPd9OaoCu7qtetl1HHpZJmaV90aJvtovXGBx559ld8iuMzl//rG\nPbbXQeNRNPUTNhr0qwfVpQAXcQd9IJzaYRUWHR6L6vaICKo7xieCPK4CGTzd\n0qF1p84xE++tdO4kJe4ejXUZpyym38db2/PZd60n46RM4HCV4h73sB4qudOZ\n21LSydZOHE1ayoqakllI3/rGxCRJa+nHBsUcGW2+EeY8VAksL85R0no28zo5\nfQBLb+z1W03pltp4tg5Og+5KIBMBDKuQbwt4axfDWQ2L9whOWKx3c8dzJqdH\nfT/uIHlbUucAfK41cdmCz4xn4C5lPI9MkDcC09Ta2oxTPhM1WJLwha46JySw\n2zjGiLMuazMWBuoCWWYS+G9MVogAMYuLVJL61UXdo9bJaCNHC9Ob/Wm8V+JG\nTEszSq63ukIAmRoAHWAhNoOgIPf72tYtTwEoyNSHhJTeg7E5AcmnRgaJs3ML\nm6x+w1oAQEOFZJQoC/F5jw53YJC6RgRGwptrIv8mWCLqWL4u0J0uVuTN4mnp\nXJXx\r\n=lnFO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbK7rAv1xyX4nAxYj8poIDm4La4qfzmYOQ1unKC6KAKAiEAph+MULVsmVIPEQox/lSfNHhuOVxCo9e5OF63slD3fVA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913144729_1536850286218_0.5761113440666967"},"_hasShrinkwrap":false},"1.0.0-master.20180913193712":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913193712","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"157d3a57f500df62357e1aadc5355c40dd03fa18","_id":"@atomist/automation-client@1.0.0-master.20180913193712","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Jx+1PbzgBFA7KwYQGZf4DhGYqCCpXvgFzn81K8/wUnPi0W9r4gWyoQkpRytotd1WtA07cyUPG7g3ALH2mZW6cw==","shasum":"62301f6d6726ca6f32e76b2f55774b65a19e31f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913193712.tgz","fileCount":588,"unpackedSize":5124145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmr1OCRA9TVsSAnZWagAAbdMP+wVsZBvFHssFjvbG6Ghl\nlBftkTUzZO3HFJBuwf/PefxYrrfmojJF+GsUXI8Qbr+I0dcltrZykamEsB+I\nAG/vOYX6vurml9HkNebK8Zfl6N10Hqq4BMZmTZ7hs7UJSEcC3oFDdncXevtx\nY5TIWhuKt7h7aUVLo1Go+m1L2SnyJO08xhYswstMxPPBmGvMPtnDeBT69JF5\npVXGGWd12Z2PontDIsMByI6cljoGYHeHvVBRKX1g51gH38Dxoj2znATGR4Vl\ngB5hqdzGujAnAu9IrKKgT6RI+yB5tt9BaY+yq4/Rs/cAF1KAJDHNv31MXc9K\nt/mRNiYMQQ0y4cmoGLNuK/NEFusILpWPJHnNj3uyjeIyhaUO4JaS59fKsDuG\nk7QV/V3xYSoyoU0+lhlE6LQcmgWUqkYD97FgSCKQCYtKJxXtQdCA+XzUofpM\nCTv04ETxfGgCrvW7UNefqRxsxKt1l/Y+AW2Y5E9dT5ZsTXCYnOeW+dh0ooHQ\nJWQXthp1cOElSYXxk1b5phQFNDy0/L5E1g9l2Zv+xnfD93MXBremYbwVofT8\n79e8bLqCVZ29bNQIRUexarm8bDuKzyjHXxBfXtMUraQaVQgiAEtfw74Fm/Kw\nUwEIHWgjTds407zJOUaufjwVtgUgu/18y25h93yRjCAMZNc45olWR0YWygBA\n91ku\r\n=kR44\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpL8lj//sOEFT+4VQN0S2wr9S//FQKKOJYC+G4oo5QbAiBAOkdtYsY6/zPKiCtcDELl6pcbZ0CGuHpy/JHRwOO13A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913193712_1536867661285_0.48413905453592343"},"_hasShrinkwrap":false},"1.0.0-asyncHooks.20180913200633":{"name":"@atomist/automation-client","version":"1.0.0-asyncHooks.20180913200633","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"112baa8699ab1e82667cd0c07ebafb5c07e49a18","_id":"@atomist/automation-client@1.0.0-asyncHooks.20180913200633","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-F8gG1KhfQvjxGR0YO2NCk+TX2mR3Y3mtPsFhjQE1gAW3ZmHKh6EWgVAI9pOZ5Q7Fwe6G6Xi1TwkDXdQUm8d07g==","shasum":"b6b7579fc77f7c6e91dfc9f67d312ed41989e44a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-asyncHooks.20180913200633.tgz","fileCount":588,"unpackedSize":5127015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmsTSCRA9TVsSAnZWagAAH7QP/RmE/1hLzJ0v7qLCKlcu\nk6Ur3SPkxxN6dqGStlwyTApYGBVrbxw0GPKQuCXaFEpc/jNqEQgJajepv8BP\n6v+K5d7CbVtxJnWUjiHPRE/ZZbzdbSSed44rAHAkMrWOccM5A6RgtyxM3FW2\nsMOufj8e2M3gKY3SBUMNMbCpdwDcv5adV5huvU+9lOCz0gnccYumnHq0WICD\nekrrfwzctxLanpnN4+8llCRxnzo23M0FRneRiz9WfjnyI/NK61+DzdQXkMUv\n8+6nfo1xTFgWQ2VD4OENCKao68eYx9oaKZaKYwRywCendVhI3ZqT6cgXV+iM\nfNJ5tYAB0PvLJS+Vyyy+XyPbz6Hmx/QeZC2BD0UE2hGXJykkIzw/VMTbDnhg\nNkJykVqH8T1T2AJh2MAB/WD6k5NMNqVmGO0AQoK6Nfb86gEUyq0ukdyTEWw+\nB8E1Iew9aRnX2vRX2UZCmQc/wttMxRq+FFTFYepsTQ5XQpxlSZ4gHapMRKyA\npxO3zP14FpQuIkcYY89v3dA1vd0i3nMdmei/DyDdSvcfhpsi4/Q3odkDwXgz\nhaxSwQ18b5mR/b4kxAZBFmyQbaCjCcD50L1YlDGcU3dLmvZ51dvAniGzxnfr\n26BKwwBgcb2hRxX2nq5pHjBOnJf1pUMfrPlyDcHUwaDCA+O+jcx3wTZroNk3\nJpC4\r\n=I22k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw4B0ld6Wlv13N5VXHmZUTwIZu6YfJsJB/6YT4gqnI/wIgbNO3nHU0NB2bCzWZXvDESNGB73vjZQNtONyFuJLXfQs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-asyncHooks.20180913200633_1536869585178_0.3021550268895252"},"_hasShrinkwrap":false},"1.0.0-master.20180913202340":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913202340","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","continuation-local-storage":"^3.2.1","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8304482039a3732940184c7c8591221168d4876e","_id":"@atomist/automation-client@1.0.0-master.20180913202340","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-c+SR/1rRZKVxKiLoGb6ogmsOKpm6HeGt+ETZkP61YK6wFi90v7gznIwFWjmcVyJNQ0h0p5diZmRm1k88MfBOQg==","shasum":"955bed4e62aeac958e98ddd980ee376bb1e56224","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913202340.tgz","fileCount":588,"unpackedSize":5124290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmsgwCRA9TVsSAnZWagAAlToP/1kCrXVcbn1WC/rjty8Z\nN8Ky7z6dv+wf+j+eH5n00GNfBjuLYFzQ7y1Rp9oGdtHGRUWZNSKEuD5axXjm\nEnUQ/dFJ6dqkP61cYDEq3sTBOV7N9A6Y9YVOvfRB72/HkAXEiurXdZWfsMKw\nXMsi5xvHJhu3m9Yg6QsE4XojHzqQIOCzaEjFT6V9V7rMAAI0cQUP3/ha7DNz\nFgk1O1KHyQvMwuRG/Tm6BHpPHAR0cXRrmNY2oq345lxX0EuAzwcyVtkSFgse\nDTRknrGT0Y/UHdRgUsWMWckjxtQ8YOSW+hXYFfTTKR4NlnCik8OsqgTUiI/E\nEANS1gho2C4cz07RnElMPZH5Khd1kqSDeRdi4m/RlQcCu0QGc22G1XC7z5ln\n8UGS210EN93PU1gVaEGGCRqwcbG9oVLrLtpRmOBcOV2bOJlBlWGpTR5l6uRH\nDgq8tRGma60AV4y6laRsWKKXl1vb7DbDOfpcEN17HFLvPPvqBiHQaKLkjQCI\nQ4obtgVHlUODrSNqBaPIx4dr518DaMUASMa5Va+6WKUBixiOSXw1aM52ciPp\ncrWis0jtirgH6F1GXi65sQpqp244ve9kWxz61ApHxYISpt+e7HdIWAlqbhgb\no5tnOh4Z6503jcAyMWCAd6yS6VYp45ar83y957w22Y5K5wx+43xsuAOpPKlf\nDTHj\r\n=/NOh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8Ad/WGcSV2cv0V0GJrwbArwjxonb1U60aOqyvTpFo0QIhAPqjGUb/Yyl3sN365Ckjp/Ctta/9FSupwUFLSNK1XONS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913202340_1536870447556_0.3336986984337835"},"_hasShrinkwrap":false},"1.0.0-master.20180913203655":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913203655","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"55fe516662513c1ae08f700efffe991ec1bd8183","_id":"@atomist/automation-client@1.0.0-master.20180913203655","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Y6zAGdXR5zKdduC0ePOJbyKrnq0mIQ5qQa1l86BAi2JyPz/gFrusgHi3lsRJZUfT8j1QVjW9KZ80QtI2f/pWWQ==","shasum":"9ea849108851ac8ef116c53bdb32d8cfc591a229","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913203655.tgz","fileCount":588,"unpackedSize":5127325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmstICRA9TVsSAnZWagAAXsQQAJ3J9mWIx7y54vfB2KKz\nIT6gA583xBOwi7/I1xKgZDS0ZCEcmlUs9f/IQIqBNKQc2NxnLzPA9EY9l2oz\nIEG+f87lw92PNF9rKvcYC+WBH477Nqkm7zrdrLvfbJskmt52dI6n6r9e2PHa\n7SOCKU5u6WXnwH6GerwXjq775AIZ5tMcnSwgkYeowjquQiPq7rZ46RtIZOxE\nxSrWk3jR+zjIQxlD161x4S2RC7zDKPBF2ObeFD9LX63Mt3tKDDaRNrh+uZf8\nW5ta4ofYY2S3WRH+8FRz6jE7rF3rVeJZYIKk2ZSSQwyEHL9rVnsfSwuJGRH+\np/7cRCDLm28ROPi+AHUxgIvQBSwckc4Lt1ufHedvZMisGw+DyF3OJ2hPgyQm\n3vd1jbN8iWK4ktXyW3DNkHPh08u8dUrVZAeV1Mxxh5AAKVd2z67OiboeoqM2\nsnBrWFDaWkHXONEckkAgwt6qL0bgOXX2mtLNzw3e0jijr9oWRX1A15QRxN60\nIrQ1olT3EvTTz3RaGKXGRbyh55oOtILPhv6R1NqLcWel4ONB0g0F/Gn4WkHv\n1wfR3g/Fi6yF/oDxkc7ikfbhEv+YR/Tvoe0MLfKKUIYek0VpuVLQ6kL9OOLJ\n0s019At+3lRbzjGTGcY6pwfr2khWFFx9HVxr9r7GVDr8LeRMfvUyFkH6TJJV\n3g+O\r\n=Idb/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoYqRd7VT0epi0+KslF32pDYhnwPKrm05NUgSGGX5yiQIgVy8nDgT/wf9XSSk/DMzneLPYrvM7TYwryHjJMWJrKsc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913203655_1536871239908_0.00729391361318843"},"_hasShrinkwrap":false},"1.0.0-master.20180913204515":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913204515","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c56b239d861898ac7afa4538f3deaad06f213f4c","_id":"@atomist/automation-client@1.0.0-master.20180913204515","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-p01GGigOT3j61X4jX88CRmhqIqW6IvvqzpUFupEXHwdUidW4ymQ1Tr3QtOmOFcU+23T1daiHX8wKhKDoLMm2lA==","shasum":"760f1e61ad637bbd54119ae6991bc56ba4cff054","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913204515.tgz","fileCount":588,"unpackedSize":5126759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbms1RCRA9TVsSAnZWagAAmEgP/0LGYsDQAxpCACppanIC\nN4vCl4tMueL3sEGXDwJZ/MGHd72xjDs3+Odr5L6UoQffzRVBzDWg6TxsVN1O\nCV2KMqS/5POVfRaxbLt9P+Sh7Jm/4x4o3yNCzcdhFXTUCQzEotPNH8oeiWs8\nyU8QXzD7zWx3thn1nr5osZtki2RT1OSd5l/23NeFv2ewdRUZjuk6YJLgZRrc\nJF2THDg8idwXlDD+hpUFA0XMAy4AzFZ3oFl0zPrd1074qWoxnTAJhQR8TQls\nlCM/BeWKgRdzDShSfT19ohxwZWb0OrjLfk2efFqdNrREiU7ePhS76oD5aw+k\nd9mSxM/itZnc9bCkCLaEiuE1ZtCkB8zF7N1+jC2IcgE2hp2HRLLH9E5yT4XL\nu9gpEB2rxW96Vs7DN7riyuC8EwpIVouzVniVspL10bMftAoFgI/2L/Yh0z7l\nuaQNGiXfAVss2QOHxe7b3vn8mKHxTiwuRwJRJ70GwnCMjK8ZYNq+YJ+QcREu\nTTFdc7FCXVUrre3J/HCLKm5GTqi2r843H+2mktHplRF5EtYLtn5swGUa4ZXb\nyw5p6jMs+v6ZPE8wv5w8QEU6+s8vMzi0Cpryw9UxiUUmT3lZBgaCpreRKg3X\nO1wcIV7LPYYZvOVD7p5BdpE+wvdI2RcDVeeLnLdQ/S/uB+4IwBdN9M4+SLJE\n4XDf\r\n=LSht\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8a3iW4c4arxU1/MimNwZrjmyXhlasp0cDRSr5l6XX8AiBQ4VOi71OgNqz2WuhDKQCF9Ys76wJTTr8bk6oBFR9vnw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913204515_1536871760655_0.6277919325304677"},"_hasShrinkwrap":false},"1.0.0-augment-index.20180913212236":{"name":"@atomist/automation-client","version":"1.0.0-augment-index.20180913212236","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9cfab3b15be2a4331412865529ca3f0c89206d32","_id":"@atomist/automation-client@1.0.0-augment-index.20180913212236","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vfdOpeB66sPqUzLzcE4zVBX8ihomxJucuTyoAqi51kM3ZiYIbVRQpSbhKEtPZSLwmmR8jkZrUQAJxp+2eAOjiA==","shasum":"87c09d895b369d5e9c236c889bb0dd012ab25fd6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-augment-index.20180913212236.tgz","fileCount":588,"unpackedSize":5143443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmtYeCRA9TVsSAnZWagAAcPYP/0cEdScjXG8ZPU/PvnOK\nYcukpvZl7auSliNQ04lvdDzB9CXK9zZnrof63xLGszNSamGWV1aMmN2ZGmwc\nARm7K/53vne2K64TspCtF5U9i3JgpP3Md7JeBKCUO7hLrBbPDm2JrL8YxN9n\nCqQKmr+Q5GOSoPXh67fRxwxHpot4LkUXvfmwm/eYyn8S/Wu7g+QA4q2DRyUx\nHvJnAShAGw3LU+rdn9ffpmGGEfZIGG5cN+uYP4rwUH2ey4ULSDGcVwTk4mWc\ndkz7R1SCr8m5MwPbClpmTiKOoW4etob0BF2O4cxFz3eFub3ZWpMnImJ9xR1E\nZSsOfTD1y0PAPRn6XANduAVZdWHc9RCVL8bQX+3uOcPxjVNzx4C4kpPVcCXg\nJ3+Oiy1+S58Rpv49zbQhcHI4ItQ2C/FaStb4sCVJFso3P0oCtPbbHPEszGBI\n4Zytb7BsKWPPOj1MZXUTAkcrQ+1LT88C9Au+KLjlFzOsBIwuqENa2YLVm3tg\nrvLff+6trmdH/rFn1uJjyQJnTxBQ9Swicd0Tnl2GrHND0aLXGGLeGka/fOka\nkKJBPcPUrwLpnqJeY6UGCEKYYauQUePjN1X39/wgq6NZ1/z1pBBsqZolCBoX\nfRTb8BQzOtdyQJ7NiTM6ihn4nSPhXZ1IwHvGJigdwTSeLVJ3LDOMOsNNIA6q\nIPSE\r\n=wsZk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWezJivGu01zzzSSmn22aJa0MBmfpy6ABL1uDZsGDXhAiEAtmz+IWITbfc2yfjenyQuyCvzq5SoUEhn9kbpcD7znio="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-augment-index.20180913212236_1536874013981_0.056207353706610785"},"_hasShrinkwrap":false},"1.0.0-master.20180913214030":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913214030","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"53d9c97402a3c8c747cd2dd6b2baae35d7bba834","_id":"@atomist/automation-client@1.0.0-master.20180913214030","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-W3Sjuo6RJQw/OUXV2P+Q6ZY0HvFWGK4EBSfyRl4sfmIpiG59wl8WlJkuo6SUa6LiicmWi8CoJlUMsaulhyTdrw==","shasum":"c2420a06f8ab4de56208c5c006a672530cfa3033","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913214030.tgz","fileCount":588,"unpackedSize":5143545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmtotCRA9TVsSAnZWagAAKRYP/i2peYIGpx1GNlW8zs+q\nQTOs4e5oRwqpytHrRbz0l/odY52uLCeUO6L9HOajLXOH6bBeBkVgJCa4MuHh\nlRp26u94aHzXHYHVHcqzlURcRmY73Qq+AsqosFt3ambs4EGGL4foy55CHxdA\nDRuwjUcy83HCxNI2eyqpwZfOFh5mul/rc+l/e/eAMvRkLj9R7XxypIZJirwx\nN1Rx0ruUGbG5/JQUA+CRKrR38zDYqmy+z5OK8AbLpy5mnRTbWNnIi5UwGp8J\nOI2q+TP0TTJhvKC51Q99E7BDLo3OY7xMCJr3EA616FYz3GYeXy76ChPLPc0y\n3gyQGOCMZb/1sS4ATy6yul6tDT3fiSP3iJfZk0fxsD6qHK4kM8tsi9TG6it9\nMktkLbAH6mVZa5KFr28m94rLw84nU6S7rJbGacifVpEKSZtPCU/tIzPHpEsD\nwB81I13Pn3wy+pfN+uTspQBdq3sNUTdhWPlC0iup9+13XkQieGf2kkw1YUTy\nhnbA8RF8EuCC/5vyE2XzL9OOyNrcPqYZpqcmPV6VIoyLBHJ7SILTsgeG4smP\n1rXhkcWmdtjc2HmqbRoeQZOWsDiWtk7vw5VRNov49/doqOlmhTjctzW5AQue\nddRATTKd35WYGH2S4YLTdxEBnIAbVKHBAuE+enGe7+OlNQ1Y8U1oLsrFwmes\nA00F\r\n=gbAn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzkKw2xJ2xgHD9MIv9uw1dQ+8HrFrJ513W2gzc++TLaAiEAo/W4V4mFe920D46MGLZrfR95s7t0ZZMudfI2S1Y7dGM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913214030_1536875053005_0.5763273434456284"},"_hasShrinkwrap":false},"1.0.0-master.20180913231034":{"name":"@atomist/automation-client","version":"1.0.0-master.20180913231034","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c8513535eafebde22f24bfe4f8f925c54e383b1c","_id":"@atomist/automation-client@1.0.0-master.20180913231034","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-iwQfB7gvnUFF+foa8elOAkk0fcIUrnSHZ6MqXTjiDyc5EmDZCoUC2MzyvZiymeltSWoazj5RWSYoswwK+xbdYA==","shasum":"bbfe62d83a5b15a4856035f4b97a81ba97fabd20","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180913231034.tgz","fileCount":588,"unpackedSize":5143545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmu9LCRA9TVsSAnZWagAAvF4QAIxnjO5Hni0WzWdxBaLU\n+jCW3ermseC+5myYvPPPwEIioZn6NxtyNqZvTQz/4CEFaB2XMXkuVNqz4M6S\nLZuGqkADSztcIPYc9VmjaiK7o+H1NcDNl8+frDz2pwNXoM8RY5yoAA9Y/f3V\nxKkn91I5fsYecNAjSul2/OFKlAoBsziUMfTr6M6sRDK1hreZ0oIwsnus91Tq\nd57JcDtGqJtxZDnRze8ghKkWfqPbLvAqcYY042BoaQ7Fo+GR+6hIJb7sereM\nRi2VEWGO26+CtgY8VNnnoOGRrUOMLTHrXdHCD07aFTwtidp7Uno5T+tbqklZ\ntBKgd6KdFV9EnghultkfOycgB7FTXF3sltKjRmQ+0h8aE+wOaGDkJ1wZFi6e\nR+XLeqiuFV6Y49wJEaOiVnfcwNbi2DKqsONv1PK2sHjAG8Z8Mt3X1+VtX7Mz\nDBl3eNn0V73iFrjavPZwzNq5f9pklTvmf4VgB537nGC5Ub8Llg305RQkYFWd\nQzTBbJV6rvP9O4DimJdbbOeS1yS8zibR40YPytj7Thz1L2H0SEI6+tDZ0p+Y\nc1OfDooVb7qmssup4QwlIOUe5iE/uKkS6+/2k3j7/Z9M0ww6wP/KGw2o1k/U\nZjBr7XJZsJ5Sv5pTZ1QDQTMwDBbpgMCbN2itw7ll/rswBFKvMXpi8KakGxxy\n7K7R\r\n=TMUK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRf9P43UzLlVIbOtUAhgJ8CHCfYGZrSHectDNUQHuZzAIhAKrLQC30yJhTl9HAJJBx+lQDsBo4djWjVuGyn9imrlyS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180913231034_1536880458779_0.04957808081209647"},"_hasShrinkwrap":false},"1.0.0-master.20180914094511":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914094511","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7a01cc5f57329df1b55c5171b44167365aad7fc5","_id":"@atomist/automation-client@1.0.0-master.20180914094511","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bkZDAt2BCmEWw/n1BJvsyhXdI3sSI/yY9+626FF47l/HAUq+VCXU4Tedb6YAhU8YvTjLkl2JxpriJ4rL8/8cMw==","shasum":"ff87b669f222c45db2cc4ee41be5c3d51e14a70e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914094511.tgz","fileCount":588,"unpackedSize":5144264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm4QFCRA9TVsSAnZWagAAeBMQAJhxtz3DEtaMkSoVOb4O\nKgELcbAROMX4F3qichOrrepflyhIdhuhn8JTbguShNKH4i4sSQ3yaWmm2l3T\n5aKNmr8B3911jvD/xRgTG6xyySlyENhY/JaaXFf+32f4lQumrgINZ5x3jnSt\n/wwBL5jbkpnmhIQ8KtHQGi/PEziKM+IVdSGgSzbsk4fDnh+L51fOOdBq8Swc\n+nkqcWIHJNsfWqjycOCpQGi3sXtYp0fTQAFwfMVagxwPU177CGwoy48BuF9m\ncNgYPpo9pahuncSNz+UrCsn+TtaH4zKbL/d4Y4wceha41hn/85SAicsOqQTh\nvt96Bd/vZHqlJt0yhX5F5WGQ09y7S0pNdrrAgWohTaNndpyLG8YtOn7SmWLn\nFgbyXX1hdJ9A9TxuxMHT/hLFUed8MVsSGum6t0Yy9KkB0o3LSyM+56So5yLI\nzMP4+sUt8SW/X/qTUe/xOts3WSQtlXOUZq+ao5xigwQ4yRO0kBIh+iaoBZ1c\n1RUjX1Y4GcjDJz0NJYa7Ztly2x90jcZRvYeV0e329DC+P16arRpnV6WGysJs\n0ZonLHvrZcT5a4nbIYtOBruVLIUk6HtL32a84EnWzzngOoh/M/uaBsqDwf5r\n+GxNik2qgDLjkO9mPY2GVWWxPXIoVO7GDk7HEQWFv6AaMWtxdOHdn/zlvZ/a\natRB\r\n=SBeU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPblejENwn0nurnyMme5GyUnHRI4MXBtiIBbW6Vtx3fwIgV7LijrfYw1x8jqtNZgmq1YqpP0xY1vTwbZG7C9/bW/w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914094511_1536918532567_0.9848820593871566"},"_hasShrinkwrap":false},"1.0.0-master.20180914103733":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914103733","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"aed7cba52be9ca66c1fcbb566e31121360650343","_id":"@atomist/automation-client@1.0.0-master.20180914103733","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oO9VeWq3Gy2HK7i29tEoI/dwtIqZMFOvZBMVSWosplz443Rg+squ33NkRTI2x1SImF9nMqx4j3l3lEFrbGpJ1A==","shasum":"822554a21812472b7290c2a0b816c48797b01ded","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914103733.tgz","fileCount":588,"unpackedSize":5144297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm5BlCRA9TVsSAnZWagAAo7EP/RhKFHnuf2dM8bKDDeBn\nX24QRrcyi/TeIOZ6QzbZlWQ6wpOxUtwcfNzFVukj/slnURVOhO9UqnxNb4TV\nBGKpSj2UmfjRojL5UUeKa8/IEtWX2gdInkCowGka2TYom+41UQW2yT2iIRmb\nEobL3tL76l5uWK/DNzFXTriSXm8CrYHYSVmVz1ZEU/QFFBxbGdLjUkhU6wlu\nsVoVGNp4ueUkRzib52FLe0qb/40/4+3FnmOK1ak2sDiqFK+360+7cWV3OYBp\n0lVH9t47zLHePf+gUcSQNOllvF7nqcaacrGxvT+thZRhtqVRuvGPYx19K03u\nNXHDXWb5B8yVLNjRr2rVaCSMxi0H0fSQwnBt1uKk3F93g7Xl2iUG6nVaZqfm\nhUM6CinYs2adhyth8BY+imhrLYrlpSDtc6VjrI/kXhuDAcJQbq0iTDeaejeu\nBG740FxqvyqLH4yBtu1PahCi4iAOj7m2TSXagKvyAZkcsIbm08yZqf/121gf\newJ9/ghDaCToeHg4j69f/9q+58cwBb97UxDYV6ETlY87708zt/oAVJY231qC\nPRN82RPsG/kf0Zd5XhtVrrHEA2YqiLF/q38N0WAv8m/rq4WoDghbeOmMzKZd\nvdiSFMNh4ZQ+al0OolTNkdybAW/mch6jmcmz1KcP8UwlvkYSUCJRr5GRxbvN\nlGqQ\r\n=sMd/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpVSb9DMPcHrXcqePGD6nCCZ7oCv7rMrbWwCY2979tpQIhAI+QlfjHrDDdh4LHbWTFOkPvexp7NPkg3jaL4fyyIYtY"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914103733_1536921700364_0.831019846289528"},"_hasShrinkwrap":false},"1.0.0-master.20180914105318":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914105318","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a9df1097938a3a82a18fde352363f8fc07939a93","_id":"@atomist/automation-client@1.0.0-master.20180914105318","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mK+QYeebgeHpt2SEQT/UuOupxGMgg9uxhOgn0eZ6ktOij9Rf7IBKblphfJVJaF6OAfWCuXyJXpY5lu3TopwHxA==","shasum":"61190231d6a8814fd9d5bb3b334525082e09ad80","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914105318.tgz","fileCount":588,"unpackedSize":5144366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm5QUCRA9TVsSAnZWagAA8uIP/1sU5J2zXb519rtrh3qg\nTqvYD1/YEmKGgxv/T6GuwcL3g7TbGks+M358VWRnyyfOEONUncsULFK6bN9o\npworQbiesIyZA6ZnK8y6kdS0tWxVQoxFU5RXggp1ly4MjmM3tciEAgLaL+9E\nH3GKnfLSZtNeEUrzeOJ/RKiix/N5KNflQHY3rkS7cZorYdSoGpaDrZSco5ng\nWl4hdzLFJ/Wa2PZh7X2x+Gp5ov53WONi3vSxsZ7TxLe6Ge4L+7qBgr/11Cp8\nyYKyqODUGl9ruvr8ZNtKIFodNN9rYUM2j2fkFf95skT47jbIBuuTyth7z8Lc\n3ZjzcS+zFZrdSYOO80B/r5KeHiakPKWtl/nR2HYoR39URqfeeQ9aVYHInYfh\n8XbJ7BkcG/AUNXo6pr8O3zASBXWA/doxtwLhLRPbwIyvlJzy9vg8TLpFVFll\nu2C2bZYoeRuCeLOPSqRRiJjrDZ3KcBxsHys5PZ2s74oquGhA7mCLp761+9WP\nyQW6PK5F0GO1rTV2lLgF1eaNZ4pE5F5gafav5IVmpKddk9ytfA9vnXL9g7SS\nGUtEJpYpB4LadVrskfoK7ZpgqdWIAHnFShn6tuCnszdImGUIxkcTdkWF7yUP\nLT+4R1JmM2XSl4RrA++I6fzVUCZILbg0QPlnpKe1XqjVRcBprIeid+MZnU96\nm6Rj\r\n=xLN5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQPwiAwi0w1+J/LFox1ZJIwC+UH5elQUQD5G41lcNPYAiEArwo9e+IzHwz0zpsuQqfzIXNrXxMne5fGDDeqh8nZxG0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914105318_1536922643789_0.7314758462131152"},"_hasShrinkwrap":false},"1.0.0-master.20180914115718":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914115718","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5e4a2f719f35a83f50fe7d08bf8d57e5b7293d54","_id":"@atomist/automation-client@1.0.0-master.20180914115718","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PNwS3MSYpHfah1qyi+vF+qPkc7Y0sprj4bxsGjWSCXgCkSimg3/JAgfVaEYNxOZCBQrHXzG9aY6D33lggjRaiw==","shasum":"a3c52d76d3662d3857b47e9146dcc2d812a16740","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914115718.tgz","fileCount":588,"unpackedSize":5144522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm6PKCRA9TVsSAnZWagAAN5QQAIM0Oy6by8fh/+4Uwzqt\nqcbSNn3B2dzBgaYjGD3yYvS8iQ0APkXKfCqJXnRcZfzalgjD8GSlq/XrWQIa\nQAHV0SeP745RrHN4dVdwkmoOQ64VQvd3AVeWu8ShJSzrsbWPoMXPzwNxAPyY\nsg9WUblKz9bbFPmhbLF1ZQB+C4dsGRd3thP2OEzGdT/yhDq+KlD9DTWDzVf2\nHF471b7uhze1d+7dW5iubs9QLKRY9FQmkCCuwS4/rje4el2rT8OUps0Gqe/C\nZMziysQLz2xQBQ/c4hSrVjbAzoLYeTarn43PHu8pWMcLn996FOlEA1NWjcDG\nPVxUg9rmh1No784U0y9TTCA9Vqm3gNTWGQjhvi2tKbZ9Cm82TN4AkHU9EVxA\nGe5bfEFwYTRRMy1NpPL5jk7Zyji5vhqSG+9W1z+O4nDBLkjtkfq3490ELShB\nVtUxYVmFuHiMv9brDchXBAAISCfAf+kfV23xMOO2dDE7KzZDrucy8W1sJ817\nWBAF5J8VKu35JJ7JMvQhMt625vjAwpcjt+wQdU06KCYIGgAg2lhz03J9GdV3\nUIEuXrwBRtf9AmShcXAHgWZGbefq2KVEQR/FshE+T25rqY0MFcWjTibF6isw\nuQMVtKDmEpXzFnsDzzu2EooiOlVyuwFpQNcg5/TlVGRa3HvcpTDed4x9RkaX\nstuo\r\n=IDJE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYPqm8VMtrb1vohL4UHRo3D0DFmo6S4t9cGB37/Gs4JQIhAIbgOypLLDQhYf2QyTPZ+e6dGT6R6MVlQK37l6Bwdh8q"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914115718_1536926665575_0.13997295373342822"},"_hasShrinkwrap":false},"1.0.0-master.20180914123233":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914123233","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"586f9e17c03e8d3673e94ccf16e470dd304698da","_id":"@atomist/automation-client@1.0.0-master.20180914123233","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-laYwdvKVz/Uu3frOtzJy+VLIfjYJQ/dtvNHB8RC8//O+dqRWFnVAeIWYrNc+Nzb+OI1DmMlYye24bTzF+8zoqg==","shasum":"01e2753b68eb0d158e2bba3e4004ebacbe65d6fb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914123233.tgz","fileCount":588,"unpackedSize":5144621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm6tgCRA9TVsSAnZWagAAUFwQAJjUJoQYYHcoUG4oxMAR\nNYpLSFqo/qUm5c+QXUGeiS6kNHguKij8YfjChr6diz/qBJBZNP2KvPPA3RtV\ng6jvl4k6/ZOqfGCS9JnenJc574XUfF57Hk+s7LgZ9IajMWOcxcYzXqmvhnd9\nR9nF0sFXCjqRRyjmG4kHAs/tGeY/ugMQNil9SLmNqsTgGq0bfV+u7fkMDFTU\niEcXrBcBxIA5WTUTxpdUArlTx45uaY02kWkz6g3aIi5NX1efJ7tvpSzJvE1o\nFX2FhvKIFNGd5mIXwlqfTzPciGiFxm79VaSOMw0kQVLd8P85oOxv4GVEP/jj\n4KxlvFibKDLtBhz5zQt0eapXKVo0qbq3fwKF7T/ahj/BBPqJZjYlyoW7C4O7\nuuHlusdoUnnXug6helhouTQww0scTLF/jjy50EZ8R/r8T/g3YTvS0QRPMDCK\n1eesPnU8LmPiLrfhNU3Qn/h5eJGiwoFv3J1z9/bN8O1K6w/mBjXnpyT34pZU\nYmrAWSUoMzSeAmPwK+OrGBNSVBmPQgRNP5dR0aYGTTY/TqpkSc8G+B0Z/bZg\nUzuuycnVW/y03sY+FhhuQLWNG194/DdgNEzvJFj8p/u41uO5YkKNP7AqJyc3\nmqQOoG7fGhczKfgrJuq7P24a40PCmGKLMJSeXvIJj0JHLKfx3eVsCCIsQMj2\nLLfg\r\n=bGXB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKTrsKHJ+L6+YPc282n3zLWo+2rJgCsQ1rbQr/DECqcAiEAgBj4P++T9NHHdqyZhAXMeWozMOdv/zz0PuDARyFVcOU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914123233_1536928607757_0.03445937041270586"},"_hasShrinkwrap":false},"1.0.0-master.20180914125809":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914125809","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1","typescript":"^2.9.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"14b34f66996d992e7d33850b508b28fd26311157","_id":"@atomist/automation-client@1.0.0-master.20180914125809","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qtYn28Ag4lyCPipbjlcelywlVGS/jR6c4bQ/l1DG2ioqvhKESWu/9kuPZVqfkO2NeFU7vMxwIa2FnGo/88ipSQ==","shasum":"f28dd04882fca9078138500e5f9bd044e009c336","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914125809.tgz","fileCount":588,"unpackedSize":5145061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm7FwCRA9TVsSAnZWagAAJv0QAIGUPo+hOE6+5PIwpIRr\naHpUnjGD/KqXmmZer4ZNFuusLtsVGCLi/kcl9P7PZ6GJQZ6Jjm4OV5JfkszC\nkpFGwGtwhP3LjvT5ESjDZv5A0cSzcMF8m6XozxiWQkPjqL1jQqfVFdr9EqTW\nO8vdFpk0nivAUN6fA8ZMROFxte0fg8b4IV/nPvKIy25+EAKVPsKzbmBcm8xd\ne8lMcKGHLSvKAq8cQtOPiDpNrGCwixV7pSZlhv7LwHkHGqVNYIkpDYQwgsaU\nwl4oT+K9ODA86AnAkgosN+frzo5CPAQdoqYDETwZJvqAl2fET+Oi9BU4NhoJ\nUN4L5Yv9mVyEwM8znepMZQCiGaK3ySAFO2GS6rO1EQm+HESXt6BMtDY/XzEv\niio7MkyiByVwqc3kabNwWA9wUY65q0zq1zLXl7DTnAzGgHFW/3c8tzDF3CUD\nSGlCuoJjFjYZ5KOTqny71gFVyHcZ/nj2fnbIuEJnjDHNoySfYKZbcTNAiMV4\ns4KSERlwJQmrc5MHEOnO2OUavYcYJuBF5mb4xwMm12NiR2BUjQpxTy4kv+cV\nQFewOShS/0pt3x3Qyn9bifptkVXW70cm6fR1Bdj0sydopNlLm89QaZBEtm3U\n7c+ueYffC0M46jaKprKAD+uWSFdIjqo/5D8g3/Wj0hiJfS5e8k5+3TLjVWM2\nnum8\r\n=Q+DM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzRcqp5kJnMDBjhmXmrV9ErPMx/Zi3A4+PZ8SEi6iRHAiEAh8PMUpMp33+6bFHur4IwcO/Z3g38WQO0kth2LcqPAh8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914125809_1536930159352_0.6287625835320294"},"_hasShrinkwrap":false},"1.0.0-master.20180914162458":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914162458","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c12facbcf288369cbc201126ced83f775f694a7b","_id":"@atomist/automation-client@1.0.0-master.20180914162458","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RiFZwBzTClaCuWlAmki+RZeuJr3YdcWCnMX/dIS5KgBjVFtYU/1D3e0xyMCd9LRribANYb+JnXkCJN1/FWs6Lg==","shasum":"78f10e1e3b36627257e997a8787d93b0e2199e16","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914162458.tgz","fileCount":588,"unpackedSize":5145183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm+HMCRA9TVsSAnZWagAAI80P/33jOvnFgDA5TICOWOYs\n5eV8qoAb5UUlXwCWgnMXmWBELqrlxAFzsJY0I7JV7BcBurSZlOtAB/EbuhS5\nxyuRL7bgfWzT9cte5R888iwZlnMWkus/QCajTU/lzTac1lFYYJlJAriKoPbM\nhnKMNHSbxYta39If+vkAE35cNX2pmz/Jhx0uUPUOgT6Lp9p+4Bm3Nb9ZpI/5\n6/csNZTk0ogL3E4IU0B0msrLsq2D512TyjGg+lXdhnlZ1d3oltURNC0ln4J7\nr5oGBoEwjm5fAArLjgKGLPaArSAMctUc2pkzAC42s9DWPpbfDwZh47kbpjX5\na6d4XgzrN060iHS4cGNuFXKcfqgSQY8kLVYyfJmfKCxM7QuhTEeI1EtGWDsJ\nZVRmg73hKL69/lth4kRgJOasWAOcZ2kjssE8eyDd/UJYBUBtNhrUx/E5g/GN\nD5GV3HZk1ezovFaPYNYsKIjkwos+XP+rnv+BPoTUKbSWYDwM4MexLSzDxwDV\nQHNGuiLzWBO6sNH1mo1EgjLJEI2ZZGaould1jiv/Gl1W0Q/AnPCwL866Ns6P\n4v4h7LzRJl9JEemVaTtYGfEq6TESJJ8YSqz6s86rE+YJHqSS6cJ/DI8vvGlg\n21DYgSMPEEUglcw433Km6BEBn5gkz1w3w0BSVyOzg/qs1bxz26UqbcHu2WF1\nfg8Q\r\n=QblY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxQ4BDN6BRD0HHMEmt1TSYIwYRxWAjW1L6Bg2weSKFHgIhAKGviOmvoHBzqYRVkSC4+iEx1P/lfy9g0UfiCjUJq/HT"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914162458_1536942540185_0.17999317126088132"},"_hasShrinkwrap":false},"1.0.0-master.20180914205010":{"name":"@atomist/automation-client","version":"1.0.0-master.20180914205010","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"915e9ea27f5d5cc313ac793da1329e6a24fd44a7","_id":"@atomist/automation-client@1.0.0-master.20180914205010","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6gyj1F7H7m9XTo+Nb4OU/mnG9zB6VygZixYGwSCqS4x4PCF0D6GCDGMHpMqTr7so7/MTOr4XP1XnUkdNM4p0Vw==","shasum":"ec1c08369b7377b2e62f7e0a73f7d5cd13136355","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180914205010.tgz","fileCount":588,"unpackedSize":5145511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnCAaCRA9TVsSAnZWagAAE14P/08kKi1kuc6PILnm3ZlP\nE8/MnsaPUv5McbzM44oqQYO1YirWgdoM/YBXgOFUToaY94YrwFasA+X3pMkV\nOlxH/8brLM0QUxrprKfpX3UdAIpbEKFCZpvfS4WSU4oDgECXFFVcuruzLVjO\nvw+GMgDG9Yc1ndFV/iTwK5O/FtNVmjb7lMnnepHA0hPgSxckoaCwKYSs1ekc\nMyEYNyX96wFWbtYDYwLs/teLYq9NOisaSGUM8KjlzafeeNQUNBb5qCGCGH5H\nUxxSTq16gBpXP4hynRBCBWMKCC7BEm3Bn584a8Le2i0vdE31VUeBls3SL0Xn\nfoBMpNReNtanLAUiJDe2HTrug7NngciC4fQh2g0SePKp9qFpDDXOBSnISezm\n17MK5HPLNbRkEehP1yCB0bQrj1tucz406aodnXe9w5mRAd7ipK9WiTNvkWHG\nVXL6hflozIu20vN8JcReHkdbsKYUR8XWwNZKDGQpIB+IUYrhkso8rVCXwWlz\n2b1c67oPuHBMb/A0cmXRvIXoaVPEoift/KB8Hos00nlEK0uJf+bTOVAhRTdU\nqbDLLYLyoqbvY3WjcWPPrd2d3QPuyjKjGp5vWsAH/Ub+sDjbUrAmYbNM3FHo\nTY8GHc0TFSUEd6hyvdTGYW9BdYXdPsk/UH2xRIqte7Z2GNXOMlB8QcS1AsYk\nssdG\r\n=wNI+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBt1Wt1lDHSKqhJvIugxkeX1tj6SxjCwcH0c/8FfnOuwIhAMesTIvk/VjDEdnDI+gk1TnX669GSHXDuJAk7W3dmKve"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180914205010_1536958489399_0.5995941929624256"},"_hasShrinkwrap":false},"1.0.0-master.20180915075522":{"name":"@atomist/automation-client","version":"1.0.0-master.20180915075522","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-master.20180829162516","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-master.20180913033718","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ede1e65a2a8e5ea8af42d9749949561a64f67bdc","_id":"@atomist/automation-client@1.0.0-master.20180915075522","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FAzLyic6uah8iHUOqXkddqBRoeIqJCQo9kcd1HUj5QxXGAx+py7bf4U2XS2yQcgiR215vu3+WV4hwDM3A6WQbg==","shasum":"fac1744ceaab6f010024a699738bc02ac647b927","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180915075522.tgz","fileCount":588,"unpackedSize":5145843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnLvmCRA9TVsSAnZWagAAT4AQAJpWB0XlmYOOFWDTH6Nu\nWoXOyKYuBrUTRohx/HiCl+Ct9xm3O2tPhWxL8jUWQZBiN0AJI7WKAcST8jCz\naiwRm6hzrefWSkP00jAXTJgHqVkd3vn38OBbZzmX/tOtGcvCDqJZDx2nx25z\nqSUAfO2ksI5mAnjfdPsR/fX3XbtawwlG0Xz7IsNquJChCl3FopGdgWIHytiT\ntqymJOOw5/yUbuO31UfAcWUFrzTAoqtppcgKNeO4pvX+d3fm5oLLoB1neSU8\n/s+nEUBOe38Bsv55VN5W5WpMQmcryRjpWrV4Iah24SMqu9cuykZkttTuk0Q0\neewf2fXZawWL7ciZPukCrhUL2pbOI0U8NKWQqwfzU/F704403JFJWQb5Fy91\nAdh6LhhsbpzE2B1S8Zk4OSW1Rw5qBXfdfo6oFRGD1hvHmHd+rfxFsa3fA8GF\nczAsisGLjdCYEg8mp3DbhM6w4f21/FdCswRI/uXOSW2uPJi+74B5ypmZPcAY\nrGW/m07yLlZ46Zev4gQFHvtXsp0Hx6qKBZd0A173IqFlx5sVa5rlFuZgY4S5\n7c10fKq8+mrR7GhOcRzy4NhbLeIqoE8iSRH1OxYad0VNrDFrh63RgmVln73S\nJj7nPBMAldXlbd3MflSztlZJ5OFtpQHsWH9ht7G3rdPLWFFFSiTYaFlGeCMu\nSEZN\r\n=mL5j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAN2wRbxjq8jvJEmLhHQ7sUKvkz/IZhCP7owdt86MU2UAiEAp+OMGsAjm+hve+ZeZRbEX5yZ9NnsFdPPAbnKmmagK7c="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180915075522_1536998373400_0.9149799953031399"},"_hasShrinkwrap":false},"1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"df3674b21ae290417f5e20333ad998f121d50e1b","_id":"@atomist/automation-client@1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-77bSKCTbZiQzsjS25vzQryCngGySchE2Pw0eXkRegZXZiE1A3iSnc9EVKsXMSi8a3s+4q7BOEp5Q2o6pM34jAw==","shasum":"ef9d0e18d8b77636862e234d1dee631d694afbd7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159.tgz","fileCount":588,"unpackedSize":5145839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbniGsCRA9TVsSAnZWagAAAA8P/29rLYCv128Nx0A8AejJ\n+eHgEqjCQrHp5LraeMt30N+F5kCobF4H1lv9POr5yQ2SdRU/izW9nSHDP961\nj27bCMKG0aP04u2Oj5wUv8/NsvpBK4qDCdH83PPu6OvaS3njT7O/lhEyqYrb\nkCIasfjlfjSUg0aBvB2aPUMgskfH/fYdLkjCOT1Y+g2gbwSWp5TwpPwfR6Ic\nBmKAE1Yul/RCQ0GLMQCwLxXggbvHTWL9giPmfKcEOlH0laYbsSWu7jd4PSwi\nTDKPihTiSged1KaOHKPBgTzWLuOPCDv8nJpM+yDUg+Os7xN2Rr4w6xn/A7rT\nbIQeM7Xh9YNeLYwb8PN5zm/ofvRQOUwnGH0IY1hzRKff807sdyxwoTBL8MFa\ntrC+Lz+HcbLGFvNjS9UTZLkxNqz+nMIa5HFCwJaRcu7ciZ7sgitp89X4BFeP\nA9dK7HIHPTLdtieARvCOEeGWuXON7FIvUSzfYbPj/frPecf01UzmB+iMPC8K\nuMIjR8akbbV2hQdsZ5YLTDvTI1+tqaODCq7rvzoOa80e/buax/x0V9nmwoRz\nTW3b5ZYkyKrrF9IVETLoZYTeC9jHohRKN7PO3tRAG9w/s+5ZhYkEKmhJtxb5\ng8H5xDsKVkTEtQy0bLqicFEJPtI3kBKavO15rLihcMKtOYigWI+VOlRa/5Pi\nt881\r\n=I1PH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBofQX4kqJoEtT5evcQghhDNYfS4FlJYrUOdMZQXK5ylAiAXUOkggT+65kgwxHSVp+TG3h0QOxdd60troDsIPy+KXA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159_1537089963378_0.32272047939508774"},"_hasShrinkwrap":false},"1.0.0-master.20180916092717":{"name":"@atomist/automation-client","version":"1.0.0-master.20180916092717","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.1-master.20180830190736","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0ec006ef27837818cf11a7071b4b6b1f55e55efb","_id":"@atomist/automation-client@1.0.0-master.20180916092717","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pMyuye9vs861LsTU+6WfN7EZI1Asse999t0cZWE25AwEuEDCWewCJqcRetEJNqh/eTORLzdwYcNRHy0lPnNiuA==","shasum":"a19e380ba577696cfdcb1f3b61851bb97cbd82b6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180916092717.tgz","fileCount":588,"unpackedSize":5145639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbniLXCRA9TVsSAnZWagAATgoP/RXBbJP01CP7uS2nS2N9\n/37Meck9DFlN8qlgZDSPoRbrQ8/vWpJRw1GV1+OFCpo/29NYjHdcZNQUYHsk\neGhhEiiLE0jOSrbynOae/tSxIH7uthDn1xFj3T2GEcm4wy8VY9/QYkVR3+Ru\nFp20ACfk96AwnZojTxRrUKNZwniFajlMYxHw6HiqGjWkaVLdI+0orOXHptGJ\naRiT/cRiDzlUl48NC7UONYrKVGrBx3WqVDeEcW31SpmT0g2q1CW6yfcXB34H\nRo7mpcs0BiAJX+T9b0ejdOVJc8NR3PkpDFRTyz6IfpOfRE+yxkrd2+V1SUwT\nPlgJjqo36hF2wEpkEQPT8MFt6A/MsePfzBDqO/zDKpmpsB+PJu8dFHCPrOQ2\nEIetlkJ47NhapupwO1gWCLAlk7R2c8I2Z4dwIU8hfZ/zMsURnNVKJH9HGKZa\nfAFAEJqOn8i/z3VIQdq5hUdLrzgGNwBqen/FRU6xZW5o1r0dTsQVVej9syMl\n6seA2qs6zDDTAgQJZOLFGhGOZbjFNG6XHrT++8llMs9bowP206CnNc8pmI9J\ndiDpCMQNHAuVGuusee/myfjix++FxsDdixVIjp/YBxbnlTh6EJUQI5L9BwQp\nIfTZWTK/vPvEVip9KnNOk+5qIR1elqNtQrZEZ+WIDyuIQ9/HXuGxhI+3ldGc\n8JUa\r\n=i7XF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuYj33Yj/I8SXIaI01BXaNs1eefPEeFGDhTiIKM29rSAiEA7Yi/3vKK0GugvZA+s5xEA4KBhEezNIsJ8r3FWdiScso="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180916092717_1537090262482_0.688490986935312"},"_hasShrinkwrap":false},"1.0.0-atomist-update-1.0.0-1537090849927.20180916094057":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-1.0.0-1537090849927.20180916094057","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"da62cbeaebcf2e244f9559d5432d10d7a1c8e29f","_id":"@atomist/automation-client@1.0.0-atomist-update-1.0.0-1537090849927.20180916094057","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3VIesTTtshYUrTuQpfQLeKKl0vDdGZUhBT3XcjusG3b4u7g87xhqERFnlLtqwza/L2blb+NosZR8U0Mq7hmuEA==","shasum":"6e2856cb2da2a98ea61e76075a21dd216b3bfcea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-1.0.0-1537090849927.20180916094057.tgz","fileCount":588,"unpackedSize":5145645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbniYQCRA9TVsSAnZWagAAaWAP/j56cqUFw/Du6DDWaNi1\n+Xx+bRaGHB0X7kTJDutB3Juy5Aiby5N0vnowA6kwVvlwhDpSpHAsPMDetUmO\noq0T+q7uSkZx3jHye+m2jmCwGmTG9WCdQ2xeJ6cPvEHydBCIzP6KUkbp9val\nqh3o2xJZ5bt6zoY3Y8PRCI/Peqlz50X0eaQKbOCdw3+ZJl0sLYJUY9/ENCDM\n3d2OIePjehpchVsjWXdyb0kghTyT/O8/2WUUbM40iAoiITnc/Oi18sAApR3t\nssl5ZfRfoF4Iwo5Yja5tdFBQoE7W51crV21yjS+0mLQt3Q3ROpgoLaOgVc/e\nh/UHuE0lYwpBDhVOH0G2M3ywrhjAcHDas3dFOfXZMafYxGhch9xYX+DzXKkX\nE8sKFVQUEQ9C/a+cYUYvvlcWH0obTWUDQclicUAN7HSpaL9H0/V59WVPC0ew\nDpl93ckDaIZ4sV2UZiDpnoFrNynTLRDKi7TQ8FPdxSZm4ZgZ5bdj4lc2WK1u\nohK2sjlW0AuXwmNtiy4cIkYndRKPVvbz9n7sUuCW6Tt/PyLAP8n04lsS4P1T\nlXPR7x5eH2USf44kJG3u/CqLVaYZKcTfqi+tyNsVvHxpuiAWyusvWyeQvoBb\nMG93OaclnGo0admvx4ANqTanqqLRRf6BlmOqMGry2lhQdhiNxoh1zs9wFZXP\nMXRl\r\n=u4Z2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEVgjZuWlEUaThX+F0bZfmhRjw2VjE1x40/VReAsd2A3AiAVayvJbqzXmCioa255DnNXB7si9gCVuO+u7YwTfsIhhw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-1.0.0-1537090849927.20180916094057_1537091087568_0.6159317067700694"},"_hasShrinkwrap":false},"1.0.0-master.20180916094603":{"name":"@atomist/automation-client","version":"1.0.0-master.20180916094603","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e2221f12cab14a77b99a654592f48dd26ffc1d2a","_id":"@atomist/automation-client@1.0.0-master.20180916094603","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rqQH4diQ6fWgCCpx3C1JHQE1OtvkGpkhByg5cBeIkii0EyfDP9P5cMECt7Sydtu8rzcDnbbmjo8GYEaDCBEvrw==","shasum":"ad54ac9eed147c81ab36ede4016f3587ca552add","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180916094603.tgz","fileCount":588,"unpackedSize":5145595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnidQCRA9TVsSAnZWagAASI8P+wYxvODu/OkurjuY3JeC\nDeFd8Bmv4I8Pe5fYJP1lNUwezhty7yRsAsTWsvHBvKxdkZdGjP+IRHUeTClX\nCvKIqwSiLsqIt456gz0sMeuR2AGa6FiZW66Pvm/qawAalPcdnWTQugy+kMjC\nS6Z4kEOBEFUwEArZSaU4yHRTxvwXIu8k58AxtXPJkGp0KCjFiwgiDHhyzGFH\nkmJPlbyVDNX3ag80ajHQn4q4tr2BRT2XAIXa9TEhX92Ry38042iE3Bws1Z28\nF5mcGbyWkDwcWFuiqFALbx6r6xVdYa5QjKcWqx2zzychq08y9pLKXuonJGSU\nUjpZtViQFBIA1Ecm0ky8N9uANg59Zs3Fxw+qdqIv4dVehlVOmQXJVnsF2CU2\nZzACoMHpBqFrKfD89Y91nKtsdvhPVrvG8BlLa7WWmz6BQPCqe3qmwW62D3Od\nY1diJar7ZuHnKTB0+uvYxm9DgaM5F1DLvoqiNCuQQio+hb37w5ca2F6DBUqD\nDeURZnS4jGGfBfsxHhR/6I80Ym/Yq8HNMgiN7MJ6Jof2cCcMm4CPLkZYvra/\ncldzEk464yf2YX1jm/Cdd4uzzVdNL/HyadOv6GlgDrO2CZDC76IYWYr9ApTP\neNVHIJ9952oOJllEjtIkC4UgVRsu69aC483B4IBwifo3J7LpABuowWOoZIdu\nAjoQ\r\n=sSsS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz6yoihCaNGgkN6l51SmWRyXnak2Uh+YlUF7+l0SWhLQIhALRNtE7fAeTkQ0MrnboEDKP3qar/pjnpELh+s9ELsV0/"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180916094603_1537091407658_0.029036469508429974"},"_hasShrinkwrap":false},"1.0.0-M.4":{"name":"@atomist/automation-client","version":"1.0.0-M.4","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e2221f12cab14a77b99a654592f48dd26ffc1d2a","_id":"@atomist/automation-client@1.0.0-M.4","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yir59JPtAqYycPThOt4GhqXfFHAaFfvpswxdTp4QzSDVkKzQXkbE6sIgs9Mkxe5IrV7gk2X8ynwTTkOzrW0AmA==","shasum":"f4b93aa6437436f8dd3f6ead00970274e5d01b26","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.4.tgz","fileCount":588,"unpackedSize":5145577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnjACCRA9TVsSAnZWagAACQcP/A+SpcZsH/bf3TrhXtCN\nslkMhIKzXlXYYzZTtWn/6kLyg9BgeiVkWjntB4i6sLYMqjmVm5/37QEmeCeY\nNx82744UgDL/W5VDfiqMaWa8Dco+D+J9x67r0LH29n7/k8SPtbW2uE8Vuq97\nXk53JLkvTbPjQbWZ7EekRtuiRf3/a+aTwqhOAF8TwUakx9tHp/EjJ0JZMn3R\nIUmhJl3Z3x9XArbhAI7/xZYlMA8lLrdZ8XKE774DoMKNzn+uLZeBilda4AH1\n8qod7yFxkjbbsSnIHuCwcliqQflZBm8C3FfLGyJxH61trew/ktzBl0GNzuwX\nb2af+ePzQFyMEMJV3VxnSfTwZ7lowkIoRaYWiRrcRkqF+4Qk/h7bkifD9QGa\n99OcsPkG1bnUxhzGgEiF62rU24vi4cneu8xfgmwOKgydYvNhUPlcU2yf6b57\ntmA80Uc2OWmglPr9gh7+IGgaxs3Uoq/L2PZIHmuSp92x33eJQe5tGlI8ydO2\n8nxInHEj3jOxH/n7LcrpSNUhVfq4/Uh9WJcy5OzJCJmzUYMs2BmgCa1Ks12o\nuXmEZWfR30vyyLJz+O6y4o1VX1umMmagA0quQaxluelEkbZgNmugvkfTFskj\nFXTT5HZgzsI4OaLl4/nEtkqOxI13z9tY3rmr1BHwXT9sGJEjj9mEbiwcHUNA\nXnJI\r\n=WEDT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA483qbxMFWgIO911AELTbepBAbNUwuIZ0tTTElFKZZfAiB+DxqPXoc9tfBb96dRvkUC1ql04iNdDfYC3DKrXmo5GA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.4_1537093634000_0.014283152417743361"},"_hasShrinkwrap":false},"1.0.0-homedir.20180917191628":{"name":"@atomist/automation-client","version":"1.0.0-homedir.20180917191628","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5ce1c7b602001337bfc9aa6d6c1bd3475b54b151","_id":"@atomist/automation-client@1.0.0-homedir.20180917191628","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uciAx8pG9BmhLS63ByTFXUoAp8YirUhTjra/X9CJnqAsDpCeQnKiIXANFspMQamfAtiliNwczLpmh0pkGaDK6w==","shasum":"7bb23556626536913ff1e7310e7b183179e11f2b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-homedir.20180917191628.tgz","fileCount":588,"unpackedSize":5145565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn/6PCRA9TVsSAnZWagAAmE0QAJgEnKerM4GVs1Sq4VCn\n6APdQXUup2FG9s53Zjp6dnjG8pscm8unZ+HUqDeiCDXdPc2Xk6TgF30PWAJo\nbtzxjwcxGDrrSd1Rt4P+eqpFZCKdIX4gFZQTq0iUgp3hHDdgrvMmYf7kyxR2\nwCtpJ68qMJ+VT8y2b6zcL9mGEhul8sUqzsc4907cKM7CHBLRIkQB8+7O1AGB\nR5ZMj6HB/PL7le5wpB8vNCqz4XmXe6WZcdL9HKdIexclO379XFhyBay3Y9Bx\nOGoABfoduRcZFaQwWAyG0nLnpO/iS+2TIuJLgNAMn3hAnacU9QG7HJfJAYog\nY5ZVY8m/Mxt/5B+Tjoo51ZpR3+9CK3VFm8oD63QQ4pmaSY1K2PYvjBQ+yJ3e\ntS7p1aIzMePHeVmDXKOgamh6lgcVCK040fd1TS1WE3Gj8WR0nZGbJ6ubSogJ\nFwXR3sgA44flAPlkD7uTsCcbDAstRj7ozN56WFsJBQq9dwvli9o6xGRB7irT\nFabcZZTawbBTOTjTwCDgctuSLO6yWpNMPrlR67G8JA8+R2ETe9R4ZalX4eqJ\ncMHQlGm6TJJkMwFH36fwyVPYaSeBksohTTfZ2DbVv+9mWsWjYTEle51Odznk\nUgWvqxoGWp8dDxI9gl7QM6IuqeGiZDDPFlJnP/ou+SSOO4L1qvLieETp3XhE\nRi74\r\n=gs7H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApKvZKm15fDdk6jOGLCyM27iQwUozZF5FmZqCSR++sIAiEA/z7ajj720H5Hc0kgVW3++b+Ep6pViDSvVwgazcsxYBY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-homedir.20180917191628_1537212046414_0.9834181710387122"},"_hasShrinkwrap":false},"1.0.0-master.20180917210332":{"name":"@atomist/automation-client","version":"1.0.0-master.20180917210332","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"392f201b2f5fcaf4ca3d80bd2ff0bc370814ab6b","_id":"@atomist/automation-client@1.0.0-master.20180917210332","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PJljuwURY5nC0R/uIVAIClR3B6mn/hTMZiSJTA6tgQ7jQGf3ONxIK/jnjtuspjnBC/ZYyNsIaRlCdXQNiapd0g==","shasum":"d61a6efd8d006c776374f11dc0b8b26468bc5bcf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180917210332.tgz","fileCount":588,"unpackedSize":5145564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboBerCRA9TVsSAnZWagAAMWsP/iXqGL37M1F+S2yo5Kmp\nApJSIntoHRrtV2t3zoPz1I9xHHh3cRZtbIUtBRLblohWoJvsMiMPHE41/T5L\nCjbf4W7INq/T4UwRTUyi68EIG4SmPUXQa7EqFkr1rKrBLr4QyBgL+lYGEnHt\nFrzv76MLd4+xpvQogbwjD3NQ/3N5reIpPpq09UcQAdLkcYJ10gOpSodviOZi\nHAWjkT9x6SfXKUhG0KHV+bAKdA6qFIsk12VkSEcpVmjrYTYob2/dhv5MozfQ\nN+IArRsoxetSWwad0ijd1JpEgDWdTfUWfRW0qrbt02vYPGaydUPvzDheXAlA\nCFvSmeC9VVffvcffj84TQr/4BWlQ/XwlJf0lSqL/J61MjbGKLUptRWNnkvpM\nAq51nsu0XSPCZNKVncsmmgk1HSLo70tg95p9Mff5FQ20tv0YNSnG8emvu6BA\nMCPDUuHPzNd2jP6CBCe7VEkITko6/88zbJYVLgRzXgnhKh4RcLEz/CuACwkZ\nG6xqOlxn9us/QtDti5EGy1T02E3Hw+KL2aiB6pDGFZ3iCiJnUOe95QsjWW7z\n9JSOdN0J9+3Ow1XZ6sUbCkznIKgrCHt49+izOvyu2+SkRM84629GcpXWQYp2\n3F5HzkbV+1Lf3u7SPGyhrSpbzHqs8Oz5ytuh3kezySrBQkCwfHesiXpAT2ko\nNBid\r\n=kFgr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/Tcz/4JiR4cOEES+u9Bnlv5SH7sMDQQsFR9zY/TuUKAiAqQDenNNf8HhHqesgFjvlQ75lKHYW7Qi7buvqi6+4PWQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180917210332_1537218474862_0.9822433736331275"},"_hasShrinkwrap":false},"1.0.0-master.20180918005354":{"name":"@atomist/automation-client","version":"1.0.0-master.20180918005354","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"48143a5e4a0a5e2fd4823bf10df8bafcf0d8ff89","_id":"@atomist/automation-client@1.0.0-master.20180918005354","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8maaii60Kc2qY4GW1B4bMyMNsR1PsjMy7nLugejo70GWlRpuo0tPa14miC9KjmekAfxk3qFpAlZc0FC9RXLASw==","shasum":"5c6887a9dd4a8f703c7a10d9fba41dae9707cda8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180918005354.tgz","fileCount":588,"unpackedSize":5147182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboE2fCRA9TVsSAnZWagAAPFYP/AkxNVsAf0wjqiTHkktB\nN7ymHChI/JytASmTri7nnp4Esl8U4/0TQ+oc9KZxMFcjkTLQVS5sg2L7VJ9a\nI2dMAZw0FdYmjlbdie3efsXbx7HcaCe1PvZKjdalwdebI0PZkCC8EawPPjzv\nGPZ7qVT1SUk/86TACMzx3c26VgU+5KHgLjMtKRxvhYyrTMU1mBO52WJ9XwHq\nOES94J3tDZVpORzAbw+qcLtkh4vYsbISw+1y5A/e0hxI1hmxTzWC5zsD3j0m\nC43/eEMUsGYNjJPbHx9rdP32IoKOv2NA3X7AREeHSBZrrhrs6V8ovij9EopW\nbC5lyLEGUnDY4lugzIdaNBG1C7UkfPC+qqyeC31oAu4B/AZjJv4HrRy1hTw7\nz0WsmXKnQ/1G/Dfbo4Uy56JqsF/E7PVsQ4ZlIZa0vwlgXlkiEAbUVufvyGmf\n+U5+VU3P1Wxw9vL1iSUz02A4ES6jqOJIOdM6VzyfU4WH7ziIMktDjE2MqJo+\nHYnYC1hVH9EHhv8+Mact1dBdVbuQaOghdz1UA15U0y7OdLDMGBHt/tseHFdv\nNBZQDOzepYJikMk9nzPw50ZRWI28FUgqf4bjnr/NRc+3rw6OnhbsvEMm6Tgf\n9q66/E1Cj94GIhhlCLdvTCys3nm0NOSGlVERBXwZJrvLgfN+XHmdi+Ai2BA8\nnoSL\r\n=iqcv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAS61rC9ZnJ2oo4py2F5Fd3lAjEZGA/seJM3PAa2f55wAiEApVw7vuV83jwnMbZ4LDgF6SMIUb5Dr/fgt3OMaoaa5ys="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180918005354_1537232286436_0.9633185857002877"},"_hasShrinkwrap":false},"1.0.0-export-spawn.20180918180433":{"name":"@atomist/automation-client","version":"1.0.0-export-spawn.20180918180433","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3ffc15f4b74b520f4705ed796099cbdfb1e5a48e","_id":"@atomist/automation-client@1.0.0-export-spawn.20180918180433","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0pgZZGHVfCVDte38HcLITuyX21elCCaBaDmgOJu480Jt22mIptHLogAAgWnxifpBxdXUay7WOuOTKb/IZMhK8w==","shasum":"cdcd1e9d166421a81d5e93b002bb79f99257cd22","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-export-spawn.20180918180433.tgz","fileCount":588,"unpackedSize":5147407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboT8ZCRA9TVsSAnZWagAAANgQAJpLdGTLU5/4eDUSqaO/\nTkOq+0w/Y1v+sfk8i7V72n/uE23puWWSGPLZk1BQLtnhS7NFBNjvJrx1Uf6z\nkLZQMRfcD4uOuiPVgJHcwgTo09CyhZqaOEuELYVv/8uAqFnOhu0wNgZY9bGM\nVwS6zd0FIko2tGwVbb2GWfL9hfCt/67TgxpMPPyH1+AyMyW4YKusDldoD7DY\nqUB1i/fiN0bIwcohmvlifSx1WqBYoVdAMQ1odQkE5WQemOUtMQYXJlS/MYCE\nmhoyTLcafu2C4Z+2Vw+tbyXiTMCZDvdRosiAwrkUNQnJGyxLqdBoXOQFITI3\nCDhNJxiYJMM95SfyGPWr0nBDVZK9yrbcFHCpcA9GDuC+ZB0kvfr+EuKbhm7t\ndIA6SRufJj2jrI2R0qD8RWrMX+y8zccfic5pvvX8ME3m0MlYTZNMo6tG2/d6\nk92/PgsNCf16Q9f7ZOEuTS2AoSTHvZqwYFzDQziCpi+rnWrDcm/SWLTVZYK2\n95eE/XldMBZBWJw26HaF2rolhJko4pU7BODI6i8ZwwwFst13a2g86a1f+xX/\n8g5H/k18KKw+j2btmkFi7zWdlb5szrJj50KwLhzz1+ySmhNO2HHqds6cLERd\n7mTCUKPDubqDkXUw2SpBdSdAu+9IOHXZ6S7ASRSscXUE9Tx1uSzoIinFenkh\n/AXe\r\n=gLhR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZJwhl4pfE5Yd+xbVKpqdqky+gMUlFTJ4VM34UykJLTAiEA/o0otDpc82S6ij3RkdpETApytSbVw0CTOSWj3x+cOGE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-export-spawn.20180918180433_1537294104719_0.8241002078610855"},"_hasShrinkwrap":false},"1.0.0-master.20180918193639":{"name":"@atomist/automation-client","version":"1.0.0-master.20180918193639","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fd6f0989db17f507071071fad8c2c937ac80e1d4","_id":"@atomist/automation-client@1.0.0-master.20180918193639","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PjX1psHvPoPALF43oDRVYrik/66KEBt5CvaYY6aet1Czjcr8IKwp2YBTAWddZOUxR3d/FwdCMysmcc0UM/bjgw==","shasum":"3a755647dcd6fbb0aec6b7096dc022652da6dd98","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180918193639.tgz","fileCount":588,"unpackedSize":5147401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboVYCCRA9TVsSAnZWagAAzQwP+gMNNKotHCwGHwerkY5k\n4Uu+NesNpvM7wnIIdNKAbw/+EQ3U3aOt4xtee89W+Q6ERZbmiG4LBpEVFsHp\nTDIl2nwKCbgr7nxwEwdrQWHk65mtmVVU5LxOOD4pZDhjNLFEdRM22pLKUOUe\nBZ1Xi4q6xl33ShveOHAAryuIp4sL+LNnZlGFGxdpI99RwH9M3FFuGxmvw9+a\nR4HwczfMCP/h0EL33bNGD572+edqypj3enRG7e2kCgFsmsN47JmEyjY5t91U\nsYHVHfP01jSFk5R6tnV1hz1gFFa8lztY4sFyBleWaNNtSwiei665Jfi/utfu\nqZLS5yvQQYcSUrSd2atQbcFpOcXFlZDxCrLILuU+IP0VrmX/YSuwyxuRBPzk\nNzAVlQotwoMigIt8pgOEGJUvgvyU5O1A3q2wUjMcHu5hZznLqA7R2yVRwG4D\nNPgto61NdlgvrsRDkcpxjNNNS+DVsdu1tFdjf4QbmYUpxSuRXRgvxTexC9nL\nb6zNvqCMh2mJ4cPb53y48g8kZceJPhzPkG4qWC9qAXonxXJBscMpeex125bZ\nhB0xctSP5dYC9fagaEWnEj9oGYnUnWU9szkSTwrzUs+sAS23lInm2XsmMZg1\n1/kanf6o5dgWogB0mwgKKTXEwqsiY/uLu+A49YkerLkRAIzGwB2YJ+tGsTK+\nD8q3\r\n=dBvl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiVQKa4/yclfsUKQgtHI39khL57uS0Ru1PIjhDQp4TmwIgSZYXSDvJo23pb3l4FPnowpm4BrvkLMM6LYFJyAlUogQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180918193639_1537299969530_0.8915509466381473"},"_hasShrinkwrap":false},"1.0.0-cross-kill-74.20180924165644":{"name":"@atomist/automation-client","version":"1.0.0-cross-kill-74.20180924165644","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"73d4f586387eb282276b8648ed066ea8433c6a34","_id":"@atomist/automation-client@1.0.0-cross-kill-74.20180924165644","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FTvU0G+CYReDOvrtsqTYtY+czAfS/eHms4EzFBHL29iKFPCc35agfg4xlheSRDhpWjjx5IdCAYwOjz8Jdu0cQg==","shasum":"4da06556299913ebfb9e7f72690a7df8cf2b6a66","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-cross-kill-74.20180924165644.tgz","fileCount":588,"unpackedSize":5155671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqRh7CRA9TVsSAnZWagAAIrQP/0fyiXzml9y/05ckP7R8\n7cNxDyi/SDd4lu9cPbSxnxlsYyggUF6yZVLyZsrXHGp0QQTNo+L9JMnR7pzf\nYRZjF2CnhUxn2XBIOlmqlp6ztksQUEyzoNgEkC4LIS9uixEX5BCxJFGge8q4\neo7Ms5sOteG48v1E+fVYIPpG+ouUiN/6svi3nt8ndir5xUgBKc70JagP6hAq\nka2JkRMWxYOBpOWXYHiEjZfXdBImrubqhH1e0Jw8Fx1rhrg31Kwp6NzJHdKO\npRtVBtt0lilxX0BZAB/b315wOL/osa1W8CwdKCSax5T6A+J4nlEx4q3E/gtM\naHr+GofKXNwy//RXZt340tuEBF0cRwakVx0w2dXODc42+ibb6nmfLBgES/xi\n593k7dEzeH3OwSI0/A2GzBkm46IHrtN9gHLadk3oee87/76u8WeoY9KyBIBF\n/UQ2Ogp2+zrvlnxjtA30kDuCq9t5XLgLFqlxIbA4SoxSuXJ9oHE5llj2pHk8\n7i1EGgWbS83wW6KSRvjfaO1pbitl3Ct86c9ibClg2bMMywarIWBFDQiwJDZY\n4A2cKh7AEfZBhD0LjoN6Jb0kjdgIEW+vpN7HkNUd7JmfVgyxABMIIUSc+E6P\nR9WxW21U5mKqhQAq7LU9rL5dHmdB7vOHGjF49D1q/ifOnRlhTfhfq9de5dS1\nOV9D\r\n=4lV/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDph61qKFCZLKMASB7hOaDmbunNf21/ieOOmoszq6EeGAiEA70Cx+2KDys/zeCpo5cvDYhKB0tZuEuSveitb3gRNka8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-cross-kill-74.20180924165644_1537808506565_0.18348939310904533"},"_hasShrinkwrap":false},"1.0.0-master.20180925122935":{"name":"@atomist/automation-client","version":"1.0.0-master.20180925122935","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0089e97697c3eb0b94365220c1e17fe71457194a","_id":"@atomist/automation-client@1.0.0-master.20180925122935","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nqyaqjfNxVqstq6ZeR6zPqXXqydwn9Ocfql7flO/1CfR7vhkREteYLyAWLej4c8Zr77The/5H6KfjMYvACWLBg==","shasum":"51bad8e5e2e304838751fa1cba15dd8ff369d58c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180925122935.tgz","fileCount":588,"unpackedSize":5155791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqisUCRA9TVsSAnZWagAAtFYP/1EVribgRJZQlf8ip39V\nyLSgWNk/J/DjAT2w+LjQVu0JBd3xs58WLJ0ogbTilc0xyUWOUqkf7OO5YJSb\nS4E/PW64AOshsiBjywfcrIWngOUFQNwDP4ontHXb3zjv96vK/qjgU4YqB+8L\nkFilgST6x1+Kp5bhpMuksh/maI9wZkLMYD4Z0UOffRhqBu3j5G/7ubZPOzqE\no2fiNiKovaeSzm8LYEAzqiPAUK9YZWsl5Ylfd97FFkV/Jlw4zkiNywKK+yJG\nFFjeU2RxE4/vm9pUYaJOwgtpXxX9kzaXaPDW54AReE9Fpk5wjdQcgbYz2zSW\nubQ8o2fj3W/YIPc6Ec6Tw6qzRI3Mdv7ajSlwXnlf3eKme55vf+VZ+jen0Ohp\ncm7XG83DvF1KRnhsFfYhn0yR1tgRQJC7/3jiO+TIIGvD4IEpRvqLAKWQd16t\n3IdcJsEpN+v+4kax3SgmTo0uYBNFHfQz6jjCKTUZBk5LzeullGc7z/Uac3b8\nLCUxKO2fKxZETJAUh1TYgZbcBZ66hkHZR/3Kr/6g9AmHcsxPoP5HjgkBVsHA\nbyNlZTh1/R7XiBWehGeLOCu6UsjGV6Vl30DCh1D0Ut453/A0OpaggL4Dvyjm\nkm3wbCtmQB11wLCaBli8vC+FPI/iQwbJB9IpdDX3h/hYWzkP0hlHODTvbcWj\nITEZ\r\n=OESC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4TmD9/uyLQQYtm/pouoBb1fTNXY6cKRYMi/0JOLnwggIgDa+XdK8cjJTvxv985h8AcSDzp1KWCA82lybeVdApTHw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180925122935_1537878803742_0.6160149538854143"},"_hasShrinkwrap":false},"1.0.0-master.20180926012829":{"name":"@atomist/automation-client","version":"1.0.0-master.20180926012829","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8d32e55142bf11716865cc016eb2418b4d5895b6","_id":"@atomist/automation-client@1.0.0-master.20180926012829","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-IroiLQKjptEUF5Ob8/DRF3MtXSVXsQ5ebtFSXdQIeHX+fUw2UpVS9mgulGCGHugmwqEAwvQg6LzfLjnkCMiYAw==","shasum":"815b4b6eba604023bcc25159f73d3c8e3ea01a81","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180926012829.tgz","fileCount":588,"unpackedSize":5155916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbquFKCRA9TVsSAnZWagAAXAEQAJw88jH3ci13GhvABfLS\n26BhLtHABey7hwbYhMfGJOlOXs3XHbk4ah+I3JGbgKcAob1PXZyr48eoVpSJ\ncj1REW6SEtYOSM/BZqWioVYJJ6dZSsPr5ELE3BzgnhIWDeg+Kp3KLS5iUMKk\nOOWwihUmbI+uaEsIlj2LZAsPHjtBye3NYNrJPXFunRr6gVjxupQpqTiETDmt\n2kofS71/IwMN7cD0dS7WydeQmcEOdMYOLFCb6goE3D5l/giCgbpXw+Rgeq7N\nvf6b6GIl4HqVR3BdRd9Yk/0AAjj1RHdocFh6BDIo6Ye6RoVGZfRe3pIcO5ah\n1a0Au/nAyihKDMDuCUf7hWXCrmETlxsCaGdbbdyI/F8uQJKtYqLiXfw5DL7X\nojbz3sB36KAZcReRqWGMR+AO6Eh3Jmpbxt8e54G1oHd0wJOt5qJLiEM09lsl\nhx/RsmQs9TUSGbipNHY8ZXOfmBmIPm8oT3gNEZdfdqFYPsLA5Y/hlc6l2GJz\nITjcQIDg5kZrsqzNjIbvNN0Ex/4c3Dvqko5gqncBIOEE30brHgtpBCRmT8a/\nkvxp5IbxG7HU/HVMHt8WbDRh+V3U9/OtGmy3HG0HszeiJJ5x0LNqXGnS7l6j\nl1ix1lpLHfi9tfF2RXFD/L3Vb9UUbzth9luVpFtNtKRMhYESXjpes2O6EDsm\njUUM\r\n=f80d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUr4NGqaiiyPjkNbz3cN5JULUXxTCu+dnZ67as6gnyIQIgEbRqjEvDkpmKtK6pCzZJW045wJgD+Y+ns6s+o2nDXBk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180926012829_1537925448951_0.6630714285815644"},"_hasShrinkwrap":false},"1.0.0-master.20180926013425":{"name":"@atomist/automation-client","version":"1.0.0-master.20180926013425","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/continuation-local-storage":"^3.2.1","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8d32e55142bf11716865cc016eb2418b4d5895b6","_id":"@atomist/automation-client@1.0.0-master.20180926013425","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jtKoYKdGtOdQhrKIC5N6jvlXY6TbExOnBHH+2cBt34PiMnd742o3PNpqXLykIo4tJLVinJP0f/RbpSlJGRlqQw==","shasum":"f78121ef13929392fbc03faf686fc74d8ffe305c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180926013425.tgz","fileCount":588,"unpackedSize":5155916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbquMxCRA9TVsSAnZWagAAVL8QAJP6x0BDuWXpMP1EXecI\ngzcs+S/kuJGEDnEU95Npkr03oR/BdUni5RcKur9Gbom6aYnaAdaKSfWUFPSL\nkO0/FhkzjERkks1iOQsRMJaQXKzyLbr2fec3PIGh55/ykaZdAHWKXewwgq2p\nzPE/XfzawNtNhTxz+VVh09DZSdVU4JyqQImMF8PCZVbTWjoXbo6D/Gre8fWF\n7UOO+NSI4tFYw0+ExtSCVoiMdpbm/1rWTOu8ZcKfQHafwMrHr/lG032noF+X\n5MePKNyXMjD3uQSOlGDoPG2fEI5g5+PpaUewyXrGFIQwxzyCNficpgmTZ/9S\nctCbPiW6eAMbhjrgMlou0QsHyxhsvPvHR+JYo+PPMMxueZouEwzW2XB8IDlY\nXTdty/nliwnPqoAFcRjlBE7Tl4MKwXDzCn7QLln5Joml/NkR8+LjMYCT86id\nwHIAVzYwAK1xY7KKA1tRbbSR50L8mzIhcF827WZBDacUTeofC8sau/KgEq4G\nc+Dqx9IZV7YXBgZ44y+p7aOXzbA4QqWD5CXyOsmsXY8jZQT0og6mhD7ZUa12\ngoK8FZNBiec42heCe2+b82IkFbA5KeimV9YRZHO4exVuJbQGzm/+hSVz0pyF\ngQp2NJ5MEocOQEp9UT9U099hyPoVMzvI4RzFlWUf78f2dn/wop0Q+RsRcntZ\nvj3X\r\n=8Ng1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBFTWbr+H4up1s1p31OG+OF/tUJAmB6OwB4lZ6KvCZkxAiBma7qMgXRBUCAMX1btjGfVGIyfC2tnoF18cFMXRm0+sw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180926013425_1537925936091_0.12313884889658122"},"_hasShrinkwrap":false},"1.0.0-master.20180926172615":{"name":"@atomist/automation-client","version":"1.0.0-master.20180926172615","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5bd96c1a1924ed8fcc27713f33731557f1869e1d","_id":"@atomist/automation-client@1.0.0-master.20180926172615","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lVS/EL6Rr1ERSU2IpXy6w3HRHqmDZUjl1f6QXgpmq6HaoiTn7ZS+32CEdjJlHtM4TPAypX+6CFcckEI8kdN/Fw==","shasum":"32809ebe12b9771a6401b5972a8efc2cb871324a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180926172615.tgz","fileCount":588,"unpackedSize":5155713,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbq8IwCRA9TVsSAnZWagAA4g8P/1f4zZ+x7/tj0OjAZ+OC\n8kJ4KZsfSue9mfJEGASKdqbT5mBCMtXGjaDq+DQI3wDX+NZbnD0mdapyllR3\npiD43dZna3wobzchzGJUdqxEQUvjDk8zkouE7Utgi3i2tP1Z0O0bRDQiDZOO\nwNdytEHo/iVSOpeumBB9CbgwSaRkchkqr9PV3pIC5FgTyTR2gMWDmQ76e+wD\n9e42MzH9IypYZiK6DJEKLRTzVdlBI/lfiixyFcmkoLw4y179Ro7QT3uaISE9\nFpLP6aDCSUAuiFV7QqAHbjSkSc2RgMRCSOQDmEv0YR6+Qhy3JrDIUbkibDB5\nWiicma7IijGK5f8k82wEd4p0ycrbaoIpa30XSfq86qsPira0Vpzah7H16OL6\nTtGoo2l29yTN0QtPfsuyPRb67HClhuzfuSRVY75xIqw06YBRr/9gqdLIHrLU\nt8k+TmC7s9hqL6wWNPCmSpxyDwQcSN5sUUfbRer+EuJ6Gmp4c7Z1JpFIXl+c\nyKnKHK9CAxAN39nlnjTn3Fwu4HuvW060K4eKNEv2EAu8Duekh2Q7lcvyOChV\noEtjNLxlqwmHIsGjs7TEcwdbuavKYgcJHSaJPePHc2+SzgMaFo08Al3CSy89\nVr6EyyfxgCykVBjZt7LBSq44FHCU0fCt+pAvWqn7v+GhFOBD3yHjzNtKe4Ni\n+AMb\r\n=niJk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtGaue+CeLgaDlgaWLzESPPOKRaxqIuaH06OCBR+WDlwIgEbjv0ekzFhiHtsx0McaeHukxsK8A4G7FCYOXU8FvXzA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180926172615_1537983024128_0.1447499992708874"},"_hasShrinkwrap":false},"1.0.0-M.5":{"name":"@atomist/automation-client","version":"1.0.0-M.5","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"5bd96c1a1924ed8fcc27713f33731557f1869e1d","_id":"@atomist/automation-client@1.0.0-M.5","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ePVp88qn0MecOBemET4hOO74LDez2xzlHy/qd1NaKv+qwYMyMVhaTv0zZdPOZEKywKrC3zRRGcYzBG00utJYzQ==","shasum":"8f7a0ef1410606a217a7a4b95d331e5e52b82318","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.5.tgz","fileCount":588,"unpackedSize":5155695,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbq8T4CRA9TVsSAnZWagAA5/cP/jCcqzZxhSgKvjU7LWcE\nWWQiN3YWJ3uJFn9lIrODinW87Y003gzR9m8wb6DDghEya12PrRC/7EOh+XFI\nJIMUdnvTqA9FvZwu8gaIHGTTt2dbsPU3J+L45vCgFF9xN16uFyMnp73GlZFz\n/J+Wd14nt5rVY4Tbz5In9rIuR30XH+EGAiQuIoEokrr8xCLCP+OY6/ZjMERi\ncquATE/EcqmeixM/PBHlrS9QG4CWbrGlAuwMr7qX4CR4AZb2fUIDwY8LLD3S\nSCPeL3pEjufDlArL3Tzun3S5ESB9B9UQXCtQrDDJF8GYMkH1CLdxAkwPE2+a\n4kfLTEr9kL9Gg59iLVoJqBxN/GsJksenJlVs5du5JQT8qa2bbIzk/FUVwtDe\npn5weV1R19qYni1ho1AlJvFdEmw/urUE4PKqBpqGJI1jGIfeCPf/9BogfTkJ\nqms2N1rq7V/gcb7pJZ4SuYPZf8n5SNaMybu9cBl7IPczQ7EXAIcjKkPaSTh1\ncnUjomazLj4k6L8hJcVAp4ROz/J7K9VT8Ohealb4HDumootuQ7Uo2Og2sWFw\n/rF2VCkO006v6DejV+yA67NLO5yTBP+YEdd/PjYlSp18zkg0Y9/GCpmXf2ue\nawLiPY1vhe0yfftMc0JZKHgc8kF7TJRPSGBUCkSZbuY40pY01koT3FOP9GEB\ncgVg\r\n=wzU2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKokyLNzR/BKhYPR3YMZ6ESmgehvmmAsC0RPZw0YVAiAiANK+kvb22+pA8tDuDRi8hQoejTZhBLsXe/Im2fs2yDNw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.5_1537983735546_0.4934433696816447"},"_hasShrinkwrap":false},"1.0.0-master.20180927151607":{"name":"@atomist/automation-client","version":"1.0.0-master.20180927151607","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b9a15926f0eb30b8a8ab1305faa050a454f84b6e","_id":"@atomist/automation-client@1.0.0-master.20180927151607","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8TVQVuWwebL3vGTsq+cXdsfivD8VdAom3okgz9L16O7koAIPL/3WHSR5aBbAC+uRDeDeVpNUgJMaJ8CMe/hkmw==","shasum":"efbe5bef20f7815110b20f4d8f73064f7f7a12f4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180927151607.tgz","fileCount":588,"unpackedSize":5156164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrPUvCRA9TVsSAnZWagAAd4IQAJ0+T0jaPPyWQn1Ui23r\n7Z3wVWEY447XrDVGDhJXpmjLv9lOBbneZhJ4sipJnPZwKD6N/jLtD1yZuyEl\neQxaCUldLvRHqsYZniesMqH8jleeWf74ESWN/RzKlUbRFMdnLQlCfuq321kU\n76lWLORz6zdh54cjFYQT5ABS6CYD2m53LjBpHTHtaZ7DTfWvJ8uoG7YcymSb\n9H54ocp5Q2fqqZxO1bYtC/LjODZpYoXhlEbFAwlrVhgC0K5JDdtX7WHiJhi4\n4pkBrP18P3h+9fXYDItl3qWfFZeTWp5vMjz7vw/rLk3O4Pqi+sOryWrRsXzs\n2ImQF+KC+jIOSrPgOovQiLzPppzk7egTSL/0ORncZ9meaSG3BG2dZs0Q0s3I\nscIZayPwO8IcFcxEyTmVk9CslA7IY17iuv0gOlgHd0yLv0dF5DhmErLihCAH\n+5LD+8u5is7cj++KYXL1IbaFg0r4ejxkJw+oWgNF0FAWMxjtr0zPYLX82Q5x\nqyOWQ1h+QPFBNfSJgrNh73ummgjsA+a7lmIHDa6otE73YnkJStaus1N/d+LP\nNe8F3eNIAe1I328kv8LMS2Dkw/KUhdHtBwUHeTqK2Lb+7FNuQk35DHLQvNfd\neUWtvXQixVssu1qco+Ry9j1SHJ0BRwoODI3ngpay9njMC9LHOUn12hODqoiQ\nqsM9\r\n=29I9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhuS6PcCJoRv1diIR1PkfymOSeD3jADiyLabWw2i3PXAiEAniBTsFhX08l1kIxiefOLRZntlOjywMKmWchf/tBqgWM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180927151607_1538061614069_0.28966777767789065"},"_hasShrinkwrap":false},"1.0.0-master.20180927210106":{"name":"@atomist/automation-client","version":"1.0.0-master.20180927210106","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0bd7fb5b605c0ec8e6d5ba342a490d353e124297","_id":"@atomist/automation-client@1.0.0-master.20180927210106","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0ni+eZwiR+8nVTUSmLqZNF9cK70KJg7Lv6rowHXG7ly9nsuZurZAMyF5LVkWUj5lscaZQ0gP4pHwxje2dSByYQ==","shasum":"acfc89582abe63a406e5e4f1bb7a7777ddddb27c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180927210106.tgz","fileCount":588,"unpackedSize":5156165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrUYhCRA9TVsSAnZWagAA/ksP/j1mC1c7BzSr9eNGNgBw\nhF+o1O2kWzSp3o+af86o0jNfoEp5Nh/z774qML5reWXoSqwFPvqmEyA10Yxg\n0RBwwuxy3eGCLOVNMbajm/lJDeH4Pm633Gvc2d56XGnYbQTyLxjORXserrZ3\nlXIM5lV32hmLPwkcthR55MxgGl3QP0u8pV5UgdedJO0zlpXvDzBpq7eI4u/4\nuNZcdP+mO7rmJttt/PGcTZkuzJRPB1AEZpFqNk465vigk7yRccl/OAuYQ/KY\ndqK45zzM9NIbeIJ1Orw8y1eZj6P7B5qnpKVDiNPVt0iIU/RX601L8EAOJMl/\n7fjQI+R61AiEql1DObkTuFQGPRzbKo/IvM8IGVOaQHG+MgCfefVeVyTuozlF\niFtco5or6EKcqhAc3flzFN1LklcSItttqWxMHVgjnGgBjlV2bZ1gGBnSCaDx\nHnr0oVjsoBtMCauKsfsdnncPvqqncz/0MJAOaTmIjgreWx3qg3yKxDjd2fKG\nd7DTJW4TOPIPSSAH+fxi19rCTxr+IqUe9G77H+auAqfRAhvwIAexPVA+WKzx\nA21n654Uy4rNLKx4YRdi4FNP1pR7ZDDLD0wE224D8LYGxtUMMIjTijAKNMds\nTwiQlPPO6TOvHJyJ8eiC6B13TxFgVj6wUOW4qS4nNx0Lp+XVIeMo7QnHBSMB\ndsF4\r\n=Pm7o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICYHz6w2S9t+xCGeUOk8B1oC1vZlpkeCkOFYlxOLGZoxAiAU5YmpB4YXMqTm9rq3tWWx1GFcrn1GOuHsbwyu/G11xw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180927210106_1538082335580_0.2563453755096512"},"_hasShrinkwrap":false},"1.0.0-master.20180927214650":{"name":"@atomist/automation-client","version":"1.0.0-master.20180927214650","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2a13435f4445a8c82da78d0bd691bde7dd8c9b8b","_id":"@atomist/automation-client@1.0.0-master.20180927214650","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Hy1hIiFZDADx4KepW4YXJy2Qc36MbVU5/ewdqZ0/6mU1a7LBUwbJ5TnzTojfMrOzlCnB6wgDy5cSvWjRS6+w+g==","shasum":"536ffa7e923c7ca6ff00dd2b018f3f31109f2b17","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180927214650.tgz","fileCount":588,"unpackedSize":5156165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrVDACRA9TVsSAnZWagAA9rkP+wZQucUzOBZPKmebKYVy\ns3NqRhtkmsXAI4U5OPmqH/R+Ux573x8jRN8OvuVRhrTaocbafmMBRPiTCaxJ\nDTl4vDuJOqp+T1NzimLrEhIE1NVggIo0R30A6JOlDlcoF5deZyaSgTi0vWiH\nZ8SX4i+99bRMPVY1CtSrA0num/7f4lDZOa6vfpvVUXTNU2YKea/MccDMZNdV\nDDXYQpJubR4iQuHAyRD0g/JhSHHDsfgTLLVLQhH4/mE2XOT4HdIUCmN+Pg6I\nMD4PN8U0JFgEuojbKkYkOwOOTXD1Zp+vyskPUDQqw1lMGTyGVjEfDS4jSYls\nED79Od82BRUlS+QKRB9uE5A1Mc/34XUBnsNqZklgKsPVv7S5a1Errxczry9o\nc9GYJGwNm4JxBajG5Xll8OUJN5z/5Nrg/bZ7tOwGBVPXYkEAC/3p/FtlpLII\nzOkTVRdu/D/2Arag0kz7YuhaDjSmESBMxn/T8XwYUgximbbYzACkp02lLlEu\nbzEgPECbHgBwK0k2HfQHWDavwgunygtnx/EAaXG2M81MyZXYSsi7H696/v39\nnK7z7WWdg2ULHmZMVSUC5QziBWd6h6FkQWHe/ZK7kbxNYRtdH2wju7D1dU+P\nU7GBJi5eXKMT8cJOQRWbkGStsiJfhznbKv9XEKbsXVyrbmxII6zwyGY80WxF\nuJrR\r\n=f74S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBv81LFNTPX4oWvQ9y8+HuYzZmHa+9Q0myuYEnXMXfBhAiArqDxPJossA+DXwhH4PQ4MOBP3yac3cn+H0L4Qx94sag=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180927214650_1538085055335_0.13051166292934657"},"_hasShrinkwrap":false},"1.0.0-master.20180927220715":{"name":"@atomist/automation-client","version":"1.0.0-master.20180927220715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"https://atomist.jfrog.io/atomist/npm-dev/axios/-/axios-0.17.1-proxy-fix.tgz","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2a13435f4445a8c82da78d0bd691bde7dd8c9b8b","_id":"@atomist/automation-client@1.0.0-master.20180927220715","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-g97sr/agIpFnbw2N9lAWnnd/8keZ7Vh3xn5lO2OFzvDqUMo8uxIsiAW6Co95Qknga8wxLizitSHp70HY3mTV4Q==","shasum":"8cdf5f2f56b1b884a8826a2acd2d770147a35055","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180927220715.tgz","fileCount":588,"unpackedSize":5156165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrVVsCRA9TVsSAnZWagAAOGwQAIgiLFIGj8gPQ6TvjCNO\nkiB04tiRNSZvoRNwCaB/lhPTeTRYwaYluH8w6nEhsPHBXzn8Y8t4Dlnt089p\nyVWdgMcY/zr715ishLSr2WKI3Od3Ssp3+zNx5iypoOsCC7lvTWGYSVElqUoH\nL/T3G5Vn8wJmzHQZdZMWfccMOgOuaWeigd9chefbCgna7YxRehIjzZOUqtcS\nhPjTayqkkUxFnXxlc7bdaSo4HvKR9LUjWycavaphqAIti2oqtDv2HLM6Rp9z\nkqBUFGJwxuXdS0SRGQM3WKMVz8JMb85c9vrsUjbPAjMZaHBNEseRZhTw2i1G\nJr1M53lxVZUzSTB7vTdj7YE7O+yS+VEZ2vvxIHFphbw8P9QlYorMhdeFVI04\ntRvnhwkXnSOwjfQRBJB4ma1fW9zdrlfx52l5M+iMru+i11WW+t53R/lKJ4BH\nGFz+CecUKEqxdxn1HIIH/FjBZdFCHu4YG832C2VXgdnA6CJMnWyzorAQ7prG\nkaQEKua2jsR67PywI+Q7baO4ps/swC7bHE3N99hdWGFJA6532PdQH1A88Wv6\n9P1zaZcYbMs/LfAR8E6oNUvz5PT2+eQR4IhTRDu15tSI/GzYtjEoMx2wwO7h\naqXGFgonWtT+n6IJT7D/h/aV3Qddjb5c9qW9BOv2Qc8j1zurE84oIuWH16VO\n1tjV\r\n=SHNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZsIFFM1aCWeErcgI23vOU/1n4K0iHZ086ERLpn4aUNAiEAlPD4YiO90hK4kYHnmDh13hl1h5y3dD4Kcu6Fm0Umslw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180927220715_1538086251671_0.8955354954805927"},"_hasShrinkwrap":false},"1.0.0-axios-upgrade.20180928063238":{"name":"@atomist/automation-client","version":"1.0.0-axios-upgrade.20180928063238","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"73ef001319800117735291f5bce1aab323c62563","_id":"@atomist/automation-client@1.0.0-axios-upgrade.20180928063238","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QsyX7NbhxlEFFZ5q7HKSugsZsl2rmW2YZkEc6X5CLu2XOjfT397tuO1+oXnhwV3jdYkttRptUyfO2Si61ZHFmA==","shasum":"a2ef95cc51d54410749b6658ed4893cf48b0f449","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-axios-upgrade.20180928063238.tgz","fileCount":588,"unpackedSize":5156110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrcvhCRA9TVsSAnZWagAAVNUP/2W4ibgjUntSB/HiBXHC\neqj8HiT3wh7zrRv6u9IiR89/uPkVmuPkneDdc5Ifwe97SIsb1ax/D5C84eYF\ncP7Q1hHRvNP5BZEj8gBipafRRV7tAhd6B7UNIoAKkqDWkE8hG2tMsgPrSWIZ\noAvewogyKGsb+jAbMxLGCDNnAgWKzmv3npOQpnmveumUgrSxb0kIOK0LVA2p\nFQqDll2CiGQEZXyfX2DvlK3wFVDIb0ZTixaqgz7TXfsYt9bK3cB8y4/9G9dZ\nqRL3aUIg1BOGgI5nfteBwMNME7j6AHc71JOX1JHEBCzAUxcWnKj9i6UGKVQv\nJkMg+iZ7Q5YOl4aFMRByF+lShJkZu3f/Jw5MInCBQ9Lo6H4pPhevhRbmGSi7\nn7EzWm1bdr61+Q3nd5HTp20MGWmFOQ/jg0XRbvn0DS/nN0SLIEThm/fMTyYb\nEsOsU6/g44r7g+lj41RZEUsToUh6yWl6aY4OKIKW3VJqFFUBmtisrlxak1zB\n0CqjgCQCKPpsKZbolU0ig2rmZkqQpqScnHC0lQqoHeU4Zjty77NfmylyRdzO\nZAneT4/Ys+VvE12PHXh7wtFNr/kvNDlKCgSLR14O1zX925FIwVrgKhIzRI0Q\nCE0DBFxEg7YJpiZP0bHMpi5wnO13MQhZGkPXq7Y046jQjau5rB4D0DQE2TY8\ndq67\r\n=BcPV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+tdRnCAAQ9LvBbVTR2+aWDrNE2JYMWi0kCqGiWYynJgIhANq0w+xfVDr2f8q3ExvQTJIxijBejglDeTp7eSgxDBsS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-axios-upgrade.20180928063238_1538116576370_0.37551674206885477"},"_hasShrinkwrap":false},"1.0.0-master.20180928123454":{"name":"@atomist/automation-client","version":"1.0.0-master.20180928123454","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b9cb122180614fbf67ae837ecb467c5c5ad1343c","_id":"@atomist/automation-client@1.0.0-master.20180928123454","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xD84dr23LzQkIbmi8Q+ft8hxs8u3QcopCaX4P8paGq7O2K9BGHmylH0NDQaTLPtiMzFOcsRV3csmD8ju+yVz8Q==","shasum":"48517902b7540cee66496ab04700e396b68ccdf1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20180928123454.tgz","fileCount":588,"unpackedSize":5156220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbriC1CRA9TVsSAnZWagAAcdkP/iO6bRDXO+1ZwLdGYdRa\n8m93G7dBlw689mbqTMhUVvX0BkN75slIcl8iwzmaq4lzF8mFVlQRKar+LQr6\nmh+c1WgxvEcOWiUaq3sYxl8jt4yo7qshUfhapLt+TfjMkSqZMgGxDLPcbVqs\nW4udDJbBinzpBH9feFpuSkiOacBpixvEZChqSDR9RIWK9ZKZL3eS6IQiPuul\nhOPm7IlHDqR3zjxNNiYkbOPadpdMPrXfLxZ4YcZUqABCiB/y6Ox2SYO0S5HI\n/OnFoq/lvtWJ5fcrnTU/dZlZ/eyEjZG0c05nDGIAJ9H3brMgdVkVO4t9BZF7\nlqvsXyvKsm3S7g46RKBKbkK6XFnhiRcODNsIbi8pLXJhAC7jBlC9VP8cqEOV\nTpXigOc6sHO8MJfhPbazgqLG5WyTk+UdoCkES8Q1HDARy2NGwA8lHgsC0FsL\noyJzQaqKhJIK3Jvihungi8KEj7HaqIQL7c/0+MpuvFpid3oV0kQFONXEOURg\nblLJAtUk9FP0QqDjWpBCnPZQTMOWYirtof/a3uQtnfuoryRc1XG/zW7n4tZB\noiZLgUb+Lpt4JC5o/qfj3x7+i3vUQTRM+4wPIYt7C0/FRmbRusZzddLeX1pM\n5pKKEdVvi4QWSzJAZZ2p76gR3R06K2ccNEDwpT38hyDI0SzdSEawcceFAxqt\n9LRO\r\n=Fi1m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBftkVgpzTd52JOgkROnzLjmp1Wzh3sZ1CSY9ac8LHVQIgKqrBtdrFAok5YYijZhE5gMo4A7FCjvzaNZ/8aa83pGY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20180928123454_1538138292784_0.5711003515337669"},"_hasShrinkwrap":false},"1.0.0-M.5a":{"name":"@atomist/automation-client","version":"1.0.0-M.5a","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"b9cb122180614fbf67ae837ecb467c5c5ad1343c","_id":"@atomist/automation-client@1.0.0-M.5a","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KMuYMyayjjpMDqzGAnw3XZxGqpss5FFHSB2RGwABF9CNb0o1JmPN7MpNBGYWsXI7wGo0Mr+hanxt9B7HGkowjQ==","shasum":"07ce36e16b042ecc9e0972834c0e34a77eef619e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-M.5a.tgz","fileCount":588,"unpackedSize":5156203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbriiwCRA9TVsSAnZWagAAyyUP/AjaSPHmrQF0ZOu50+Kz\n6ORj8iFyvfz6LNXPXhJ0SBT3NYSXKxM09kl5Uvg95siF7FfBAKGgQfLzig7w\nyP0wD1Gw/Fyy1OOwXKgh5ScD/RRCrDiqRpOJxPCQ9MYfWWiOo4MX605JDs0K\nXqZ/WeCf2wAc+yWiHrY7GITn0mfiDx+O22HfdQC3NgCgeksfxIKiSgIhJTnU\nfof9hGnDLpDWwQhaQhpykFf2Plqnv11tHrAzJi0I4n/JLjWEUyjIM6qArehN\nC2wDvTrkfp7KNOYZyyjdaswxiCCKXA3I4y397Q8ubkEQ3CpcuDrnIBh1H7o9\nqnJiuP370dkXBNqSMnGsZxNWSn1pWoSAmvz5tElpqcpqDukLkiqfZzuXSWXD\nLChQowe4OBR5M/T6VLX7hkxVF2cY6dV9UBHv25Y87mCTszgcyPcGFGzhF7MF\n8K7dfxxoDqLMDipumfepWs1ScS3gn5olNozTct3MZ5O2EA2PyVilSCoEd21o\njh7J8dR5WWBAhFrNjp0hA9HY4xC7TouZyTbjxtHEU1b785r6BmpSQYuxsX6C\nppffqWfk8uf27RygEGjLEbaSq21CxuWT0tgHiRr0T3xr44kIU8PkPsQs4kmi\n+VPnEwnud2iuscJF0ZfBiFdx1twI9KE5jV4Vx+G/gcHMpR+xAzT4s1i4YUMC\nLp4+\r\n=XQtF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGX+CHGmyXBexY60EZYSSL1QYViVy3ZRO0G+gtF6iizuAiBOWz3NM3rG74kWDpvfyl2uCjfe/vDM8kvz1AV3oV5Bww=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-M.5a_1538140327243_0.3984233551870422"},"_hasShrinkwrap":false},"1.0.0-pr-body-name-387.20181002211851":{"name":"@atomist/automation-client","version":"1.0.0-pr-body-name-387.20181002211851","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e0b52c65f1b16fb6633a0e58ae0fe6af884c1fd5","_id":"@atomist/automation-client@1.0.0-pr-body-name-387.20181002211851","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9PSI3Lhw9S7+RNnv7o6DPnB/eJtcaTgX7oepkENXVLVT3Qvkc9n+ZiacW+8OGWF83PVWxJTZDwGSaN+OdO7iCQ==","shasum":"e01a1c7d3cead7ac179691e6946e68ee77d2137a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-pr-body-name-387.20181002211851.tgz","fileCount":588,"unpackedSize":5156356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs+GxCRA9TVsSAnZWagAACpUP/2OxJkq0vBUHTfVsi5f1\njjQMBsvzyXrlLNQG7EhyZQdu+bitdRzxOnim4VFhEhjWPmjoTElyLLfwUOSm\n2AO/t3Tbb6SIrP5Eez15UnV/QXZF8wAOXPJTRXlG/rYhxns33iWNXApslkCg\n+yH0+Fc9Bb/Tmo2zPlDEhK7CHUJYEzU25Ng4gTnC2A3e16ADhgHEHzNFiP0d\nMZC7fRKMMbUaomtzrkJDre+7NjEV+WU8s0ArZQymLBGP3SRbSnOZyyXa/+PT\n08GnvuKxRkD6WU2b5Bjx+n0CZjvBsxEI2XrN/8F9LS7IrYXASzG0n4pCwEy7\nilMSefRvcdmqjjnKlCiIfKIecdYcapPUrzrVpzNRzPabwJXo401Mn40DaeOz\nu3xtcKC+u8qe1z2cOs7IBg05KAoVaXFyooe5VFEzi7jN6wxPhrTHnWz6Mjc+\njG2mSTcnZ+oxx/a4+949tSG/GRToOUU3MRQ2BfW5M+7Aw48pOt5A6Sz5m20e\n1XBRNFydgwhEiJYX+obY4L5ijIIgykvJQkudruRbio8a8wsQFV4pSOSe5J1S\nFw/L7+xVmz0mJfjzEHzzrulAuYsVyJExALgTXMPfLORz0qIfOnmHqPASuWjw\nnjqYvAOs0IkVyHsnt65iAWF1gFibm+kuVxD9MoaP4TqxJnPgodrm/LJQeKp8\nw2n+\r\n=UxzA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClzqw5hrFcYVWM3nhBn3D3W6yn68ZESMnw8Fc9OxrbnwIgL9Ukn6P967xg8CnCtC/ewqK4ynXvQMOYEdROyWXqE30="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-pr-body-name-387.20181002211851_1538515376257_0.5154902310845486"},"_hasShrinkwrap":false},"1.0.0-master.20181002220753":{"name":"@atomist/automation-client","version":"1.0.0-master.20181002220753","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4606182bd854f817ddb78735fb5ea484c9b05d48","_id":"@atomist/automation-client@1.0.0-master.20181002220753","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bzBDMDI1Q9DvVwidw3I7eQbel66i8Z7HY/AsTPdICq71IXWfThw3QIOK9EAi2GIfFt1hsQ15wCWS2/htIwtRNw==","shasum":"be185739edde180c0408699734b4049c69c91bd0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181002220753.tgz","fileCount":588,"unpackedSize":5156487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs+0GCRA9TVsSAnZWagAAW7cP/iz3zEzbO4/sFKYiQgWf\nMx92ASwo/OjtAiBit4vk3wdt/NXGyn77QH5fJtOyY23IWNEp4WLsdvvkqYxP\n/9bCxrwoRJCrjV7n9WgUEvp17ZNvJu3a1A8wyPpFcdK1u++SLT175qaAF+kw\nrTQdGBAQO2offZqbXUHSQhBLlpXJo6PAopXf7scxm+0bUXBdwmOxS8y9T8F4\nzEdhcbxVgs4c4Af+pV+6u4h2C7XB3bv57th1w+oRfxGNE0m8KN+cCixo7HRY\nfZ9Ng71ocVTFrxH/0B6dhO37NP/IeRwZZGBIk+MnWERsbFiROEuRD80miRYS\na029inJR4ROroBy4kSOsVO0VJvcm0auXAg2y91e/O7OqujqL2Z3iQP4awIz8\n4nkAd4lVEL7K36pvtFDGINFN8EMS3tV13eD/iWAE1+YXqyuJW/Nz+GXUyI46\n8Hf0oIphSQFAEJGHHAeGyKQforvdPibeHGfsG2y5I+iSyd15xm4A4+5ono3f\nwkYpZze09SkwwwG3rz2WnWs0MMFov2hWfWlQd8nObAwIPWL3D0xi3uI7pNY7\nyYBNfex0EKJxLaG8ywsJCluBXA3TEFYx03YXE3XitanuRKudsLzgdB727nrS\nJ2sbb0y0ylkkFE7R9USRBuIAKBTVyrPBlpR9oxicXHc9oR9wSbBUi5mrz4pT\nHxFl\r\n=Y56n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAW/zirM4b5zAo8IxtwV4gqKQSexUBSlqZzD9E29uNF4AiBMsKLLquHHEc8RPBJmK7ZOe6vd5k1BWY4ucDz8nDK72A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181002220753_1538518278081_0.19007052414966985"},"_hasShrinkwrap":false},"1.0.0-more-export-for-sdm.20181005201538":{"name":"@atomist/automation-client","version":"1.0.0-more-export-for-sdm.20181005201538","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a6e0979f27f4b96c3d14a59156e421ddf8560d63","_id":"@atomist/automation-client@1.0.0-more-export-for-sdm.20181005201538","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LHPJoXhtzDCOQzwy3r2AnAztk0sbjK8qi1Ef2qz9IL15tdyTKNtGBABF2HMMto1tY4C299DRCQCVHC14P/Av2A==","shasum":"c66d5c064354b7ebd6d693341da8568ea6452e3e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-more-export-for-sdm.20181005201538.tgz","fileCount":588,"unpackedSize":5157797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt8daCRA9TVsSAnZWagAAKyAP/2i02yz8DMwOurJU1gG8\naYqz9FtpLAu8yMqKZKKzZ6bPMGbXmWZVXqDVRwuDgwwNHIZ/VB2fENL5zFbs\n3i2TcRnhRTqoN706mRrS6UxJTBkrovglpwKJKLJ95kXm0RKvxwWXh6zsafjb\nGwScQT7NBxafZSjHYi++/Jt69ELZIqxtkLHsFwG4odmuFQxnex4SmIs8vCEz\n7ZvJoN3+2r58b7L0dVoMLBhtWC40ONzHqUE3SQzpGkAA/yD6VwDvkuzEdgWe\nN2alILyxoe3j0pc5ikOb9CAQ1CNH/O8NrHlzQ2IpsL/lqNUSYLUqWJmDCLhe\nWMQE9X0L8BrkpI8N2nD3R+rcOJZZp5nvojvNybXOAuXrslHgnyqApdq9rM6A\nIUEzpIYY2MQ7UMTMG2NYlgcLnKlDfInPx7u4ZLhEBjfz0T8Fy4Am/yFHM77Y\nda6ygusJHMoqH6q5/nAsBaq+d2wkucVzlNiEgV3YdHKSkNwzfml/g+0c6s4W\nbNYhqkQcPYmekh4fMUouORI9oTKYLgHS1K/rJSXya6mjux3uE06hhEZ+x3iL\nGruxKhsUF/pdin09GxkkqWwzYIVmYFZ7FL8T87OM1oQ30hV9kLHq1xqV3aeU\nWbNSzqTB2LQQm3gnFYnuG1WlengcdJrwL4Hsg6pLOgFZxynMG+fPVrYLGx8L\nLg/K\r\n=6FMU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHD8Wh5UP/8Yc5aQrZzAjJ2xe2oEqIrZBF7ZuzU01EZbAiAkMoWhRQjLPnN75t0+yqOjbdmROvRVA3nUrHD1cP5Q4w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-more-export-for-sdm.20181005201538_1538770776523_0.0615835677443648"},"_hasShrinkwrap":false},"1.0.0-master.20181005204759":{"name":"@atomist/automation-client","version":"1.0.0-master.20181005204759","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dea4e9d2b70e1fb08e8139eae025a257b7890a32","_id":"@atomist/automation-client@1.0.0-master.20181005204759","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-eY6R+J+aHbfOO9zAdcLnxHHEr0YeZWRr1H86YNuR9ebR+ytA1dr1whCNUKye4TMX3cFS2lJcffUYvt6v0XQWQw==","shasum":"89b2a431b332706a2f8b6e69befb32cd20661caa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181005204759.tgz","fileCount":588,"unpackedSize":5157891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt87qCRA9TVsSAnZWagAA66cP/3c01kfOMd4peoVeJUSc\nbGF4GBMZHTeewja+LwRIng6gQllDOKihMLrac7vWLST8h9+jF4cd7vlEFkHR\nk6ARmPbcFEf/Fr/YfcK8serhrKWscP/uh1E/32YxyxuCFFVcNAi2h9DqnIRA\nI38OHI86XyP1a2QAmckEn5wrxG5Rhnl8zsif3Hs/HTpi9QUErPyYZwaQMQ3H\nINMc7G1pIN2HTd+gxrdd1+i1HbNbSMXQPhS3ioovKJL61DLFlYQbT3+jMFQw\n81a5Twyf15AkhJGQKLUT1tD8P9MlY07QIuEGq1CLSE1DTG6GHGPeG3359EsF\n96aDOmpOnJjGAzWk+nGxiWW6ewdjMAJkBUhWT1fCZVSMhI8/sph0mUup9mKi\nOKhkz4SWPK4hCQy6Y05FXwpuzmEHeN7DPvm/IQnbEsUY727aC+JpfvGavyR3\nv7YjmU48kdYGaeBwuzKDmcbgZBSSv9rr5CJb82ABA8K8dbGiPSp4Q6PTabQd\nLiN5a93i4uDChc1FX54TXydWKC3mVprByIKSIMnWHrdWzewuoYX8BZhd7Ruk\nRDM1dK06jXPVEcmWL2aBZO5neQo3R6fsAS3Jy+w1UHkMFM5v/SBML122bdKE\nMbsMdpbc10eWSYCj909bpaK2afxmCq0DZKMr6LjVdCpIQmmnzoZGIUAsfR/n\nie2k\r\n=5PNz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCI1aE1QMl5FH/IrhyBWY+thVsgWnnTU/oFIUi+I2aCogIhANgYkXjQcG5qmKVljy28GFE92BlqhJpy7p6SPP7S8zas"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181005204759_1538772713889_0.4767969409971169"},"_hasShrinkwrap":false},"1.0.0-master.20181006002158":{"name":"@atomist/automation-client","version":"1.0.0-master.20181006002158","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3a364bc87cfa28f79465e1e301533c868950fc62","_id":"@atomist/automation-client@1.0.0-master.20181006002158","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5Y94IXeFdg9AvBH0VeODWx61lL1Uaeh65DF3X5rgjtfPEdxJuoHgiYljLqDjHRUiakF9jUz49sOoJaXAVL4y6g==","shasum":"84d2664db67f3a48fa9e1902c53c50c5f0053ce9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181006002158.tgz","fileCount":588,"unpackedSize":5157722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbuAEWCRA9TVsSAnZWagAAbTIP/AhdQ3kuC95oRBxsoN+m\n9bsQK+s8811/GssOQxWFOrHwnNrPRzkUx3Ckt7N1yBKmvJWZpu8aWXZ30dH8\nkqGFYegWP6j1+qxFrtWeRC66rKaLIxYkUbimUcz8QLlcqu5ecY7V/1Rkq6GY\neI9MHWswQIsGerC57k/Qj8R3TETNVkrZ/1aUEim3cYJ8O8fJC+lrtzRciMgE\ns6BY5gdeccPRFqpMfMamXi2rZNA8oKW5128PNAOervr1kvKsSvSN0I2Q+zxr\neg/n8n2U1OtgkevCuCP8tfMKgxh5Q/uzePMvUhURrSJapz7PRN3aFE3/E/0n\nwatFhkbI/beHomHpz3qBey1Unn04hCpExrdO6EO9E3yFgh8CETynMyyFFlzA\nUnco0ZIzPMHfNZicWzcgjnd/0xXMmrS3NCepJECXhIt6xWK9eCelrgZX2ly4\nVFGrYmUHvtQZsm2gC86wpqekgp4Vqu7tWmzhqPDnyk4WV00+ea6Gh66nQWAU\nhk0Qr4K5G1uHVJb1sHAFrhmLTvMS7r/8EBPNGsz5PWEqXK0mqWTBoG5I2Or0\nu39CvTewIY9xWTZ+ko2Zy4I2QzulnAlExCxMFzT2bDauPGgFGle8IgCpbb//\njTD4jYp5h+UEGAdqXWUSSQMMWobtEQwUsbDIyTt3G9Zq6hdlipRD2kwEG55Q\n/Yjw\r\n=4t6q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDszgcKWhVSCjhAlMvraerE5fke1R0vIlxreCm4ReuOWQIgUZUX1F7C+Wcj/Wmx/RSYMUV0gvUP624GwOEM0VlXtl4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181006002158_1538785556696_0.11168924264244073"},"_hasShrinkwrap":false},"1.0.0-scope-exports.20181006012153":{"name":"@atomist/automation-client","version":"1.0.0-scope-exports.20181006012153","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b36af1ebe495d924bf8cb6aaadc9834dbfc6a9bc","_id":"@atomist/automation-client@1.0.0-scope-exports.20181006012153","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Rv/p1qyvDbS/M3LGC2Bw1miN266mWCzwBY8oz2glxgSlswpsR6TZj9kgLy5J5679biss5zdIP/FLiNFLr4o0Dg==","shasum":"d87852473e0125c84e962592b77c4ec634322c54","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-scope-exports.20181006012153.tgz","fileCount":588,"unpackedSize":5155614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbuA8dCRA9TVsSAnZWagAAx/gP/0GbxQMmf0bf/laA/g96\nyfquPuyIVR+cZbp+Z4GcJNSVkfFc3WsUDJCZEzWGkIvIHZ7Ulh4rAVJtNdTQ\nkywCtXfPg9H5bK+HLWTSBBqNvCcT32CFt+58M1wRRokb7U8P/yL4KwnRheym\nw1Tv96DxPNm4S9YFeYpyzaWSx1uEjyQadtxXKyAhP1IFFjL+FLkTzTOS3QQp\njIziS0nwzkCdMUcqbdtVImqobUStr0VQiCX1CkiFxI+Y7t0t9Jlh+mPKiJQ0\ntLAK6dKgrppQwfK8K6WQdOVr67kKh35ZpG8K69Pgi4o1RtPrAiR+p4V+dsZo\n2IFvnmNGr0Apxs6v0PrfWISYcLyS3A/jDZLVHutiJyrInHDcEavRc62z0Jvv\nSVE2m8F1iiQYEhwWZIjA8BMH5N6hOD5jmDJchfvmJjSRZxVyQIRWMltmxSwu\nlKRzGiaIzFLyzMg5JWwf8AacwWTV5hA24aY1IqfLrrLZ+WCP8X+9l7F+Qi5C\nMduAMEwKpWPPf+XGYpEKvxLD1WXh4NsjSV0/JTqdCYvuooGeemVcy3H26Q7j\nAO7lrB5calpPt+zAV2M12EyqUOn8hY8fvrIDlbXkTutf1K7ZCW5cOgVt48Rl\nU7EQggVx2heiYDozxbuQtGGFHEULzlYcntNrAjyOEdXT2+HZEDCFrjDOZndO\n5qS4\r\n=X9IC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUMqqE3gUwNnWrD6G2USzTgi7/QM1AyqVHfIM7e5KNrAiBKPmF4cRf4m+dhv630zOvFUxh/cbS/NIjzPBwZpHWBTw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-scope-exports.20181006012153_1538789148481_0.6291277311913681"},"_hasShrinkwrap":false},"1.0.0-master.20181007143042":{"name":"@atomist/automation-client","version":"1.0.0-master.20181007143042","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f211cde20a397b8ccdcdd60a1f1feb755a02ac4b","_id":"@atomist/automation-client@1.0.0-master.20181007143042","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AlIDlQ/K9NopKnuV1P8oe6SenfTRkX1Z1S8eFx3Dow1W/40/sWXk/os3OLgp3CmQrs4vk/KFAyYsRz8D3EX0BA==","shasum":"510e33afa6d6945e21e73422ade74590c697e9f2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181007143042.tgz","fileCount":588,"unpackedSize":5155743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbuhloCRA9TVsSAnZWagAAbbMQAImIpdSmfSsgnX5VzQYh\nHdj669Hz0uulQj5MCB1riSOeDO3FiR7jOBQEo6Ms+WAymoxUyIkmX3r5+l1T\nwQLRUwW7KJY9dCLeoR9WYWLM8ygDA6TxhIRKUoXYlDDEBkpFCvvUysqUK9GW\njrr/3P2FU9q4DCg3JtoizMoQitfTXw1d//m4VG54Vxs57jTlCDNpCxGljjnD\nQFYI3NuxnZAmFIcEUp4gLUJxz2ee5ei55IHZlXBZ4IaoAhdL8QmodFt4rJaM\nj+q8kgM+7H3oZAytGKwpXKfBLq4ZQ/oUSeBKhQkwbffOCQUz0D4Xu1p8fh9m\nVmMpXzgM6gYszFzK9HIE8z+h8rdz18jyPndCfVddsUMyGXapgXQN+32nuRGo\n/jQh1H8GxVAJGXxfTYibLUAWNdkpcNA4/7gaurLSCsXK7tm7i92dx/fbvwc/\nCd/XdTFJfH1J1Y6l9PrLk+pxxpq48oJchOiO0evh33zSschjELrSFDxO4pSU\nWIMM+qI/rHnDKS5tf6DuDEIZ4lmZz2x67o1/25vsqBDGlqXFYo9rzJksBMqg\nXweRbwmxQd6s8X80Et5Pg9dH2x5+BqYP+xLDdsevD6jt9sxnoOWdCmipN6Zc\nBxEbK9Cfq4X50NYF32Z/3YxKS87GsDfGDc3GblAsLkY8J7CaGRep0RfvhQdi\nxxf7\r\n=zae2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5s1TsY6GSEbcsndr2c8uvyVm14iaAx3805JIOB+Uh+AiBtll9XSUxrnJZTDDl6AulNDl+Ib7d6r9gncoxCMw2mBg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181007143042_1538922855868_0.36031369707398264"},"_hasShrinkwrap":false},"1.0.0-master.20181008113855":{"name":"@atomist/automation-client","version":"1.0.0-master.20181008113855","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3110034a16f57f1b7ce179c4b1305a0d36ce548a","_id":"@atomist/automation-client@1.0.0-master.20181008113855","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8wD7UKVddxIQ6qCWBvG0WPo2YYPV2QRdYNrIlVnAf99TgpKsC1gTIl18kRg9PJyy7XkhffX68+euEuJUjsrV1w==","shasum":"9449fe7c3f343b5a25dbadf3395a5f20c512c832","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181008113855.tgz","fileCount":588,"unpackedSize":5155804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu0KgCRA9TVsSAnZWagAAZB4QAKRwZ7zg+un4lScys4us\n1yg23n7QM976d1zqxU1bT65zMURN2WwRANSJT8zIcWEadiKyMSbD7W9Lt3d0\nqgcdcQBIwH6OYIVzGDhQWypgS8UbZGuZp8I0Xfx4PfxVZLcPZNKJioOoYBc/\nVOgI+PzU3bKxLsEU/MByspYrOYtKBroHbF4AWqSsAKZDnWR4oqR9rzFxYqPk\no1ng37dn8twBp6oVrtXPSaG9vMQ1GbbKdOEjLG5E/NBZ8W/X/ll4cAE6Qnuu\nMr/vj2Vk9Hip+HRF7PqmRwWLiWwMG61hMmNOHxdy7NIjeGfcySqe+hlU+6oN\nhHJ92MKn6PdNT8dGzdORDp2b7vZSmMsa8+ba5XsNrBJAe+2+RemZrge+GVao\n/roYZ5HU4bnqlbcoJ+TPjYhGa5xxfvbadtfbOImvSmpQqdPYSc4QpqsLd9jO\nZvCDz7hvvwSNz5xHqt/jM24Piqc7dOqh+lz72WVyHkKA/AmFzCvpxDUx5vt4\n7cQJp+dxpIUzadKPOCBggicGEAI5OwlEIdxYOM3ro++lZCyalBChx7IweCvU\nGz8kUntSZqAwUo2DbiEwgeW5U4dpFPWMFEV6emxWq4ZGKRZv7KurqUXf7i98\naKCTcTm2H24TRR5+h96E8tMFMWHMsa9gqaxgFMYvMS6QiztWqYM85nt5+fNG\nB3xW\r\n=xYsT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1E0ImhylwYJl7GU01xRaSm1NQdFVLO0fFqgyrDvjo5AIgG7nx8hiVhFAT6UVIrqo6Y61N2Ce39U67UBnbEmyNBBE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181008113855_1538998943713_0.48059412411346547"},"_hasShrinkwrap":false},"1.0.0-master.20181009205007":{"name":"@atomist/automation-client","version":"1.0.0-master.20181009205007","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3f8245d2d64f4080d5ed5e715dabcea430c02fa0","_id":"@atomist/automation-client@1.0.0-master.20181009205007","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-e8ezzZ0W6y5n8S23Tszae3llJTqiTLKdX3GlDUmd9qbzrJYYO1e7D64LFcsqQxNwjzEnL/bbvziTESNo+pHckg==","shasum":"2410d827198ef467383a71222ecd011e17d682f8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181009205007.tgz","fileCount":588,"unpackedSize":5158896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvRVpCRA9TVsSAnZWagAAG20P/2UZYSMG2wjPxsU1B8M1\nvzjyx5MZP0u+bYJ0hP71g2jKOPQwSk1Rf8d9z5Wsb6PpXyJCj9p6bhZ1wXEP\niv1emQq58jEJ+YS9QCo48AwXZSxJtkG6VtlmuvC6DvioHOPM1LcqoMlyqV5a\nJ1m4PQ4RUiwIoinf936wiV0aBzZBMTzzxFqxoaxl0JufEHFtob9qizZUXi3X\nRv4z+qw3xo5dbZ7FhixqyAE8y8OM76BJRtAzpDU/3r/SeErbE7GM2a3T6pl+\nzFKR2mWT4daJ8gM7nS61lpPWH9OuK/8E3Hq08xN+PMCqx3CM9NYavdAXabZ6\nIWX+rAhbFkSiaP6/XQoaIfdjjFhO22WSQvtFUj6lCyqEncGR0b3CJvK0jEDl\nwlQbCbMvvunHlh7wcKUqBQ8yzVurVs3gxRONiCpUsXCqckjdqAFxdfQavD17\nsue8Bb3JHoZCp2vDKQkOvyErkDDdPrWCcYzHRv/ZybA+XSHDQqEwI1Tc2yFS\nTX0spDpvMF28AUxh4jOc4QtqHMvslmaKCEsIQT/Qwy8zvtBTO663esXFDVJX\nEhEVjn71y3ISmoZEKAnYICN1OgSdGDexdMbbbeN/DuUrG5AP9gCLaLf8HjlO\nv+XXTtjQeYNeOgtGZiY62TkscnSu4+t/1KUnGPDNFsAwuq1ugL2wp5DagJdx\nKjWR\r\n=BsQP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcI0fM5QQmUATxYruZtgk9gVXEspdZY5NhXt1UbwUFAAiEAii9R/mqRBRYezu3M0jS7W/s1L6cDQu6RyrVL6vkpGOA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181009205007_1539118440588_0.46366516543962843"},"_hasShrinkwrap":false},"1.0.0-public-index-391.20181009212723":{"name":"@atomist/automation-client","version":"1.0.0-public-index-391.20181009212723","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c46701b9ee950d9e03fa4463d2f485f40d5a7eb6","_id":"@atomist/automation-client@1.0.0-public-index-391.20181009212723","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-bdGy1m2IsclIpL4gh1rC2Dz2hDXnLSSNh7g0/gbnWntQToN4aun1Cf5QsRqObb+zmvrO5TlQAW+umO7ggIKMSg==","shasum":"b80d6648da433ca57139dc9312021d2dc64307dd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-public-index-391.20181009212723.tgz","fileCount":588,"unpackedSize":5146460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvR4nCRA9TVsSAnZWagAATYcP/2DMv41eLDfHcXYkEBxj\nG67M0SyBN1v8zvcp8z3dk+P6a1EncP+3U23a0eUHNWbcijX5uACEqxXLAIA/\nir+KGfAGtrtIKE85qbWOnVwQh+q3rCE/pdeARArUx5oRyUXBGdBo6vsI7+SD\nKmWcfeho3NBh0iAoVnfeSB1kKSa0xZk+0Nd455o1kNHOaEkIBAGTeD5yJyi5\nwSz0vT+x9HESBvPDxlOWDq6yDFe2nEi1V3UoXuA1z9RgyNxPBuYQBD9M3zIy\nf5v09QYptg2JCoOazu7Qt6hrbWiQGQyZZKZXryIjWhE3TcJU3h0GWckVM9tG\nFYUcWFwsMfzYb7GrhzQCMzzlvXE3bVDCRdjWKxaiRgy74K5t6qsOWgh8cwUa\nxHgGTcSw9x29q6C89J576heIpEuOjqNFQZIqaUGKRx25knBUpcnOx5nJRVAB\niiDIg6zCl3UDpQNc8v5rD1p4D9vz7z8O580oYgmj/jso9A/WQ/du2xwqUwHR\n4xEsUfew/WD4LtMiVeWqE7wIBhltnaLJiJjyzmpzURd0eWwHIsM06XEBgyem\nr+VSIZCqfUmjVP7sM/umQ04ya10loD9d7hysKcuEGkGs7VbSs25D08Tud+y6\nCe6OGhkqVHJd3iAQGzsUCBGZJ7rnMzIZ2GIz3FBLm2fTQ7BBd+OlEqGsnqng\nWnzA\r\n=I5Br\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYuGM9MvHnoucN+QGdKCvJejly3P6lnQgT367W5oqj/AIhAOSJabjp9rO2FR+gI5jprSgfKquoZISJKoBapoAKWXgn"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-public-index-391.20181009212723_1539120678252_0.4368945541960698"},"_hasShrinkwrap":false},"1.0.0-public-index-391.20181009214138":{"name":"@atomist/automation-client","version":"1.0.0-public-index-391.20181009214138","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"655bdfd6cbb857a8223a56d9e5fadbf63b48512b","_id":"@atomist/automation-client@1.0.0-public-index-391.20181009214138","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uxIbUJ61ng4UwFQJz8TWsTlLUqZ+yJPV8OHL+gBAmu2+cMykAdOyFxDZ8tSdUw2TCs9JMQBgWhnqYV5kG3z4TA==","shasum":"8739c452e3fc76cb1657ea0d741ff5315f903fc8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-public-index-391.20181009214138.tgz","fileCount":588,"unpackedSize":5146600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvSGBCRA9TVsSAnZWagAADOIP/2XKYHC+FOtXdziQcHie\nM4K5LYyceJFQFxZZLdTZ7/oqZf6NXPhoGXRxA2gK1XwBduSkChYTMCgSnmGz\nUqrP6G1CuRpA5+94ahQdkmx0jXhB3EEf+bkXMk/9Xdxtbe6/9dd/c2wcmjE9\nwjaUO9llA7KZu6+c5thMRxa1xP56lfPB4JB1S+Fgj7T7J7IlIzBz9dOlfEKB\nZjF08UlWl2wxUxiC+809OzX1lNBtMIAlLgifyjFbr8UMAPB6b4+bSbj1qGxE\n+363BVncQuFKGquBKEun4G0NbAgX6ZpG4Fkn8GaJv3ipjoLUTcTx+4yDRC0B\nTrGSYEuvwVekxZjaaRBl9aqj6D8ixWeRd0h934RPNjyPNlcgHB+gXlOKMgOU\nXeZISYXWQdL2lXAG8U2FoWQil9ipYH4iOzza5nXvM0b/rmGbI+q6hZV2LUne\nG+X9HuLrA/JXL8nszW3soWRyQ77BkLwLeIELchma8ka6fZKw2bAb8JFcnEGF\ncEyydbU6J3CClnohiCrVtCOVByYaQi/f77rM8rCfkYQF1gekDUr9MNFQNprM\nN4sdrQ4xBbBNMGRkVnGb3UMNgJRo5390sQIQnvo6+DWuG19zxIO9Du6+OP08\n2l5iACEiBAJ5Z8+VXtRmV3RJSff2wWGojXCJ3p2Xi+iiV7hWbBsB4W1ue5Hi\nmnNX\r\n=Zs5+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoleMWTwcwAzEh8jcHJ4bu1tmvxxluIaOJZTD0Wox3MAiEAs/O/rZW85jkKLvtahyueuG/2hcFeOH2j75HI+SPc9GI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-public-index-391.20181009214138_1539121536935_0.7974086828602134"},"_hasShrinkwrap":false},"1.0.0-public-index-391.20181009234347":{"name":"@atomist/automation-client","version":"1.0.0-public-index-391.20181009234347","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"78734ce6b3128050eb7fbcf01d15af8f1163f524","_id":"@atomist/automation-client@1.0.0-public-index-391.20181009234347","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-iMGCr+lF0f7oXnjw5AjVX8Quhz12CpNa1rfVFBUGxz58+qEG2RM/qG3ykI5GDRtUCOdu1K5sAJntbBCoClYRAg==","shasum":"20725170cbfbf91c3cfed94ea65ac55fa2a3dd8f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-public-index-391.20181009234347.tgz","fileCount":588,"unpackedSize":5146710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvT4aCRA9TVsSAnZWagAA3p8P/iZblSQsbiBcjyxt1wEe\ncXTNGtWLR3AzkmhbQsUKOrQhL3AkOPG+jRql0ME4PJOH7XNuM+Jj21bFOn2S\nS9+m/yPA+qYlq3ValNHMTrDW2VNw0ZHxXMGGuaMp1wCdr1p0J8A+mg1qOk1p\nXUsfPwVwkpAJOvCQAPmWEmHHft4yOj5SZbLfjWC8lDrSHh2vnJQfFipL1AWB\npIB25UKkpOEvVRY2EaZI5dGtVMFjNLP3Z1SQTPB8DkzxMbQFpKx5Uhgf0xId\ni4JZscwC6LJ9FEQxgSkI5WuEwbFxhvofTxJLVnHw7y24tMuFslT8Ouw/hr/W\nv/32EjaTMjJBp8qIjqqIy+6X9cQgefQvuJ23saM2ohy6klc/RVsrqgz2d/+8\nkNxp4HaNbQz1Un8+TERSB4RyLapEYYD8RkNibtFkPJYB1OCGU1+vH+QmesFv\nqDVDxNXBVyQcaOTuGJ/uAczQHLGZIVH6AleUz8SsqYCUKuBlsZHQhfSRMX8O\nLGFFxsRu4Am8MAi9bt1Bnt/SNhkTekoeTSk1ePpUN766HJjhxqg2VCFnWwcD\ne/NMhWoC2FZ3y6xBus8cx04KJiuFZh5tJz7RqaLe/W1M6ccliJxX3v2KfNeG\n2Y/5chBSnDm3S5Rbb3Mkn8NweJGZABjb2upzpmuwiScIar4CnLYHw9IIyIb2\npYsl\r\n=yRbq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrU3EzIvs069EGlG0DHfFcL5kM4ErwvvDZvhN7l4t8fAiBZwU7jzrp9MiYi+cG/TuRCNX3Nf7tlp8hNr2X2agLJNQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-public-index-391.20181009234347_1539128857414_0.43455847645814694"},"_hasShrinkwrap":false},"1.0.0-master.20181010065455":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010065455","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6be54d37ea530e587031a997074deb97e9e3c327","_id":"@atomist/automation-client@1.0.0-master.20181010065455","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yf1s/ecgFnlxWgkT+tTwDafgNvbQI3Jh6XnFwJG8c5VofzEdrNYGSlV3ufolXccnFOTHanJ059ujHsZLObYuQg==","shasum":"5d3aeb428d29d4d8511b6006682b3062bcd6232e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010065455.tgz","fileCount":588,"unpackedSize":5146822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvaMZCRA9TVsSAnZWagAAnKEQAJN51lfvaNF3VAQUqaSQ\nuvjzYR4ksz8yCHgaC0debklRQOHkALlNCtz/giJS2/ztxtngO2CRyLu/wvti\nVps3oZOKSWwtIJ6AqexXIToJh7sPqunczgvkkV+MlYFMhCamI7YeLDpNkn3C\nKIBQctKnn3+99XrG2uQQl0xw26AHXaBhcA+30+i85t3mf4pEefejjrMZw8RC\nDRc5AsN6nANR4y2h97WPfHP4lE27rw2hxbzC9laID53+gNSAMBbpoTOErkHT\nA5Hs3UR2ly/Bqo1pnm7BzQhQ/FruBcnd1yyqusWLPh2w4Hht208mqHcPvF0t\nmtwKHnAeXD3098HNAzZp47mHM1Gjex+UwTy1wd0mCPlAwZ6VyMYESD9bNYeZ\nwMtgnNlWYfsf51cNJwhgIEDYswh6f/qBptpTbos7Sg+paEgHOwEOhJLJIsQ5\n9O1bd0agSyJO+OshpZK4sSlOuIO/XHcIFzR2JNVkrEPYCPnIf5jgYAC4oEGI\n+3uYkwLPKM9gkhuwPzCMuUlZxjfHh+nmXDMWGR0v5TOpC4/kaGcN+Fr1RK9m\nJGCSnSmPNaJY/CuNoEE3rKSSj9K09cTFqMUV/2HQ1g6BZHVtcOCJFxTRZCiV\naa1WsvM2uQq/7aoTkofETj3wVabu4k1hGmohCw7e4n7we9CwMZ4PHMXsJE3g\nGMRD\r\n=7+Zs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiLNwc3AT725GB+E4HnNtC9nmvUx1KhA/zTzIehGYftgIhAOgYesBsb+rDnz14TaEDL0Ux9/90EC1vsWD2f3lAn7SS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010065455_1539154712801_0.8791870068162948"},"_hasShrinkwrap":false},"1.0.0-master.20181010072947":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010072947","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a48a6aea0e8661f04faae52211ede3ca9b944aa2","_id":"@atomist/automation-client@1.0.0-master.20181010072947","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FHW28867nEtZsCPCLhXq4JG+8StKzb52AQkbzpTzoBvPJukg+4X+3RuJLNdbl4YdSnYixZDdWXJLMwIlvk0Gyg==","shasum":"50724d00763116d20c6cb77b86501b9c2fa21469","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010072947.tgz","fileCount":588,"unpackedSize":5147193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvatrCRA9TVsSAnZWagAApDQQAJSquQydw9dPm6rWbkOV\nYQEYGb115KeqP4HEhzyKhkA5VMhdkvnSKe2ZDl5TNGyiuhrz35oEZ96BWcyM\n5+7xHLZO1jRDf6H/ENfOrlPinl5Fb8apymK5nSVDkMchBN3cx+CQ8+d49mYl\nvFePaJXf5NaykU0RgJBV87mYgE/lnz/zHUqddW2BLhX7I87V/WQBbZAUNy+p\njEw/UGPhcN6M7TNRk6dH18Jpa25h53+66+0NW/OwHmJlIpNjn7YeuAXECEUx\nYClwOAiJwsbbwfv6b1fegguKzIB/VjoxXG2aSlM1OwI5nqikh5QBFtFUHC76\nDlb7eHQYz0ZueAp7otENk02Jb7hdXn9X66n9aPbpEEbaiaYrPJtL8P5sjBlj\nnJW9YQuNIgMe3AZMAZffLTVScyVJxcfmJyMH6K35FjB8cIZjZo1y+aFf7wAG\n0APBrmp9MlmAEevZjnTKwk9x3k8/JwUyArReSjDh92Kqxqwock+oljv2K1ay\nwr8FV2f9NcB3TDQtlHfTFmOkMOHCVKPWwy74jAaJJQPAAmxvVMl55l1fyEzB\naIzb9j838Yy6OgTbAqpT9x4OO0e1pyCn0JuDQRDCln4/s8RrpWlq6OMPKgJ4\n9VB1cHmLtP62CEN4CL3IMH13cYnTUxryITzI02BkjWZgzI3q4EOngFs+YtJI\nCLPo\r\n=Sj94\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHCgSWOLRrfYy38UumJuI+9p+jJlaR5S2oqGr8rgzZjiAiBkGJaShEd9HDmV7EGwqeCyzgEsvi15U+DJuM1GIbatEA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010072947_1539156842777_0.4063515710154906"},"_hasShrinkwrap":false},"1.0.0-master.20181010073032":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010073032","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a48a6aea0e8661f04faae52211ede3ca9b944aa2","_id":"@atomist/automation-client@1.0.0-master.20181010073032","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cEnXnuB6psam1xB8H7qTVo1Z1QJ45s+NrcNVFnoLP91DvI5mZ30PYUxZ9QjCQIaArdcxFD692OnQRGyeyJa2AA==","shasum":"c7b5f0be70ab7bd30b487a014cb973f04e93ca03","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010073032.tgz","fileCount":588,"unpackedSize":5147193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvauACRA9TVsSAnZWagAA7UUQAJdcJZH3uWL5lq3uiydu\nDrFCFuv4zhSYy12mNmiixno0tz3U8FpSIiG20LfqC+5RKfxby4+5vH9vjVFL\nXmeylqp8BqQzJyNO0i5qtTEjRtcGj97sgVIAknFPgnPHj/YwQzSpV9u/fRca\nAi5zCwe+1+9I3xupD7WgmUvzGBXUVxa+Z+yPTDlulH1J74SAYSKSD4csGs1b\ngmdCuRfZgEExerXYlFQzVP21vaO74cTJJmnF4QBqKtnZnaGgxrYa7NUJEeWl\nmDrfsV7wH5uVSYgPtkdBvtv5eay7D1HZvM7nxrSxLD4aXKTCjtJ7Zxa8FZad\nEQkjJY/qq59gbaCW0EgNYTGaD2gle1nd7chK2N40qi5wz+SKE/dPc7HZe7so\nVVTz2vLiedOqSC7HXJ3qgZhmd7Eh1oLgwpUr375QBWccf8OjhT6bGR6moV6m\nKmD8mtEBxQoMDl+vGmSRoGD5SNq1NNPsoRJyuQN2XJ9zZYCc9TMT4nJF8dRU\nzP9VRYuVPFXvS4mNPVE+sdbl6m1fDwX3rSxSLmmyf2iW5Ki7AiCrfCa/Y16D\nTHCL+smBPZWo5xToaXWZyDrwyOH00b1V7eGiIzkRfGVQzAf4/yFmHBMySk9K\nmWSqSod82UC5eBvjpZCuZZ1UoTiF5q6zLZ4znyHFSf8fX/Dqp17JqaMVg98o\ny2uw\r\n=7Zve\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2VkQo0o82CoFWW2NmlKG2a/r8fNlG5JEQnDiOvL6HbQIgS2LNhtLVz041Et8CuiTiu+NQcIDPsRLoY6U8WHmN9e8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010073032_1539156863887_0.531752709582584"},"_hasShrinkwrap":false},"1.0.0-master.20181010073224":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010073224","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a48a6aea0e8661f04faae52211ede3ca9b944aa2","_id":"@atomist/automation-client@1.0.0-master.20181010073224","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-alEnNHdV5x/mYsRx/x5vmHjKlKI2pd/BzbA2T8lO/db+MuUi8zTWeinwoIEVnRdedeKKtW75R5a6QCX8+esFZg==","shasum":"cb072eed84ff508dbad59eae1ed99a9f93c27db7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010073224.tgz","fileCount":588,"unpackedSize":5147193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvav9CRA9TVsSAnZWagAAvxUP/RcGHgubdgUcFqL690s8\nZWWfTttWJn28rVkJxm/CvXl9Eep+aDmvlULQKQ6qpHesDSv/qGbqYeWaL/Xt\nYwXASDonYUcaIqZDnYkO5zJzLJUp5HLX9cotwZ2iiwQVqKTP1eLZ5jLceZ7R\nYe7aud1pfa8g2gOisLJLycpoyEdZHYQ6VtcEsVpyPwbBgsUGJ49iypYPG0xb\nMUuE2IJB2i7fkJAhecwBntk9HYVWpcI1pt7ynugRFGEvB1SqiNn8KdIxTE+C\nCngCG39izA8YKcbu4uF+v+T0hfejehvHJ5xIVIvK8i6/ZgaVhaltuy/FeHw5\nRuSSZ4r+AzKfBFIKYYJTL+/+XXxz1HGqAfb5XNiXt28cFmR89xo5ZqbZvsB8\nuCHalQPOMeHysRS8aS3HEUtQcA/Fc/w7kD78bs6+s6mKvVk91ZOTH/0zfYtF\nJ09ZnNkktb8S9puL+SQBeadQcquDWtlCESm+nWrdTHDDQ/ofvgCouS0rPXzi\n5mODY04hn57xpcN+iakajMwt7+VKlKekqkHxxJfxi9dTJFL/RTrgsL4LoqL9\nJgHaj6gqBZ7wcoQya+WcW4kc4kH4GB7JkPomoDIAYVuv4Kri2LOl6KBF30B0\nxNr2LB85zKFg8a3Qfki0QPfgO2pg9/mcjAsKePYl2vdeFdUXWKYkWEoGJ+Gr\n+Pdk\r\n=r6W1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2asitcnlsQmgkWsO5Cg6fVLWt5w7Xxgcn0TnU2PITmwIgGHUeKsPZBAdDpTkef/87KiBiPvxvN2J2TmiDkHnqCe4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010073224_1539156989216_0.17537356995536846"},"_hasShrinkwrap":false},"1.0.0-master.20181010081045":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010081045","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4f0455cfa3527a7d2263b6e17129c7906031dc8d","_id":"@atomist/automation-client@1.0.0-master.20181010081045","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dpleBaKRPfOmSuRHBIjp7aiwSXBChHxc0R2dJ3ndWVMHncsL60eM6anyCl73Xwy6aZxdVlch9BthkUDnrEoldA==","shasum":"ff499171af8b4ed7253b9500df0931d4d0e82e16","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010081045.tgz","fileCount":588,"unpackedSize":5147594,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvbTeCRA9TVsSAnZWagAAQAwQAIPs6VKOgA2CBT7NZY1k\nwk7I0F3q99zSvn1HvpuusY22ap/+O+eCZeuyHhiQeDRPzRSEVeCqfY20//ZF\nsU1i4UjLKflnN4c04ktOWZQNCsuVeKc7+zo93RpM9XAVdooxcpQ8tdTC03wp\niY4eeoUmJij0n0cuh+DkeNxguHpRnNRDRg83GcQMBQtt8QY7KIOfYGZk39Hk\njCuivANPoD3TYl4khz0aWShjj7zEr3uQGyqAs0F7QY+fZmdyDu/wJrv3xSu5\nLKkchIkl4TmtZlB6ksZJ/V3bMXo2ybNYbgg9PpNTtXpK8fGU4+XuJMXfIYDU\nDk0voW1tV0TLB8fp6JvJpFVKNSdPErrSVUzjTTQCR1O8h1CaQKbQKbRbBII+\nuLgz77ExEnUSWyISlF2AhU/EGwjp5RpXhVmRMaEmvfpR3L61PMxSqDBRcXSI\nycpbxC/YPYr9855dcnE6sxz8dFjMNT8buGj3JkYSTfVuOZbFM86oP3D8wQ17\n2bCFwFdK7LuhNHFjd27ZjdIf8iDwONUDLLc3h1/4HKjKEbftDTSIG9CMZPmZ\nqJnRnpy5WUADE8LmWW5iyqkg1UQKdCrPfHp5jGgIoUek0AOLaP7qhFFyuB2U\nmDv6iKXRy1sjB2xvsFoPZEkTp/8cVm7qpXqrBOhWEBTlGH9Dp21odc6S89gF\nfo3+\r\n=glvu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFSlpx6rIIpxI1CaF91xlYSJjp0o0/CoPDfgvQ/rL+qvAiA42h96Yyl/q3kEqEDuf0ufNpPiSPM3q/7lZZxA4ZheYQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010081045_1539159261409_0.5654864537745663"},"_hasShrinkwrap":false},"1.0.0-master.20181010203902":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010203902","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7723fd87767c364a61bdd029510449a6e93fb1e3","_id":"@atomist/automation-client@1.0.0-master.20181010203902","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XNIwHB1fsuiRCvZuv7v7m1E0jTDOm5sli0x8cB30cdiQVNWkBVEWRrItG6HoLwQx7YqTC2WcW+P4TV0MLeyxXw==","shasum":"551a8df650085c1fad1091e281d066850b024777","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010203902.tgz","fileCount":588,"unpackedSize":5150073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvmRTCRA9TVsSAnZWagAAo3wP+gMr1jqtLoTnT99GZOpV\nqr4K/6cNXURKub7TM8Sqwoe7kJmpttRb98g3K7MomuaDVnULjqJ0BcCQRXyZ\n8JBrI97ze/MM9PpTVUHBwH2RSMyxNgSbxqbR8hc7ZP4upidEvOixKWxzI6xi\n8ybOdKg/Wt7g/T0aT0/NxepkqWkk1/sF8Zc5F+jIJQJxiq6KTq/4erHZheN3\nYvACAATlCFi4tPORYXuCr4eaHgFFTyjFHWY36xXdtNXZt05LcNBaarh+/F2C\npImpCQW5Qc37uhTm3m0sHNd2LrETxVvTqS4lRv6u/oY8Okck661Gl5vpT9Hz\n56GAquneCogAVf1B38DP7O4y9hX7bGCzOqOMRGM/8Wt4hwbMe9+oPNslFLv1\n/DMjDBtLcpgcpQjyhTFBbvEmS/F0JObI2tF58Ap3zcoof8OgyoDjMf1wiGC2\nIPQw3BcgaDHJb8aqQm4io665aJGMEDFsFqQkcFQp3wfl3caGG6FaqKRAS6/i\nk/0uF8cEx7igQhtf0WTK0MdGb9sU55uIzrEsWQH5DAt73r6qTrp5pf6UcVl8\nx4l4/RDgXrfsKP+8lLL88vQS8nmrSrR0VL+RPJZZ6X62SkgrLbs6NiGW+mm0\nSK/iUqPTCsPD+2ue8nURkT7YcTya90a3B+iav4oNsYi5t67OX/T7y1iyRZzb\nRy6T\r\n=JLRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFr+YZcuLOJKhAPldDud5oSwVf1Bx26BJy90p1UbotwDAiBrSqChFii7Vnwj+yBJ5Yre+H3XI94Tj3FAUxhPCzzl3A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010203902_1539204178791_0.8003162697598818"},"_hasShrinkwrap":false},"1.0.0-master.20181010204819":{"name":"@atomist/automation-client","version":"1.0.0-master.20181010204819","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^14.0.9","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^5.0.35","@types/graphql":"^0.13.4","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.104","@types/minimatch":"^3.0.3","@types/node":"^10.9.4","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","@types/yargs":"^11.0.0","apollo-cache-inmemory":"1.2.8","apollo-client":"^2.4.0","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.2","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.11.0","hot-shots":"^5.2.0","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.9.1","lru_map":"^0.3.3","metrics":"^0.1.17","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.5.1","serialize-error":"^2.1.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^4.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.0.0","yargs":"^12.0.1"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"92e0bbabbc3d3ca95ba4839d893776734ea1d7b9","_id":"@atomist/automation-client@1.0.0-master.20181010204819","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-J7EMYHhuIOaP/Hl+VWiY53Ao66dcgHRtwaME18rOZ1EVKIEDMw6TzO8XI2FJaXlUSZlbsORSpaMXhjnKZ9WN5A==","shasum":"226954f47cb3494ee4b1c7843e080d437331ae67","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181010204819.tgz","fileCount":588,"unpackedSize":5150208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvmZ8CRA9TVsSAnZWagAAAZQQAIBYGKzM7Ngv0tgyLG1a\nf6cOO7mPd8zSP08WEPktdb+CvQktwfQif58WzEaXgtMX7tXlk+YgsHXnLnjl\nXlcB5H+b7RbXDxd/P98Jf8Zi/1vmsD3nBSetRMZBukDImNCLEgsWaF5KDuRj\nIPWNEvFrgSlQS5sL5ZH4tNhjQU68PObHGCfWw4y2Hc3nbT9zUCawKy57VLj3\nruRPBxZj/5bu3VPsJACCMpOmCoKNCHgi42jK2WngBrLVZWe7O8OtOpIJI+Ch\n4FFV6Yjh08bNWVZLjwp5wzJYNjk1DH8Elh+D7j7VYCfMgaekE0G/p5QsT8Z8\nv59izIrVtOx+m77BzwnmDQuPZkt7Nfot+zEnDP0/uB4cbEt6Qub3a+XkNP77\nDfQTPN6aMOgiYvY6SOn5e1pJu8lfpke2vUvELtwcJtG3p+l/z5WH2lARl495\n46r5gKcYdFoKfXzQrO5T4CRSlNTT7ZxklnoD0iOv0Z76TIsRdDteVDSh2H5d\nmb/Nm6B7v6kBMTWWU1k88hljaG6EC2r5No8ietTjMoEGBcLHK0ZH0kXjNgtc\nxrtWDQEu0wrFSKj0z2NMaLNsVkz8nSO0garQpUXjY7cKV1zw6ZVqRvhddJKN\nYTzxrBlg3uINp1P/EtoDmakIciLoJ0SWiTDWWvU36zITo27PIbTsu8kcyCTp\n7qeD\r\n=8PGr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtDF7/rHirklJ/fOn9baLuL4wTA0VZ450aiji0NFqyPAiEAqQBoI/DoKFJ0POZT3QehH2iwn6D7RCoND9iMqsdByYI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181010204819_1539204731759_0.00916087169215185"},"_hasShrinkwrap":false},"1.0.0-master.20181015105305":{"name":"@atomist/automation-client","version":"1.0.0-master.20181015105305","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e5788676ba7b584d600de1de632612a7bff838c0","_id":"@atomist/automation-client@1.0.0-master.20181015105305","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-J3UdlKQBdH8ce9eon4GIe+v9LyuVMcShHmioUPUy9mUz+fYHT+BDg68STKWM5HOyTDVTlw86aAcSkCvS2aI6ew==","shasum":"97c4d7d3e8f4ec50bb7398e6770af061d1a1f87b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181015105305.tgz","fileCount":588,"unpackedSize":5146548,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxHJfCRA9TVsSAnZWagAApjwP/0wcYSSiu3IBqcGhdic0\nzKN56+FrSl4QXOQTdKaA2UsunVvytUJ9hLCdTkc++AyJ2Eq8xDA9wJd8nSQ4\nIQl3HK4UNBHJLPjKfpnhlmfM/psokjP6/sXkB38Og7/ZBDuDb+F38NjTlfox\nw/bRs4XZ2t7nqx0MwHO5KXSmV8m6980vj/Mqpl2PhZHG6yarjRjFDWRplwtx\niBQK01Ketk2uX66GI6Nz6NWUKyYtt1abo10iW+Pe8lHc0BwM3YPc6frEsfsj\nBP3L2uL6NuuSZcRamN3Qv1em7ueMEhgl6rIpZxNVRsvjTW1+MEKTECRRig93\nk1SQnuEvX1NDuvh+kHA6A0ASfDeZn4/JxgpKuESDWu8DPRK5dnnQ3wsCcPkg\nVzLr0JMyEfMRuwlKZ20PIq3W1F2D6uUcKPNw1vBAD9mdiEutqafdgyTN0wUd\n00O91IbEfgRXLac+IF/gLhyhvvYiUHcoaFcK+qxKA1QMRC1mnAHHjuBWzEeT\n/6w/NdgCDnHLvhYxkW4Wup0ra9uX85OeR3z6i5YQvhSWYxqTmFzqJ/GSmY73\nHJNdAwMW5vvw5a1rimyodseh+sDrSW5QYE1wd2q7H3r6feSTVjsAC5IMd/8e\n2eI0vOaEer2lkL/YcokuyJV18csKUo3oaYMiPof2YnbDLqAFOPTW6K4Qjt9y\ntjW8\r\n=p76o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGns/g5P6rOpTTW29OSxE1jG5R23RVBw+ymXhVW7r5T2AiEAuRUFtm+a056aS69RvbBEJNAPIUsLnHHnttE6RHvRink="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181015105305_1539600990314_0.7133764204934252"},"_hasShrinkwrap":false},"1.0.0-RC.1":{"name":"@atomist/automation-client","version":"1.0.0-RC.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client-ts#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client-ts.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client-ts/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"e5788676ba7b584d600de1de632612a7bff838c0","_id":"@atomist/automation-client@1.0.0-RC.1","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6eQ61uT0dZIztBCT8znYxUB6NJCnmctOx8P6nC6lNtnUFM2oj4vwCb9nFvLngEdQ/NM+ksbXQ0ZQFz1kGbWjTQ==","shasum":"7b82ec7f2ea4d6f3cc9c97c311a8c54942d0c8c9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-RC.1.tgz","fileCount":588,"unpackedSize":5146531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxHNxCRA9TVsSAnZWagAA0QIP/1MmB7dsK0kCITojieJF\nYfZw4SCePgFWgT+8f7KBowhQMocGYCEC3b0VeGJOksb0I0GrOirUBoafnKLL\nM1gAuFDGptCpdb67Ly6RQGaoqd5jc4oa/Smj7VeIG+pbgfPkReBIVnN00qaZ\nRMJYlmLnh15jW/5ZBev2t+nm3bpk1KzzVaGDabA9DI7Ozs4mwCtq8T7fNQtN\nhRL8v+ErXH0iQd7ifHfHrqzZEVZcvlV7xGXBW92h6FPIy13UtLRsW8mxZQWq\nZxz8kv24fSQLDWyVgoIvy1c7JYGsLiEMVKtaGTw66/YtTOlkP4B2RF6pcYmT\nCBiapXYa/A5fprIlrE/jr6tcbvTGUx9vir+VKfYLGACaN6Q8E7RfCvafJFrC\nPU5Hbh6Nd4JlRQv2dqLPgeyqQUiAtmC5nlJZut8zNslboPZbDFNU4K4hlSQ8\nfrSWMaafkelpZZ9Zvs/2ufS2XkqI26JHfxtyQleAq+MgQaVtNn7g9ZSO+pVe\nIzefE3Y63MKjvZs5wdf4M8NMM2ColzmHd60ATO4hRRqdV809nJMWpo8gw+co\nW5ERXvNkFWRzqa0t416cjAkjurqo2gv3Qsq+YAk1wqxzqWyGP+zq9KgOHPKN\nk6AF4qV5GfaSqzhsXO2oGs4S3ftj+x+DmsY8FewsLaOekeIYWGRknkTR6y+7\nfMpO\r\n=u6oH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZbd+YPaEXIaZymWtyEJXa92EqTNF49I82Bm2vfzdAmAiBtw/Gn7QzFPn5Gliy1/bLYEjZJ3GVCSIoY5j5MjQD52Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-RC.1_1539601264753_0.3751445992946716"},"_hasShrinkwrap":false},"1.0.0-master.20181016044705":{"name":"@atomist/automation-client","version":"1.0.0-master.20181016044705","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4e1ef94d3f69933de4f4bd136d3ab2d3a7ea29aa","_id":"@atomist/automation-client@1.0.0-master.20181016044705","_npmVersion":"6.4.1","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-akN496Ys0YRLzpX39aRCKzGaTJ0abVWm7Ri+MbCLFbbA1COe2ZN/w8XQmsHZ2F63C93tcOEGX2fjY/dX7zXPJw==","shasum":"f067a9500c23cee51541485fd6f3d3a6e06d52b3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181016044705.tgz","fileCount":588,"unpackedSize":5146650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxW4hCRA9TVsSAnZWagAAxmAP/i2ilmrCqMoaX671uI9G\nhm6MsrB0n/6zrzk30m2OnhEuUP8Q3f0vFLtVuipIM+8CibALCSKhLFP8d22z\nFXDJ9WS0rKU33jdNB/Sw7tIXnK2/ZansubDtPsCEZkvRN1JArhYNaKcnNh66\n3hk6VSQfhBRzHfepW23du7gkRUff4JJWFJiGX3WpjB3njzCrgJAKYNmZeqeE\n0UasrFMlZCbrYuzIgxn8X4SaeuTxXp8gECxj0ss3J5yzZFDxVhBnXuKFBQqy\nLvyTFQZDK4w+PWyUucBnArk8F91xed26wcWxekKI/zkxDYlhRYJ1kJm5azTX\nTFwuVVq/23BEjbAcu4mEhhTGSHbYDcFJLrC03PDjOYlLn8pwXryQRWuZgiI0\n/kK0Gg/vlA2MJHjRQm9OXuwKnmCTy+B79u3GecDG5WzPdkU26gbOnqqfAnkA\ngWHFrAusWcSrOZNfkCJLsh+pOu9fPY8mYDLpA1NoGIM8E1518n5JtE7NzK4R\nv66wRQt2VpsE5jYI+06ir2hOXObgGave67bxP8sB+AOuOKNal6IN+BkJPOoX\nZzWqq9eUATlPqHkaJd5fwwjrt5pHvSv8NV/esCRsmu2y1iBV1DAiZ2J/ek1A\n6jxOWPbCWRb5w3hvsEfZ2P6ScdoZP+FJrH/mp/3bNSiGPwiKYQjod3KR/EAv\nGeK8\r\n=ueDJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJotsXu8zTcf7vqce4cohDYDxd6r230DhG7or8uipWjQIhAMnaUj143QgnBT0rwBmWBU08RDs1bYgPmO8yQwmDQ5vE"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181016044705_1539665439942_0.29393789988221086"},"_hasShrinkwrap":false},"1.0.0-gql-gen-ignore-ingesters.20181016200844":{"name":"@atomist/automation-client","version":"1.0.0-gql-gen-ignore-ingesters.20181016200844","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bd6bac4fb5ec4c444dc7635110f7b688d8f213cd","_id":"@atomist/automation-client@1.0.0-gql-gen-ignore-ingesters.20181016200844","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TGNa8G7tCXU7VTQWiyOKGHG/MsWz8V+pQTgckqFBoxRbF3eEZ5QO+hARyd0MZ6Tl9B58FjaLkkxF97y1VioYfQ==","shasum":"0cdb15bba3c0019e02e25f84dccfac0c6db8d432","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gql-gen-ignore-ingesters.20181016200844.tgz","fileCount":588,"unpackedSize":5146687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxkYkCRA9TVsSAnZWagAASMYP/RhInEfP+3dZ/m0TebRA\nV+zwb3jNr6Hge2jnMUhbv/Q+rIfpkNYFZo94TFSOapJuRG8CxdtyLFC/q902\n0GgkOEF/mIIc0T9duZYuFvoBxx/8PihAkoIurSi+XjcrhBu2EtDZInr69RpE\nrrY8ZzlYDVO7G+oSuP+tvGee8WHXA/ewk5wiDgynzu/RPULO3MHAVLniguzx\nUEt2yYxGHJ9pPymM4os8lGiC4mPqsz8VUBrBnljzUoCGKs1+TSUPrh9t1HAG\nfFlkqHO3kbshNwNMcDvSI+7DO0XlUocn9I8UjX4O13WXNDjCfSVjkSDdefTh\n9vlA4+sruLs2j7rvK1btc4EM58iQNY7Pun4F8Gl704VHd/oNlpnoYvK7okbd\n3feV9AKx/cevnoooRtC6NOic//WNtBaB6VwIfJZLpF/jLP6ypBzVgOmHdXQy\nyfopQHSUbWAoAsrczv9ssIKfnOaRFEl5ej/BLxiXjPCNnYaJF2dXK4jurAzA\nSrYgSfiFyqbuKYIDDxMA5a/QfSsIUz1D74Jy/9p9m3V7C0TQMmO4lP3QjHrG\n44PcVi4rVNyzP+AufXS+gmyYbEOZmnc919AAhcosWVUv2hfr7r14mXcxk4R0\nVDS+Qjbh2qzgvH5ekVaKr3rMoT219vy2oNsvMdowneNdPmPMWjb0DdtcLB8C\np56m\r\n=c2HR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAySD9UiMceZDXqhV7oEj/LSluFCkBIUUwlXLrLf4On/AiEAzj5UqOicy2BUgIkjQOrhe+A7GLdIHAYNfW2dSG8fVCA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gql-gen-ignore-ingesters.20181016200844_1539720739349_0.4927533497520371"},"_hasShrinkwrap":false},"1.0.0-master.20181016201413":{"name":"@atomist/automation-client","version":"1.0.0-master.20181016201413","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9b2e8f3319baa6a02c20ad7b2578a3d557242038","_id":"@atomist/automation-client@1.0.0-master.20181016201413","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6GnuBlw1iDtBR+LpCJDihct02m2S2KJlQD1tWmLPIiLkzVwoC9WAb9MPJmJ1Z1q+mIARxzH7LM9xcB/B6Pr10Q==","shasum":"615ae7701f829a4092f56092a9ea245c318a6d83","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181016201413.tgz","fileCount":575,"unpackedSize":4788633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxkdmCRA9TVsSAnZWagAAbdcP/3IKXuCdqNgKQfWasQUD\ndrm0DG3ITMvr6ZFlkzexZpGcPjqcCpRZbkmha7SJD8xuWO1xOUliCHESbatP\n9RkBBCNBCu4LkM9BVI2PMnU/QACzE8VVycbx2siJdPQnlGMjb/os3b3i/QrP\n11NQcb4VNoWLwEoYFWVAgupkTXopzL3O+ukIs9W6FOansxLosbdXn2VkL5Ld\nJYkGdN9EpszZzx9QrFr+XgeS8de0H4E8Qf66YMfZQGgSWHDgW+Ct5FNjxcfq\ngiqM/qUpdOjQSk7f1AJeRrve5sddji+TEOQ4zO/9keDilvsAhwQ5/NpnwJhj\ngYzFOFz2VIImfzug1lRNz2VflPoYOCGdrMj5rjqa9KmqRmS2RYzhLfvxVzDv\n3Q7RizJIbv4VbcnJcFE8dHETzae5tqZUR4UtNKwtb0S2TKMB3vFbXNxYtf15\nyOGGTwPxzFlEKAgd4rnw68B9QJAN5zZx/DOCYTV9AwKvFrHL+URypGTXUU+u\nLXpNCNmZZfyHkGw6xdjq7WRS3SuykbXDRyEiqsWRT0E6Uv9IugjUTJ7UhuVI\nf18jI/zwuUElrs4nUo0OqLpNi32YcymXRIFZ3rL1yIW1/AyOL9rqF/7g5h5y\na4+7c1TwuqHA9ltXVIiS68/vb6YUYYxC/qEHpqejVyGmSeUeouvdS/HgKwf7\n0oso\r\n=ccch\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmggw3nqriOPopU3SeELsyXi5mqy9iTHRufHNhCVAlRwIgGiyIsYsOjBmSvbxyN2VmUOcK/g4YywGp7SjGVJPhPIo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181016201413_1539721061910_0.5295750240971275"},"_hasShrinkwrap":false},"1.0.0-master.20181017152232":{"name":"@atomist/automation-client","version":"1.0.0-master.20181017152232","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f23a910cc0672a031dc9663baee884e1de9f829e","_id":"@atomist/automation-client@1.0.0-master.20181017152232","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-X4VF2RBiyt/ouFHHILL/bHzd8kx1MT0/982ppi6b3kxrcejrCuDdp1rSAh+Zt1joFcsLHusb/gR0M2qPZJ4MAw==","shasum":"abe17b2dd88e8db27a6460dbaa5f02a95f1da45a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181017152232.tgz","fileCount":575,"unpackedSize":4789502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx1SNCRA9TVsSAnZWagAA9AcP/1lKgmjPev0s58kDZBGz\nQDx71Zk0conDu4XQCjdRPxyf8rWyuCNQ4IYc2ee2CMeBgE4ODatiWa5zmN4W\nDqA0YhbTODFNrCbsu7ng7b/D2x832IYkgsOa6zKWqdjea6mD1b9TGxBP7c/I\nBziC9FPA/3M6perZC3AgPs8KxGp3nFfEoS2WmQ7BvYqUMLrIk5M1ewY92WbF\n6XSFhGMdMeP/2Dc2GwJRUpr47IACm7T8SelDlnNF5Qu6B70nGTJz1/YL7iju\n2oTnqvB4AT+LIXz0UJUnvK1nmHsA8IU0AlHdpg+uyt2ZnsduHDy4TqIzsrJE\nxiqxdqTyB8QLGyaHKawa/J2qFYc8pLMxDhuCBwsfx14vUd9rzbjCoxSCUR0R\nPoAWP+2l11wi3Kqncs9KyeZX+ewiSSZtiAx/yJHoxo0h8velwFsEB8csLHeH\nLIcECrdtPireRz2+gaLBdM5MvvEy9hmKohNkESvq/RkAD+mKv+/pTgwk3gZO\nK5ZcgU6+ifybwgWred4DQXwCN5lY6uMQ002+fXt9YE1OZX9rviuL+z1wORJk\neSJ6+hmh+LKDkAQvyZFGK6VEBrIN22pT0BFhmyhK7K0/acWbT+/9KdjSRfTe\nQIcIErlk2L4nJixq764JroiguOvZS6+Y1IKvHXOj1xv6oORKBWU3sZqOM9jx\ngs1d\r\n=cYuT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC09zrnBJ9fHJyEiLa8mohylzFDiKMbRS5HjMjnURzvTwIgeS90+C+2sdeZiPYsBWvVBq4hgNMJOqCCPMHVVk2D7UM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181017152232_1539789964356_0.8529827626330422"},"_hasShrinkwrap":false},"1.0.0-master.20181017160341":{"name":"@atomist/automation-client","version":"1.0.0-master.20181017160341","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"19e11b765caac8c7fc903827df365e4166569ba0","_id":"@atomist/automation-client@1.0.0-master.20181017160341","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XlHP1w6pmqUmi5c0MYdKOYc/O2fu5GJOgFcA0fu6zyltw8L5VHqftEvWqi+rDHi2dAxQ2Mkq3HjWhjHnacLkxA==","shasum":"48d5eb22ccc2159e8fcf5971fe92ed5a5a5fe735","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181017160341.tgz","fileCount":575,"unpackedSize":4789524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbx148CRA9TVsSAnZWagAAj2UP/At0oYkslJRWtUFyYgE+\nJfhx0wAyOZkG8qB5iDOfrKVXFk8YmUpVqgpCoDAC2kiRDGTZUhionkhUmcqT\n1gR5IU45nkuMSkYh+4Dt5c/enrrXV67CgeZc/LtOzIc9Ui6kVDG/k22cr6gZ\nHvgJ9JGLpeM7AQdzvfy11k6C1M+0d7yhjvDP3eKOTChcdW7fL3nzesXHE25A\nqqHWu95CRjflfCJcsxn9lsGL+fhmqf5A0H4f/1s8BDN4SiKOkWuK2ahFbWev\n9btcEv8oPJKWgkevxGgH79Ddr9b1+nZx/DsVEgTHL4CHbSDPAru088mbEhr/\nlSIVvahNS4X/6saLixcdhhMKkq0ewwwGc1Qt0yrM+ys+ZYyHubbCf0fil3iu\nESMHCrv1aqz5W9Ymcst7s4lLl560h4lqEQmebCCUyktEHLX323nAXgEYnl9B\nMOPAbb6m0Rt17vtiD8KWlkq7yHA00gQ+1OeyjcX5RzIfpWNdA+eMh06xg0zB\nIGMmgpcv186LnwquK4mFBZ4BO1a08+/W1ZSaHLDzBd+OTWLqa2qzDWwWW6JI\nP4cljoWj1i2cf3FTygcj5cKHqyBtwjoBxcqzHycU0l5cbQN8CfjCPU80KFI+\nFO/hUK+w4557ZOOv3z8gVDsmQ6qaUSZ1YL+ILwOqhexIQ/QW4GPgqFySrRmq\nIxwW\r\n=3H2h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCs5E9NNMc4i5Co4DGbsO674vG3jFM6wOFb7MxTq7k/GAIgW6DxAf1nkL0BKI4gkEbFbusI1DIzKAZFNE6VWeaWITw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181017160341_1539792443388_0.005907592853140464"},"_hasShrinkwrap":false},"1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205":{"name":"@atomist/automation-client","version":"1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"27c3deb393e1bcc4bb47251a7a2aafb86d840c0d","_id":"@atomist/automation-client@1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3gJzvFNM57j1qbWLOJr2PRICMNG7a4p+FxnKZIAtBbLOLN4HlNtPMg6vFsjPbjdKgOzZA+9vCoZHzRlAocn6Dw==","shasum":"6ad0480b7ea6979bafe1db60a319d1df3e994eca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205.tgz","fileCount":575,"unpackedSize":4790601,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyhhICRA9TVsSAnZWagAANxUP/jZXReHGPUINltbNMmVx\nflJk06ZFUwfW6IfNAb5APsVofUZCY//v/JTi2OVeO8MkqqY9J5mkyFBHJ2Ug\neBZT3M76AFhxywiYsjvSejTxkjqo3J37/zFpmEcI7w8HXVuvu2YBzfEwpoDo\nWWPDce7TaRyxgbBAyDn6N3LrEJCiRvLRGFri/coTo2QuhI1mCFiEBPNjqCd+\ndji7l2jvRhXv+0WOKSigXB8zXenUvr18PpbcylCvlXGVVPamtRz8OCp8U+Sy\nS9ZRTiPYIwEXtfkdWdJA9lbZN2ubg4HjV3Z2t9mKV/lndg4x626yRxTCcXO1\nZKWwq8Wf9PHt74NlehMeq1hlNlRHU6OFCOFFZ1sqaZSypfBIqONty2ncQn/V\nXjOE8Hp6pLS+dXWUlWXSaeDhbsapoNuUL5s+D3xexf/m733kWjaMNjJTlvKF\n0QkQ93tBMzOta7xjjOB6TFDZY0QmENdvSczTCyA3PdW6j+cYkKiY74VC+OEI\nrmiAFWUrWsM6G0K4/YacJ39TwrEE9x6cJ61RKoHxXTgLvcdFB2jEFLqD8rxK\nnrPuo3TOIzgaWMDrSPJcHBmXTuwdRTh1GrDHqRAJ6aR5prbX4TMcwNS8ZQl9\nXzOL2uL6FMqA1RuAwubKOauJq8RemU2tDSlXqBIzOp+5h+Ds9vsnvv1RWyoM\n9M4T\r\n=8ClU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB93XLX7u0Dnox/kdaaBb9HONjSICeBunws40XroU/ngIgbPg9/l86aCNzRW86201AAb/c8J45yh04TIOvcIMPVug="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205_1539971143612_0.38074498467710893"},"_hasShrinkwrap":false},"1.0.0-master.20181019184257":{"name":"@atomist/automation-client","version":"1.0.0-master.20181019184257","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cfa434e0dfc83b8bf8ddba70fe07bd5e529a8d8a","_id":"@atomist/automation-client@1.0.0-master.20181019184257","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-IShtT9wDjMsOXhMmSjD5KTkymehSTC4IMKRGO5po6lapUoKPFmr0BKTM2t7kUpFHi/5ceJDrRWmg9HixXzNu3w==","shasum":"18f60dffc8e7132c48a4c46b168c94bd9a2a26cb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181019184257.tgz","fileCount":575,"unpackedSize":4789824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyiazCRA9TVsSAnZWagAAjdkP/i5GFCTqfP57k2bDz19i\n30gEfMrEbNwS5eUQBZC+BjEqgJ80qnddGQErVzID8cGESbKKn22bHXSiXowj\nAgXg4X+IZGFHPTavc3V+qfp9e0c1HxoN4lF2LnZpm9iyf3SG4A3pJoTDvR3b\nTCKnWh3lesiPInphuG8BebjE7Qyn5heFcNQqDJpOHQTWi+q2pq626HPGuF/T\nKMMEL5n1nIJw1H0Fu8oFxx4w3tjUQgCo4bO/nFDYfDtPHUTm+kzdummLBlGA\nzIuFPXod41EsTCXFxY9BnLuYTnZSbxgqJbptKWrjdCT6NsjuOdxhYRVyvKIi\ne5bhaloICEvcVDUApnZfftMYj54XH6VDKWkbc0v4r+FtiUseGfKFWCjIJDvc\nNAWA92IhkI/3uN/hsVNjl/Gvqqzyiu2G6Yn4b4sBO5s0ruLzvY+XMpojKyql\nsnvtZQYewC505M70+9YJs7FYfe1vqWNudOmfZh8s7WZBuA26fLI3rFU9iRuX\nA3MOAl8ypbiuJYFhhJs2v3841xOJBm8tFlVF3OEZ1UdIVUaZmaG8b9KsAl/Q\nvoHHtoDH+FDc7ZSbPsG1d6OVBd8hidrmFb1msMtqovg6a9VYeaIYtYJ1bpcb\n5972eMEbv9WJh6Bl905dUDCN/XCspEi01NGKSdOrwuND/ET39YRsfjQEOGjv\nURTc\r\n=GlfT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVdaiEEv/l96p33vOa8nw7LuIncU0V5zUYv7o+yHysAgIgOdM8K8NR5junoUjds4etImjbOVTyzr9RJn+8FpNbUWI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181019184257_1539974834932_0.3461550274394456"},"_hasShrinkwrap":false},"1.0.0-master.20181025105548":{"name":"@atomist/automation-client","version":"1.0.0-master.20181025105548","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ff3a844054c455e1c432ac4449cb8da1a3ca88e6","_id":"@atomist/automation-client@1.0.0-master.20181025105548","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Xegu7JNc9uhGbJp8Q1xVro3u4iZesxoxYsCXTHKHNBJaWinl5MH5Xk1OAUgCF0JQoV978FszsH58Cr1xm3uBrg==","shasum":"e1df6e90370af3e699df0ce721ac43cc1d31bc7f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181025105548.tgz","fileCount":575,"unpackedSize":4790927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0aJnCRA9TVsSAnZWagAAhyMP/iye9Q5u54XinTGsbEo6\nf7Sbpu4G8HCKSn2760Nkf62fqDD1VPBLYy6f+QIMJCMZ8fUkUpCK30DDiojO\nr+aqXYMXxEVEuus1edtdVtnELnfAz/2L7Ox5PFuvIL05J+2idh1HQJLJstLQ\nSJD6jT6Q/ohLFXXAennTKO9BLXWk7VNMBnpDuDHrTfKb6PVcCPDdiwtkDOdw\nuFgYPKuFwNchrP5KhlfGul3zZ2Vdkur+vcLlyi8OFo4wH6OYeFWzj9IOnT1Z\nNwtoQyqcSzn1JcYUROipu9nhj4c0yh32/8f6yUnkEbGeeK/LG0xkSu2MnT7P\nPNOt2sKE0QcSRpjufAoo4CaI3Mjmp2EvPNiBn4ldR/KlKUxVDOjWTHCcuIq0\ny/7LXVbNAxRnIiic87aPDiSYDqMkXrLYL2xuMbFXTVmvHo9LiNkptUqEbTXe\nSi36IwBDxEyMbY2eih24j00+YgeEj4Cir4zBmeugsZdij0uSbllOLy1PKBn0\n3fjTn7UJwIo+Ai84nxBud5JcemF8akwgyegfna99Wh6tq5XwIe/IC4A9G5Ea\ngRwyekMDN1zkeopqvzhd660oY+7j3TVcqcCWTBeOMm4GuqYoQ4ZjoqRC0Y8g\n2xpgaoxs2yswoyw8J6lUb96Pbhr1PQ4kMnE1EPbwkULSSIBH689XP2QEX6Gz\nC+HL\r\n=L4D6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfMY4NTKS30CYlS/SBu2mpnm7aWPHue5/9ue8RckVPKgIgYH6ZmyoBHcUbpZXUetS57WnBhoxIbWhoYQc0eMXed6Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181025105548_1540465254730_0.8702555286487204"},"_hasShrinkwrap":false},"1.0.0-master.20181030141449":{"name":"@atomist/automation-client","version":"1.0.0-master.20181030141449","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-M.4","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^10.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5c21b5cd40fe6ffa396932d911255df97f6e0871","_id":"@atomist/automation-client@1.0.0-master.20181030141449","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qJ06LvbORZymhRbpq7qs8EI3/tVm+2cL1hTUP39b6EEM3z5H4cZBogG1loY2SoiFN/77iRY4Snqjyb6tKk2W6A==","shasum":"07a12a935d2d49bf6702a5b305cf628ce4bdf870","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181030141449.tgz","fileCount":575,"unpackedSize":4790927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2GhKCRA9TVsSAnZWagAA+vAP+gJu4KVwG1UxNDJGuy5Z\niZsXoSs+/+KOvwqDdgWM/XMkjW0grET7NMWWLeA/4IZONR6uM0mn7IXhpZ7C\np1uV0LxHNsq5Dju9VG/UHF1juUVpkt6Yzc+XL8QKzZkrrK0dskYBxiYTZjbL\n3/YWmjdcf2TouWRoSSTzF2sQhve0MKYwK5/XsDS7OY3P76js4l2pEKFWg6qc\nzRdu2KJcZ5+mQNWXZDCnr5xzbU4kcT+XGQeVtFqv2Afrjf8xjURhPkZaJZcz\nxlK53AIgdhfFXc42KIgSvAtVjhzCbKDBebsa4AkEsuPPMdiw4GV/2Sis1gKJ\nJQm8LuTclvJMzxxiKsfag0jObw7ge6SOziyCiSfPjhZq3IqQdkEP29gISLOy\nWMBxwagquyDxwrkZfmqhTTZF3cwt7N9e0Rec6nIWVgCH+xpp8i4HVAIp9ZJS\ndpBgaPUleHsoikeTMcXPumZdEF8nDwRoq0gqiVd1QPI7dTH3abKHH0egFUkv\nDRQy3xu5pDIN2W2GUcyTQMMwTjqCQQcZRV44U4PreNPIPilA6s9rZv2NyTnL\nXMmrWN9NcepslkPh53ZFZVcSmPrQHSZWvT2C+vAngPiqVQDSw39Wk1h1EkWZ\nJI8alrOJHMF2oH6CgVrE+pSk3L9v7F76jArnU6krm6OXC+36ZhoLVwlFP0fR\nPCp5\r\n=H0rq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSWgyOq8QD0NvR4JUPnTemDzSWevQpltH72JqO4aCP4wIgUC4xAee+rMvZdjD9bYRxgsxou3aC9fLXUta0z8YRz0M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181030141449_1540909129937_0.847436469155628"},"_hasShrinkwrap":false},"1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607":{"name":"@atomist/automation-client","version":"1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"077ab73daaf980b7a48bc88f28b112db8e091d26","_id":"@atomist/automation-client@1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nNfUkDdktdFHCR6YfYA5ogTwcWf9yjDEGpG9AqVthDSvq77tHCa0ak4x7r2UzQOp5SCh0I0gSEDTdck05zKb4A==","shasum":"4e66bd22ba38085a1424f6548f1ee7f0b97543d9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607.tgz","fileCount":575,"unpackedSize":4790961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Gr0CRA9TVsSAnZWagAAuJsP/1FTEGzTIglcvex9+Huj\n8ulNORjzqjlpQxXfAaczE9u1akURXvc+J3YpWtDBMXepfR0vW2/8uqrPfVdl\njkSw/jSwDXbH7hj9rDr6Zr6pDRv/i6EyjKG59+fF0ztf3CbiI9j8VNnvauJP\nb+H4FAISBxjwYiFJeERzPNoAVOjHQylkacuKLkG+yp07Q24LP3OHPjBJvl11\nhx5tjHi3Zye2Y+5ACunmCgtZJ39MdFVilY70I8A2feGVU+xbUpmr0Gt47DGH\nQ6qz2/z+I/0HwLzMFD18o/wYIj13e6yo7pbobko04SS2e5yg5qJq6GFyBgtV\nGSDYyV1VGNO5UtYGwvk4E7hI+Z8R1a3NpPAkSDmehJ2SUGlvTNUTqeNMX9qx\njZkq8d2kfdg7LOQmsIvgBiTmFKWYOQIZxUvWtLOraGqGDRmnDFVnsdhDeh3r\nlWSCWEm6qohr/m6rAe4RgUQukr8xCbJ9EzMp7Pro8dD6UwCJGJ0pwtMj/BA7\nHFNZ0JdCYPHQD0xQmZvV+tfAGkg3tiyL04i+iAP4W3RiGSDFPM3ZYLm1kevn\nZwrX2/TQMkj27piOUBtmFMfRyo8rCOOc7n9Av86ZJzMmG+MzGwxTu+3ghw9/\nKpe1QDqARf2zIwvft1U2EWSLzamN/+TV5kPUuudeB8nxCAdI8DBirPolMiMp\nJUEa\r\n=UW0v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdxfoFB+kX6LAEczV8pAlJeo8UPfHhTRzfiWCg4a4v4AiEA3/ZYLuMxNNd7303SVTfxDhPMV8AizVgBpMnO0ah2ZIo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607_1540909811144_0.1648645512972844"},"_hasShrinkwrap":false},"1.0.0-master.20181030143226":{"name":"@atomist/automation-client","version":"1.0.0-master.20181030143226","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8edd3ec51b9c7790b71ffac553db03889a557767","_id":"@atomist/automation-client@1.0.0-master.20181030143226","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-L1IF1kaUxQhV7CzJOcuMlTXXsRwjeQuRM1Wy/xZkqJDzJCfFhioQdCnvOioc5okBFSGA6M6JnuhVfpBRvPd56g==","shasum":"5a4653c893ffb05c1bca49d0e617d4e9d9a41da3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181030143226.tgz","fileCount":575,"unpackedSize":4790939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2GxzCRA9TVsSAnZWagAAO5UQAI2Jk2A1/7da8r9o/W1h\n52F5BbTD1F822k1id6spZTN4A5xpM0bXf1yGUN7TTcMAIRpOwW/u2lnJUmud\nOti+2NXyi/Ve3lQodOFBnPKxhRpWpNcmToz7dTrhqHNx/KUTcMUDrY1tSED8\n6tsocYUKCyyCarmJcHitns+UCi3/2jvIeiGzBuPyQUanz6GAYs4HqDEJCGFQ\nr7Sy66m6eZW80sKK9a0BXVvPQRIpkiXzWwdvrhRuEpDC4NBnbelNMEJn8puB\nznNPOSSqPGM85XzOm15IcR4Ocsjteh7XR7qpgPuDRFeMACxRx8TCt33lqlXG\nD7eij/oR/4jAOJeuUhz4p/A+SNWxB2tHsc/IvqyvovJA1UzQbbYKPleLruqo\nv4izz4+PZOWLmZTYwbGOIx8GAc8AdvMnLLctvF16FkUcIqNAWyPHFYYOK50a\nWyc9dOzOxSblDHz3t9lH1qXSeVVdJhWRv5ixw6OLEpVBYZoNGYTFLPo4G3yf\nCdBfqkfFyb/lhF7sCUSCNYcvmrdNMDnyHs1DbFlyoB2AbIyAWtI3fjC9Vkl6\n49Mq7oYBCaSgVQ3FClMYQK9dBjuWJl0oWWKXM5lpwzlQ5kWGVxH4qhKT0l8y\nv0+5XOZVFOiesthZP6GM0K03pK1AWCdyG79k3Xpn/mBWPBXr2jxQREjQuJpe\nO2vs\r\n=K9ks\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiNJp6GG2FKrP1NoEj28gSF1q8E4+Odm6lR1wkQ49yoQIgFwPbOTLfcPyh/V7GjPW7tPH1mkA5fQ57w/EOGYe6sz8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181030143226_1540910194987_0.5330149173311776"},"_hasShrinkwrap":false},"1.0.0-RC.2":{"name":"@atomist/automation-client","version":"1.0.0-RC.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"gitHead":"8edd3ec51b9c7790b71ffac553db03889a557767","_id":"@atomist/automation-client@1.0.0-RC.2","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-G26gOtWSHHBZQdaLtfn5sX4MHPgIlcjnfW4uw4VOGVpdkBAuzzz63n7ImAGwtTiHR2J81rW4uMlGXP92ZYDMQA==","shasum":"5ab91802e2c86a58c8abaa3dd95b9f2c010c5a4d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-RC.2.tgz","fileCount":575,"unpackedSize":4790922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Gy5CRA9TVsSAnZWagAA6cUQAKBEi2PVm2D+2Bn63yst\nGwRZmw3I3LnorKDQFwGXEm+7eyhc5lIxGI3sIGXqZV+/pL5qA7IYugv8dzvj\nerxCBdDtgVdRHezny+O6TEpKv/BNCa9PV5hA4Xm7uIb9I5xxMkoMfPuoNU8P\nMqtQ1+k2ZXyZBAoHmjpTdvwOqACwylq+TFi/OgHvfJROCZZRGjHDe/lPBD62\n6m0mLBep8ZMl5VnD5+U0eixXXblstwp7CFcJoRLLulTYhP4vnd69wo5ulVRP\nkjhvXQ+IrP46o2/dEehB/2dpiCGt+7QQjQejBZZO52UNomo8FczxqMYLIcK5\nUxCMTHqndsXfGiJD+fBuOX6Dpd9HuLfxtTOhbIaqeM43w1t4eVzCctwE9C3s\nOghkD4zZY9RSq+nzcYO04hd7rRmocZK9UvCAUiJt7v/6B2+mpvpr99zUv/g7\nfEvz+/o/eITEJfwOcixdlnD9eKHE1QLG7WpvEzhTR+vSDM9jKimVBn+DotOt\nnVYyenyuUJdpj/Buqy8k9cjh30D8Yqg0fZzT6NMQWdeRY1ym4wacZBkhgjPk\nr/NOkEzDcxRnyO1XgQRghOXE48YHBaBoiO5AkxLt5yogvDsyuGqYS5oSzcPQ\nQKKiUk/KdVG79sTdIg1OkTnLEvEsx0zRDvr+89aoj8zZtsahAHr8O3tpRSPq\nwPsS\r\n=MfBo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHajBE1BlsoJnDolBPOQGzLx/SYduMfy5F7YvWLDM0BEAiEAsdiC0VrbmtNSSz5kOctnJ49+x73puSMPMpOk36HCKyQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-RC.2_1540910260920_0.4129968242094384"},"_hasShrinkwrap":false},"1.0.0-master.20181102085719":{"name":"@atomist/automation-client","version":"1.0.0-master.20181102085719","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bb5ebe828b860c2a2597e10931a1e98784d854fe","_id":"@atomist/automation-client@1.0.0-master.20181102085719","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oMt9l2A8AK5wmKEGA8xDDVG2vQAoaMo21JvqBkVINOFzalgOF8FniH7Jo2LPEONZqQh41BUrsLvMI5G2PINDmg==","shasum":"85df6a3a2ad8239694e3d3c28ab63144fa0b11d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181102085719.tgz","fileCount":575,"unpackedSize":4792683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3BOYCRA9TVsSAnZWagAAisAP/0nyTRsTHwi1vhPUgFVd\nktU4AiebEuILbv96WGfFV2we476b6nikUZz4NPIyzDCeW+AQdDfjx+xTGzBy\no51Edh3TuY6Vm3vZZ8CLm8MZ+5rN8K0LiCgc3Ep6rurhkM83CNcFUGl4nhl3\nJuHlhDXqeD2lufn7nvw12Q89boeE2JA3UxNC82loINzAFSN7d5xc8deapU7w\nkKKOQuoLxv7Xz+B+EOYV3FZABGcQqOV4hmWeLjrQm+QCYd7DisqwrS2V4y6Y\nR8JDaVvX/rrpVeVlK87kNGjPXZGlwNvDE2+nVcJyQVvWxWthwJ/Dm5QnBSPm\nBrl8hkPtzOVlhxlC1qc5EkXibbsFwTdGOp3W4oTtFU11afeiOeSb478d9oqN\nwPnJLy5cY8ecA75gRCs01HbYSF+1BLo7yEFMd1/s07io+wuV/QDqzlxlq8sW\nPb5ihYF7+E83Oe+eV2WSSLeDyJ2QMGd0JMvZXbAt+M07Dh/3xsz6Hl574dEB\n3aObHGtK5aalT6lxZNrvbe/0z1K3DzcgYotZIYFCvjxkx6CK4plK/TpAbGn9\noLFDJDpxHKYX4ZBq9Wyeyxg/aOfkk78r8R3KEAcdYlRhTDXDI+q398amHAoe\ndzUDkCE1lFuhNxE2cUveR/QYkqrIeW9Hn/EH6tDkqClo4uwsbAtiwyMsFLrP\nfo1J\r\n=xK1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZCYyvDpNNhzTAmSnp4QbFqjkkoSsY1bmTLnIcSgS3wAiEAiMluOR16QE/cD4uzEdwPwMF78uHJTfHMFlyCQpuiujY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181102085719_1541149591792_0.2895641015300692"},"_hasShrinkwrap":false},"1.0.0-master.20181102091953":{"name":"@atomist/automation-client","version":"1.0.0-master.20181102091953","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"55ebd49db0092140a3c3b30dea5d3d1bd966deb7","_id":"@atomist/automation-client@1.0.0-master.20181102091953","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-MNdQ9ZEpIM16H8Iga8DDNuLwAScS8hznBUtjBu9noqXGi/c6CJpGqwC0CwGbl2FJJCBguR2yzUYaOSer+eg7wQ==","shasum":"5a16fa1ca5493e4f771a696c2509bd005e848b9c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181102091953.tgz","fileCount":575,"unpackedSize":4792698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3BejCRA9TVsSAnZWagAAxYAP/0oJU6HSyhbBsXbFYOcZ\n2/NNxLAlNz2HIbRXEs8FgAmdT7V4X9ei/c1qoctiWfYYCXgK4l2BSFP2B4Vz\nBrBpmPrb3KlSzBLNcLSelYwjPjwUXY2v8dD22buBfI8U7qGz6RgfFBc4ujB6\nvF+frNOMhYfN/8obSL+5A6gjhRID6aMtbhn5X7x/yQ+I7jssgskQz5ERSdmC\n2jMFi++SDMKlakHIWZM6CeNB42C6j2Ez8G5IVEKw43zjfvLeWM8y1nTFR6Tf\n2U+/umUYrKhoz0izfhRQFa/3JaVmG9WJGuxpPBYvm3WrS6HpeGvTTE8KcH5K\nbiS0TVd8R7kiVnHH211hRSmLfJMcjBlnnb5wStxtmnlUNlqroDWwVgjT0QWI\nU2kJuW1Z7sxBGbzlFiYClAchy/tFBZkrgNp/ezpQ8JmXPPfkrYe/0qTJzgIr\nnrEU/PI93UtH0Qg4+/RxsD+CVG2mil81eWWtQog5YvPxSfbQsFLNwMOwQKra\nMm0ArdgDijn0Gs+Jzulso7KbAjrJRMOYXARPTuE64hJFoltEN248d6sJ4YUx\nHMHztihpE+aHhYkZ2dCmXUt9GhEzLw5SVpyQp4cnscdiD0LtaJSPBK1MtLyv\nusxo0+K/7bMSZ0kLmCKZLv+GZ0ot8vNd0TYpmSpnj/awLDDQx66RH+JDilIw\nXSwx\r\n=mxvj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL8NAcnm8f0iyumt1d/jlYYKLgeC5enuFnTd96aQfLjAIgY38H3OAukRikHD5OgNd0EaEeh+edvpDMHDiNqZ8l5IY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181102091953_1541150627188_0.1925760800350067"},"_hasShrinkwrap":false},"1.0.0-master.20181102112036":{"name":"@atomist/automation-client","version":"1.0.0-master.20181102112036","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cefafa8583b6d7487dfa60678e9a98c2c1617b3d","_id":"@atomist/automation-client@1.0.0-master.20181102112036","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pBCYF5xkJB5hLPrRpZyKtq9WMsVBdcAdItOP7+QgCvnIDkKHnS+JuUxsMTJqWu5sPatpr74fh6QNFBvtsBbcQA==","shasum":"822cce15e80ae633e9612ddd47b8a08794c23697","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181102112036.tgz","fileCount":575,"unpackedSize":4792699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3DQCCRA9TVsSAnZWagAAMsAP/2SKQH58leT9rSvLM3wr\ncCJ9zRSxQnYTnj7xy3pJVOm9VrR4NC7qYAjU9I+BA1+5ZJB9NS+MgyRPK5QL\nE9FUQlBLsZifvZVhIHYm3e/MbjHoGIC0tp3A6tP7WKwfWDAHR+CfuNq41W6h\nsntbHKtJwnO1Aca6Zt5Iu2OpWkjBqV53xfFWe+Xnmo03L5GHdbnTYORuOVZO\nE748jazj2tUth2SRn3raLOLuxEMfazozmF6MvEPKeZdwztN/lBVAtZXmgCrf\ndqFu+zfq37wNTui4iPO+kiqynaYQyqiL63MqL98kWCLRahyE6IlRVtUi71kP\nfgIZsHEtcVniQ3aJxXGKHtDsMD1pDcHXjWcY8cbF6v6Ol9lihcpVXHaLITeI\n/aktjCG/sd/tnkAdetXTIRM3dA370CTyliDz26GB1eoZuXRG556lQQTcuhUD\nxzYb0SbmS3VOaXGG9v7w+i17+4SZ+HWHL5qD/NzC0u0V5osgfXlkqz4ZreEn\na6YCnw+xGlFV0x6FFqGoOs9aHUlVuiqTSQE9zDlMDt8oZr0L+DTJY2biCHO2\nBFUIlw/tM7z06K9Jsm7+vFU/+GkH9UfSgNNcPapJ7Rgp2JcnLwXdUznIVJQK\nxdITgRftZ0GRsLHDCgKxqAO/1zID3V6wZgjqzO/0kDDeIq1F1YRDdOm0UrIR\nyfEe\r\n=6yz6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/BraDXlGC788vHUzpBB2+dW8krZnutcNgtsW1EQV9AQIgYcKqeIMU+sYD2OGR0CtWEh3Mf6UCvTTXxc7c44qZ+V4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181102112036_1541157890091_0.22457109640107853"},"_hasShrinkwrap":false},"1.0.0-master.20181102122016":{"name":"@atomist/automation-client","version":"1.0.0-master.20181102122016","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d33d9cfc82fa6c991f6ba80d18e5b627418fc6ea","_id":"@atomist/automation-client@1.0.0-master.20181102122016","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-l6QXOsBeR6wblaUSrujC66NVZFa2NXJcrBGyFt4qKKqY2su/GLMnVqi/xpocf/lL0LxbdWvQwRiTI9KuhHXQbA==","shasum":"af8785874ff2abec07da3489cf4eb4fc9c68bd01","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181102122016.tgz","fileCount":575,"unpackedSize":4792699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3EIQCRA9TVsSAnZWagAAyZQP/AosTiKvychyf/JCm+8/\nzBUkeN7LcZshQKtaUldEEI2jaJe58amTzo4woqdEaGoSJ2A/s9Mt88Fy7yaO\n6sd5msYWTkDsjM10gEgxJjN9lRveA6s2bqsXTcYe7P/UlxeKUvPEaumiDURQ\nIR/CTYECZWfgf7gdzDiXyZsZ8CyXoGmWk5Kc+TXc1GPjXz1xskNaon7EgPgz\n3tUsGLNrgkq8VMJMo0FQo5Mr0jaaztDwfY1rKkVMQmG+flhtyjDvoFOlUdOj\nhsq4D/SrtYYfY5/9xeeXinYSZSuk2T4l2Uf646SqnFABWNd3qKMc/eGlz73W\nLopD9QlnFLSZCs4pyfHMUnphFhz48xMi649KnSGee3Wl2kqe6R7upU5C5WCa\nfqy9HI0GgUZ/+M0kpVQJBokKmtpV7E8GCcP/pDupPx6SC2HpNijtJCEpk4UK\n263Fcy64l8k4OdptgfxEzNbuoTm59YAoXaleTIcejkrhjbiS3yzMmBgN2PbK\nyvzKMLt8tTvwgznTiXoAuXCeYjhpTxEYaIMg3b/JAwy1zxY4nYaw6rdZMJbs\nm5M0K9FOKbNSn4y1ugz8Gqd1CnmgMbEKC7b2Vhfy/Lqx4vXQ9egchzYcRsVr\nZgXKC0GXP59LgZqdboHEK7suEUwHvyb46j8TXebjsCNzoNFmVepQzGNawmzD\nc96l\r\n=KX1j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkKbNgb1rTLCgKawYFkC+bTP/U8hZnfoNqvw6tOMpPnAiAro3pEVNPhdEjbUZLeUnXkR4SNx0cgxRpuyA1jJdf8xQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181102122016_1541161487590_0.5910453299857095"},"_hasShrinkwrap":false},"1.0.0-master.20181102122147":{"name":"@atomist/automation-client","version":"1.0.0-master.20181102122147","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d33d9cfc82fa6c991f6ba80d18e5b627418fc6ea","_id":"@atomist/automation-client@1.0.0-master.20181102122147","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ECtMRyTO5XJYiTHNlB0DtE83UV1Thw0XZJzur5LltXpJarBQif/zMthQJXJSgw/5j6D1Q+j+bNfptDO+lkWifw==","shasum":"ff50a882a8857ec113e105006cfafac8a66598de","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181102122147.tgz","fileCount":575,"unpackedSize":4792699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3EJDCRA9TVsSAnZWagAADyoQAKDYvLFpJb/S5rZHXFZL\n+3thC5aHX3cLEAwxSAtB8DgLOhZAmgq+yitG1VJCrfddTmnMbRc2fJ4eBIaz\n4MtgFD2fZyV8XV8D8NzLgGkK77z+NEHO/Nkyir3SJ+GgLYJob8K0ncVSo5Fu\nHC9E7xqKWqV1kQ4Gjzu6svZUsUESBcszsqGfYl0WRFJbh9rxrv+nqj0MT5Kq\n4A8FpBSHWBcUmEeFfW8Y5n6kAyLoRRJQk3KAPVyxptddz6F3kS1LmdSem0sN\nv8C/cNg6BSyyWrwid1vqJvoa4Rl3dYU6y+N/aLIXcx1LvizDrcg2EIGtZ221\nJyW6HFQSvn418/WEhlK74NLwg8GrhlaFAXMXRbaczx72PYQujWYrS9WAhZnY\nJ3wJwdKJ66BEbvF0+SApQUvp0gnS71zlZHeaDEqY/YByG+5gzBNPbeGE9Nvp\nlDuWpyF1fbvyiCtkDjFeBFvBRpxQnw1in2dGchJcOy4qUbf4VIS4MHn0zoqy\nPgX3KxwGHhjOKt/qE4qXE9HWPamUqTY/+Y6H+Xxx+r5T7hktsQmq5ZxN9k7e\njY0ewVJj+pnfqJMsMTSrTo0FbPAgH8gBxFHMn0mUl2xU3o4jV8i4sev6DQGM\nIjvg19qTW2w3AvkahHL5EROuJxFisbkx79kdm32w663ojrG/qyxq1A4Xu9ZI\nXrHq\r\n=Z54w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCopqKc4WLDScCHI3FdrB9pNT1/o1oOMpeAfgL1xr/3RgIgS73VpxrTm8ep5Laz6qCOJaRu9sOPVRxd//HTXOHetPU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181102122147_1541161538515_0.13792947479384265"},"_hasShrinkwrap":false},"1.0.0-master.20181103143231":{"name":"@atomist/automation-client","version":"1.0.0-master.20181103143231","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d458e9d9a919a8b58239194ee336fa7770ecd48a","_id":"@atomist/automation-client@1.0.0-master.20181103143231","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WutFqJXtYbvFHbEYCjAi5GPgSjEhevu1Xzh5H10swmZ+XcHPl8OhBR7u2a4j0f8leL9psYMja2WGLtk5Uffmlg==","shasum":"e85e6fa1f3476c3a5a2d004d250a93e7e1827a46","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181103143231.tgz","fileCount":575,"unpackedSize":4793037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3bJoCRA9TVsSAnZWagAAZ1IP/jvB/gyBdNmaiN4gQ/SI\n3UJkrY1I6sz13nwJpCMLZe+yriegbRmL7OOUFz+cCVTnuGM/pXpCXL58ciZo\nHZu+Fz2n+Vf4mxqrbv/AoK8Qgc1ffm2PA9Ij6MjN71G61SKQ/h9Kr36Yz/hT\n5V4In7LXZSIAEibt61h/QYBR3rv3PvNvAlTHvoyhyNgXLNKhll05iWlqali7\ncXG5FaBGGjP0jXh/NRTg34PUp5iA98VrcR/hh0gh/3+0hgTC3JhWvIsjG/+r\nVemf+fK/eXxAAlsaFf/acko3UiWWlC/QvLOsAV9E+3tnAaN1H6tHVYewLJF/\nOGs4XZHVvIZWqO1pfVkEWzibnf9hbh/xVDQwTTrVbwAt8JqXO5qt3rb0IYuU\nAAOaloMFw8DZKw/Pu9TLxzb4271zdPi48LrSZiBYGRIiJYRnxZ18i245bwPu\n5TjyYUqKJZt5BCGpKcSltHdbjcW/Nvso7FTN3OCNBl0offcUh/F+YD//JmtE\nr2PNLrM/uZmzzcSdvv8BcjtLD6S8hdczwHwwznYSt9hj8uENM/0u0FLMBQFk\npm9nz/xON3PEsmH74U8NdsAc4C36kglmtPuH5Xg75Z/k53J/MeHa/24n273+\n8tWq+QKbC0YM8bndSkHrhI+VIgbo3FrMa2ylhv8Nie5pNOUBoQll8SHbahrV\n4ax8\r\n=AbdQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHzVIE+0VqMzfcBXq5qESnK6fSdNCC6Fx7CPvhEeDYGmAiEAjKiTtYAboXPyPwRB+ISKpV3jg8wEcQMDwOjVi6jGO5k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181103143231_1541255783891_0.11525728765434762"},"_hasShrinkwrap":false},"1.0.0-master.20181104002253":{"name":"@atomist/automation-client","version":"1.0.0-master.20181104002253","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5833860dd56b63737c3bd7e6ff05adfd73cd5f78","_id":"@atomist/automation-client@1.0.0-master.20181104002253","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nCDZF8mk7OaL7JYu6gUOaVs9IL9j8b9MnwDA6EnFnPFPdUAP2casG+LH8B6sT8+lbxXyf26C5JaaDQw8Hf5t+A==","shasum":"9c53f9c70083caa55ad35d4cf77b4b5b4769b0e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181104002253.tgz","fileCount":575,"unpackedSize":4793022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3jy7CRA9TVsSAnZWagAAmBgP/RRiyVa1W/O51WGGAH1V\n7fIc44QWP3FQqpFYmbqXh2SJ3A5IKet9in14uy4eX4IkJzTz3dWGSO3JmELs\nRB3GMIJsKgb4xNJzZG7vJO7I5qMlE00QOBx1W8ffpv6RkIhoGsS2oes4e/JT\n3NUzmJjf7WDcdZeYyINM9Jxildo7WC2jNiDd/s5bqCkuMK82Kr6ONc7xhDnM\nxzhaUDS4BL2AEa81e+gmskKZ0DedECbJ1KNpxFcyCwhGedbMOa3naKWvndpD\n5OwL+gJcD4ULbQD2Ke9yqQLt0HBtxSC60Ii9PTk2iKsl7/g8Bh6IQ4B7FlBQ\n2L+ZhCFsnHEuvNFNFyEN+EZd3S/mFsVIE2uNrQr6ZsiBg9ugTK+fpT5/4X3E\n0OSVVsHjGNDhKGXT39fB8DEhEJlAs57dUCO+LnAqmlCHNRvEmnapdvCMFIUi\n+vCtOkoo86kqARQX/pVHH1xTgIFqHdhiLR8tbobmHkKQEz4gD9csUsWon9ww\nPjAA4LRogEE8Uwb7kQ32bCPPiLgogFMqr6Ywk48ejE/VGG/d05Gp7ysSCo1r\n5gfeLewamhqLKXF+HzKjDa3RgvvKam3WIdETz3Pa36It2/yfKXHez42NE8A1\na6XTJ9H/PRVGtJYl3fvnS+N5CNyQJzOjwUdUp9D2gvxKRFeB9C0O0q9hkxy5\nBYPj\r\n=oibc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGNIgFim4kR/CGWVnZqb8mz/trDYvCUaLJHzh7FthaLAiEAnL07PKIBl5JKP0jW9gUmkpyVkjZYspohgtRxpc0GBQ8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181104002253_1541291195045_0.37615038493288355"},"_hasShrinkwrap":false},"1.0.0-master.20181105094555":{"name":"@atomist/automation-client","version":"1.0.0-master.20181105094555","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8560c9f64a6f463573d051a6c6789e2ce3b1a552","_id":"@atomist/automation-client@1.0.0-master.20181105094555","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xOxjv2EL9BNVXaeXq3sZnSQQvyEpl0tGzUJrz2GQRU4cXSe91i0obfmgUnh17qwimkuVJaoXOo1ROMXvfvecdw==","shasum":"7b0ee56852526261a770c6c5309051957c09ec03","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181105094555.tgz","fileCount":575,"unpackedSize":4794177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4BJDCRA9TVsSAnZWagAAZNIQAKTFx9wToi5AAP3MCZYM\nSIfkUPRNX0bCv6+OdRTdgH93ptnnkyjBH32Xste85O+ByDfKDRNJq1A9Ox1O\ngienTQCI6tZ360fqdUy0lz0r5vLCRwQ9kx4CaR2FL6CYQTIcvP4NaD9dEyKO\nMAMqRIDg8fV3UEJ7+lSAPA2rjOJJbS1xkQvW1SGPYQ2Rus4fcNHC3qhznv0N\nc4nERZYchN+RSWbF3LRon2LaXEhdqqTC59w2j5/3xXvd87kDRHn790qs1kt5\ngCjhWYs7ZpiBxJCgt33O1DwPtI6zB9/waCLat9SqRlLJkmQ1ZfXI4cTu2Unq\nioO+dHwKJrr8uQ8fw4lz63MxTLZrsjnCkg/C5fMXGH48E1dyUafjJ3fpxmjr\n4g1ewxBTQsC3eQLQ/t2YZHTbs2nsijzMk2PSvcpkyPIS0d61y1ZQVifK1IAq\n9Nahpzb9Icdr2Hb4z2WS9rn30Oo0XnNnWaEzR/t4wKVtHpjJVB2+uGZc1aCb\nASMOOQf+gm8BF0zlV4I02rBAl5dAq1Cngsu10NO0xXGVDfzmqfGxMQDWKqzw\npEN3XsnZhY5eRH+8J/fxVUKUsiB5pjUd7IuwlL8Kd8CcrlGGlLZnWoLBQd6T\nzM1nJp5sM67MpV5lBsMdimr/0v8sUb9KjeZ8kbFov+IOb2IoiiJIQ2w1w3VZ\nW1Q7\r\n=1pJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUAt4bY/KsvXy7rKNi4ga8/QJeWA8qIIm5/Y8WWzvyUQIhAMkiCWYjRIjjx0I1GTophhZ8m6s/iBJ827w2pGtx3C97"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181105094555_1541411395090_0.554417618885108"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181105095044":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181105095044","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5d0b5436ca144798c57988f981e4d6ef7a1f034f","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181105095044","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-D2YF4xjjUcqddlv9COwPIvwFdql3Zuw2wYzhK9IBln4+xDphtTriF+aZ6FNC5PLak+F51Wrrv3jpo/C0MkrYLg==","shasum":"127f21ef94f92038ac043a874d2b16628027ddb3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181105095044.tgz","fileCount":581,"unpackedSize":4804091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4BNrCRA9TVsSAnZWagAAhE0P/3l51rT+JttW2/GHOkVU\n/iHLkvf1acjHBII7zzSqcs2eP4fSjeYfIBJ4c9nrow2i//OerMRSLwdoXa3+\nbgTz6VAUgDrHv8WcQtn7tVgjxtDWpcS5rQgS3SP8m708q0OcElpkz+jRtJXm\n8TvaA4GSPftv7oHj3ASGfSPwbyo8j8RCb1uNGOl5f+FDGboYWtZnTti20yJZ\n+NFBS38BY9r1ohOjtuUgE3a1wbaq8EygarX7SFXlerQEPS2U42zPt0ULzToe\nQJSrdNO1I0475fE387AHdrqHlECYklijGEn1HyteprgvIr5mxRUGTYTho2hN\nAsw2I7zX+jfxlHLd+dzo63SvUBR98khjg/GWWRB8OyAhTISqrPdrZjpf9VV2\n5EnGsmWMIWiBVNlXiS0BXadue7oHAgj+r0jaMHh48Q4BvtKLjusFQYKuuo0c\nD+FSEi62grZwus/IrM7BIAPoWQxA04tY5DK4YCQJO3Q0U3MwLuQyAE9EKFpB\nEIBcd8sWeqPqyJbnUKe4uBcc43H3pYG1qRwr/WVZ9Lru5w9XPqfbf3y7oIRE\ntnr2WMWaev6WROyEx1VcTObivTrgL1FgqIo5EA3gK+Aa2qyA4M/ftg1Pqoty\na3MVf53uRXjXllTh2KZ/M+OmSMFwew9qNPqorqRuB2G3X2zUJooZYjXyavaI\nXOaC\r\n=elAo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJGofOjlg1ZRnbPlUDLf59DtuecLWC031W+ZzoiS/xYQIhAPt/fvm/Z4cmQ+Hu7QAxfIdqZt6AgI+Nr5WK0BsrzVc9"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181105095044_1541411690910_0.30480878884593765"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181105103108":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181105103108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e186f3c2398a31de8695a980403c1ef7d30ff0b0","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181105103108","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XMffffpM55thSc/H0t827S8IopvOY6lYQks4dclheRocSCLNn6Xdhw6Mn99PGO3Im0ak+GQUknw3vBqy8AIraw==","shasum":"5b9b834bf92b48ebaea462bd1ebad25cc0f9ed38","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181105103108.tgz","fileCount":584,"unpackedSize":4807831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4BzYCRA9TVsSAnZWagAAmLEQAIA0FfULrjqnEZ2OvwAe\neRYjKAet7dwYZsdaKlkd9tTFJsptJCloVHLsDsjW4q1FbwXVcuwZcN/rSZc4\nekMOv5W3eEkwE4w52uXYm23Fs3lynM0OIOjRVWMK8t/F3N/GoC4+4Lu8OXvG\nHQItMofLhEk60910mCS76M52h4Oa9prdUQI9UFeST50lJx43Vi00vFg5KYJ2\nMU2WHBdZk0/3IDol2tXshgDBrFvH/rf88FUw36TF49j4clgBke1IBJ6Y24Bb\n+6VGC8jIeMbqirzlHn9i3pjtrsPzZFfDSYjbvbrfQT2gn69W7Dt4+4qJ4UmW\n9cSAT1yG2dzQb/C+s12bWANGT/24qkwwZwpKtdHa2I75MpDeK6XwEzKAiIOp\ndUwxEOqD/81G2e8NK58uB5o/rJLaE1bmnbHimWeOAMrf3BY+Q/uFBsbEJz73\n0roqz6SiXQQzEeC6jSodDCED6HlfXZY29o5hqIxYaPWhlYN/vy7LHm0Zwi4J\n00VkgbS3Usxsl5YVNgZ9KT9rjpNB0veX43ZmtUKD/rNJS2wx4ymaydrw8Hbm\nIZr77QuiL/ghmCpwqVlzjXAzJg7fQuddEHDCj5rVSHO5jfTl5NY1cgEFL1+D\nagDFQutLneHy7+onzMhQDLpn+rrn4IM9YDGJ9Al+/7Czj4+0Gig6/4AMJIMn\n7CrX\r\n=/dlM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSQ+Ltz5qXfYcLZbjFK/dEU+/Wulv9nD1Z2W+iXvWvWAiEA8Sia/gJAEx+WT6wY1XIKX+7tQxMmpjnpQroUunL9Vi4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181105103108_1541414103946_0.029448763174564352"},"_hasShrinkwrap":false},"1.0.0-master.20181105110621":{"name":"@atomist/automation-client","version":"1.0.0-master.20181105110621","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"99108f8ab3c5c7ff9edc1e3626186bf6baa12133","_id":"@atomist/automation-client@1.0.0-master.20181105110621","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-kI0g3gr2cURLxLHb/CHCEAkNX3dYubheySlaSIGfQ836j+TCxEbdvMyQ8QSypcRQ7sD0cjBA85lHM/Mh15uEHQ==","shasum":"11b3757b6bdf6fcf24449f492ab3befaff17e9ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181105110621.tgz","fileCount":575,"unpackedSize":4794179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4CUZCRA9TVsSAnZWagAAlv4P/j2jd2fpvkk6XQE2SKST\n8VsaYuoclT6nSH7OUeO8w66JOKP0FmGpl8qrGlHlPqB37Afc9dYtfAdVO/sV\nxKVjapRIubU3pCJZsim8ztwyNYA6BAMWSjOAhoVGyYDfAngXlv388P/XhWBA\nn74/wXRKFDv4JcuCFfTx0Zuur5VXDAUreOOWkD9YGDLQBQJCgbqDfYorEBA3\nc7DyTqDLSoAQe+aR83O9jRHPC7u7yOyrtd4zE0O9U4tGfXF6kyljaAaaOrRq\nokK3AXrbndAyrh2lm8fY7ciVZIN5cEoHcDGyNisHBVVKzjTNaXJzThroa7D3\nea0LmENEj0STUaGl+qly4fTFTt5hYb/yjUnjMj+nT7q1mnPQmoKzbYx27hq9\neDQZtwgPGtIGPrJMmP8Ana9hnFPb5ZcQ3GQIT/fIkZXPFjy3+QpuhPsjUoBH\nCj41nf+WXV8FAAdR66XruePdEw2p+2ZfWCt6iFVIolKOxxrxG0kGvpHHPY4H\nu/ggBL/jH3jNWUNzh0L16dhIkCTPfaM3nPNQX8/MxwuYK7+u+KqkPpH1smOB\nv6p4VfJ9Xx7pRuuiY+xhqswZXMc1siYVx6B2T18H/HnhrEn4G4qSrCc/IFwn\neGd42a8W7TvpXaAjhBNTi0fpbpHAOstMsPPaqfHbLxPukHWN3zAOgVf40Tld\nqFAU\r\n=Mdui\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFgT0fNsDZKyfiUaADCbRBMZvGy7uN7S2RkKRTrYm9bAiBMj/ej7SgSRwIDIBx3obXHAHeYWuEpH4529i7ZjaivSw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181105110621_1541416217113_0.959186953002588"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181105144737":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181105144737","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a779706df5f09e193f693683a06f1b219dc0a8a3","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181105144737","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tvVAQmjONjqGWi3AzcSCvxZs+OkHjROffWsE8TVs8p//nPJwnxoMO5Fo+xvH3r34XLki9j9sfLICsJ/dTMXkYQ==","shasum":"8a57034b040304512823d700af71c96d6b9519a5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181105144737.tgz","fileCount":587,"unpackedSize":4809224,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4FkvCRA9TVsSAnZWagAAQUAP/2w8CVWGjjacwnRKRfF+\nhrFsqvQMz2vr7G1exGq7nyTTqllVl5HmKYaPeCi34etdJxFNIwK+3slb4Xs9\nD74AGix48wa7XMU3QFA+jKBQtMl5a8SK/3HoIO9/Utggzn1IbzQOm7ChyRUu\nQbwO8Uacmxq85g6XhLe8H2d0FiMmqyXEpaTOsHNP0V9qDvxhCnXTYB9iV4Ht\n6kfFwjkHHIUmdCZByTc2WcPNJhXgBUXIiUY/MjBcF1UkV73WLs4Dasat+nlV\n2QSeRmYFLar1QtxOSfVvepUS/8dF0ZbvVHblkEZPy3GHjyRuLyailqp3r1PK\nCjaVxssYuT0llWQWprqr1PMFv/DE2B0UfGDT3m/fuRwjblQ1XnnOonaA1SZj\ncUlvZ7h0ehWmv2ovkf1G2wg6dtCnyWEHlC34UqPnc5ozvm4hrk2Fql8Y+Fru\n9zgpnL2A7v3YL8dC7zQ5B2uQjMOcSVdcGHBK9qD/PjKmdFMVMZpIpbB6s/eN\nRwfLfZ8HXNlYlJdm5d1CCWt+mT+QbaHcmeQwHzmlaQsN47zla7x37etAzJhw\ny9xc7tWuEpViEtydI3bRAy06N3ltiC6khtZjx9Luvnm839cSYsqLHFuYCIKt\nYTbyXUwhj9/96P7G/OTh0RgMnJUitFUontdyk8dsbcd3SpkhLNCruMfydFu6\n9YT6\r\n=1CBb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrWEE5H9web3bvKyxTsHZec6mk0+D0zVKzzrqbL8qYPQIhAMOQQikBX8V7TIp60Y5OTRk3Hd4twBHAIB7o+2w4XC/k"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181105144737_1541429550262_0.8944136920972168"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181105151807":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181105151807","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fae37936b1b840d981aa1cdbd21e586bf7d51c9","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181105151807","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7Bia7nrVW/DH3mvoEv/qz4EhOz/yDOGyBw1G1Pm+g12aGEec3TeNvMrN20/fH7Uv9L1Tl9WIvA13YoQU6zakmw==","shasum":"dd48609d9d62d3249f201c80ca2c0422e1ee8fe2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181105151807.tgz","fileCount":587,"unpackedSize":4809456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4GAuCRA9TVsSAnZWagAAZTMP/A97pO5iHhB1P57WaCMw\niC/YO6ZjIUy/4rvgmE9o+931ELKKtixH9Ks/FWnebkHLxyRUs52OPUT1Eknu\ny+PPt3dbEUIHygdtY1A9wWJzSDGFeRoiFr1WgEhTTaoPdUN7hqqTqbKNJHng\njEZQispSmK7AD3c1H8jJQ8YRvotpxuL0JTrgJLAaxc29Q/exnioCWn7p1Qqi\nJ0b9GhNNkxW+u7iftcfZT7+ML3LhETpCdBYmYk11jYV0OP004PCsGMqi9qcR\nDF7NWqhcvtdEXUY/xxiwFj0jbRqVxCnVj3+ihlMzbMq0D69hHleAZ1BM5JsZ\nNOLCOOO9d7T/njgXhkDIHCCjhyCD4RpWW3JWoW7Xqcs0TgK5zKvGhGjDdh9G\nMnYNKQ+NV97llSgvEq6bjfCrisg+PrT848NmnGVNVdsa6xcd1C+KnHNVl/l7\nYY4puebcAdU3Aj7ZSxzTUOZjJcnH0wkjbTuOnLjMgk6k8gt5bEtPOk5nUMpG\nbq06t0Sw3dukQiAeV20Ax0jM/G3zyp9PVuvP6ln++IdhICLpEcAesb2JCAxI\nFAayLDew9fbTKUbC5dT9aVAhEL7qN2Ce9yAvnjpVElGpv20rxYdMVVY0Zfav\nDxg1+VTc26JBbIfMvxnCyDqxgeBffvTD9SPIo+DciX5jCjhcJwX5JQ7lZ392\n7u4d\r\n=ya4E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsMAdgZh5ZzzNFoUJZy6OhchB26FJ7pVYIlTivyQfqWAiAJt259bDLI5D5QyaXxPHzGfScVflNrjLfulM228pYZNQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181105151807_1541431342126_0.975865103597781"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181105162132":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181105162132","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b4e11c5de7f119fad063e656b4c11b651fbcd51b","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181105162132","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-q4GEAJ3H0evFPMkKLmcYZyVkeFo7RP1R6jsQXJn5DhrOx0dj2J46PcKj55BStpbS2xws8VYgDWhV9JaBTc29zA==","shasum":"f168abffa8bfbca3b2fe8b8ca9b85a3716c4ba5e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181105162132.tgz","fileCount":587,"unpackedSize":4809409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4G8ACRA9TVsSAnZWagAAhk4P/0dsOAVh4Gg2ciWBv6XH\n+K2/6FYrS7MqJncDUjZJmOXc9lad4I+IgaixXXbn0dOSTJ+aJdV0ipyAJtiK\nxtEXiFqh1VUggksZOsPEtOYJ2CnoJZrD6TVteT5kpdrn0qEb/1DC6g5xRkyQ\n5qocooYOfPrDBWs10Eh6HG0/UhWTikheISgyjZDu7ktQs/t1oRCUwahMRKpk\n7LTJamSWzCTC6jNaOmyAm0I79pSk/KftKAQcqT6z4fkFAontp0vnRddkpycg\nTVxEhMlYs1V22X4eowxEdyRDs4QRctcvluSwhErhlLipbW7ABOuLE+BLBBqf\nIt+U6kuOKW3hGoDjM9+vd4XlIWPI5fJjZEaCD6pklwczJeaneazTiYMqELrM\niIxMalCSMcXzjid1W5VjDaMvX1u69sPPoPKMQtcvU0HFPcgqqy2G1ItPt08Q\njRn2+U9AwTZRwKad8bE3FRIjiTzxJL78BJMd/RfhnYxPub/xucUDNnl4Vc0u\nT5ZHO66dPQoeO/4s4p8HNgj6h4TGKzo8DV80O4c7b8CENKn+hgFrQBpRLNGU\nUGeFCBpNuhP2WIRa/O1CSweP1Gh0kPTQVMpzdtfA09oOTPjFWV5fKY0Lhl5H\nySXKCilFTxZke7dUY63z6B+VJy7J62/CaOB595nh91N+vOZ4u452EptE71xt\nU+mC\r\n=s35V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA1f7/xwQE9mdlZzsBbo72rBt00quCyHUSK8xPhVhjleAiEA+jPT70w0iCDez+PAAFGv3rJ/FrOlV14rdLHZX8G485I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181105162132_1541435135721_0.11613921824350504"},"_hasShrinkwrap":false},"1.0.0-master.20181105224410":{"name":"@atomist/automation-client","version":"1.0.0-master.20181105224410","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ef0fc953c6e4a670cdf6c5d1d9e582f5ba7244cd","_id":"@atomist/automation-client@1.0.0-master.20181105224410","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jYke9nnSvPlg7eTOcVKHdkFzqDQNZ/B8xO+z0qIotoAJHsVPPsnaPrsXjzAG5USiRZJjOQVymWgT1cxAQ/u+GQ==","shasum":"e2e67fa0de87d851d50d7a244a62c1cb7c5ac45f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181105224410.tgz","fileCount":575,"unpackedSize":4793909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4MinCRA9TVsSAnZWagAA3lwP/jYW2UIX7kEg3EjU42Zq\n3+EyxcmGMvwQTMe75eTUDlf42unrBflWfgQt7KLld4n8chL3QwqDmNDpbdIg\nlbCvOdZhIXcYYh+wEdi73HIh1KRjkZmCKrrREHkgczBw5KRc1WijH3NwEO9+\n6kHK2nKQ3AVOYn5LTBIgcNI03lHLYDFA/gML54aT6gI0j2QZ1XJnQ6/5vykN\nF+GCJIjMUU4jzWGn/Eu4FV7ktw7wXG07WMY/AGZL4VxEefa6eDe6soEmKHfs\nj+/dn4CPDGTGXExwLgjKFcmSJYhA/jhxPXb6oyEH3T2yu3oMwyKVPYMNXuI7\nSSru0QE1n02symZRLSpNzAaBPgkzRMkABhaX2wmMWWjSRNujZAAENL+RsV3c\nHRApeMJB8kPfdiE9HBlXySsby1BRHhSRPSyCX2DKfnb/eqKaadbMBP9JmJBy\n90ERlIqkXBI9Rz6bnN6Hj8oJm5ESRfqyrSR3JdlF7aHbMYPY1NVzoUs+x56J\nzQwjTY2rDFUqCU3v4rT3sLcEMxqaBrPy7R/FHHl6SFpgZUa8gSBM9wSTTiDb\nF5mfqTMe7JuenqV6fkDY+l4Al4OfSpFFfv9OVqCnB/P7KNRLnWmfR0NRk98u\nZwmOZrlnktoCDKYv/uK+UIw/SXgyMFKFI47roaH/B0ErKf5XR+h1i801AlXI\nw0d9\r\n=kju2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkpLeiEvjHX12S37HwO1ajwfD6Ng/cS5doUEtQS5DJ3wIgLPAUSUIzq75qMBInkztGG+mC+yjTpAbsBWTsMYCfRdY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181105224410_1541458087189_0.7948421882333616"},"_hasShrinkwrap":false},"1.0.0-master.20181106085420":{"name":"@atomist/automation-client","version":"1.0.0-master.20181106085420","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ef0fc953c6e4a670cdf6c5d1d9e582f5ba7244cd","_id":"@atomist/automation-client@1.0.0-master.20181106085420","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UEb0YNvISiXLC60fNPnu6uX5CoB9Lr8sURL0tAxMZUCREsyoX+Z2uPTyXkoRp4nDMelhCKIVe8Me9p6cZqloRw==","shasum":"3f97f11b37a3070bc227454875468a2b82f7db2e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181106085420.tgz","fileCount":575,"unpackedSize":4793909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4VezCRA9TVsSAnZWagAAC+0P/AwGUVCsYFhsnw1ngADe\nfPYz2x0+MoE0GaLHTSU491/CZJAgCbJeWdlMcOHdg7A1R95ejjlQwQSuCHIo\nqRkyHj3SlWExj6nGkoYwzjZZxOUC+xunIgezaVrtn/UacVilZQytZ8tFoUyE\nt2RFrKp/o9Og4aGt2z0Gklc8z40P4qg9d6WmteNKdaNn6WDOip5TpV39QX3V\nxUJ1VI1tpEDqjycTuNldpLGUSa/3vIw4OaI9DHITeUZWmYktjMtsHAjQMEjr\npoECRgpGdMxZUazzGg5HZQorLxwx7iPHnkXYQZAbhfLDq6MXkrUmox2CtX4d\nKgc/JJP5EFeh3OS9O8zjLieGsyCZomG2voai17KSpiZAV5WoWxX8QRAeGRVu\nPyqaTxRPmFSgcsQEpYMXQy71lB73moaiF9228HzV8g1D3u8+E3SkoFa0XsqD\nz9Yl6hFmyZ4JJSsSxUpIY35/nb8EYaPD4fYaUHj0CT7RMhCY8RaJ5Xq2misu\nZH0AUAICvaiowmDd9MJlbU7yU1bVidPVWQ/hvGMvFSRvr4Ti5odBwVBPovhJ\nKODYCR9nn5dvybVqpXFs6+4f1hmr/jDxHzqeWauXZhw/5dxmdUN7jmKT5Jk8\nJ8yADlvRqiHztTS/UDlG67YThE/u1zzniKbdQppoJfNjT+c5Xty+tC9hJiIc\nDDne\r\n=onts\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHF21+b1Salo+5LZ/VvhfNswjFAeJTl5n4aQYmcblkslAiAlqz+CmBSXUaS0dUYWs0Y6IEHuuceUPRUhkmNf+wswtA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181106085420_1541494706190_0.5675005084764941"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181106104653":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181106104653","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6f031cb979b92f34cb93e6820acc8a9312c392a6","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181106104653","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DcXZOV4aQVZJueiYT0wv0q8heLtJPYCxbU7Sczm/NYCccOJPe1a9v79mQlatmUBneYnhYLWa1EG9Gh7lN9jOKg==","shasum":"2e2494ffba91b89baf6bba7b71263fb1939dfcd3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181106104653.tgz","fileCount":587,"unpackedSize":4810784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4XIhCRA9TVsSAnZWagAAdK8P/2zm4GGzZVF7wYc/5Jqr\nZzHOWokhFLLOcTksJsmCQFbWZ2ep8HLno9kujrxnFHJAINNL7H251cRmcORC\n8v97lTkNkUtiYoThmq/OJ9bheQoMyUYG5w1DEQ/EDRl9v4CvCx0YUpUUn5nt\nzOcre2/LE1NvXQrkk9emsChcCRj+m8XYJnqzC5vFxaA1DCNL3vioyCr/XQS1\n8a7kdOZRsT7HZghgEpy7KIJCvu0yVtBrx3PThyKQg/ziST+eQSXHis/etqF1\ndM/76VMDMUreE2JBgn6DRTYNhwzm3ugQ17usJUEc6B7M9/FSwCwRZnn9KCCd\naj85Uc2Enfjll48BXeEtR0f1l/y9wkOHPk7F3enkN7DNZB+HS/5Fytayu9y6\nKomOk2DDdMIsRam90IZyN/sY+BKQ6B9UNq7SaRUswGPDFIin5YEYc5t2mqsS\n7o3kXHOpGmwbrAotbVElh12hFjVy+yLs1VZRDCJ2B9FergfUIHMH2wSoQ0hm\njGih5/KTuynZ4FvIuimQYYm9PIwMrBSsZunizRM5A+i2sQIhPBx9gkM/Yi1U\nFyIrUHT5IcR4LjCpqmPMKVsnSmpZ5eKQw+7WrNNdKYHY3spPkmSWiCGVJVMZ\nf8qKV7OCXP8jviqxb5ZnPNFXkzvSSZVjtfH+Sy45Wt6IVgA764WU08r8W06u\nf/1k\r\n=TLe2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPvk4ue0K9Nhd16CgUNq56nqx7bA1yGlsdC8fly/fHMAiB9ISXTyc5vyFKMS1LlWL9c3/U8ftlr+6VrMXLgThkRlA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181106104653_1541501473231_0.5862655754480224"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181106152427":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181106152427","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"09f1fefaa897baad10e5a80c9c41422c90c73baa","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181106152427","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LAczepZwWp97SXJWKbqA6GnPVm+Nydf0Ktb4Fxo5ZU2RmBscbV8/B8gmXtWnDvpajiqJ87hSnkOI7X+ZEYZAPw==","shasum":"5e482843615fa6308b0d7274f5f4b991e448aecf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181106152427.tgz","fileCount":587,"unpackedSize":4810750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4bMgCRA9TVsSAnZWagAANG4P/iYyv1cBSkNZLvVN8yOe\nuk9m0JqlLAz+EwFPGNPMvs/SWRX5hghNj2cpYk1eeeNwBK7UNAWE7Q6QjigJ\nq+mJMZ/jGGYyGGEVhVX8eHJOFRaBGJNyWYMLY0I+YftEGGlU4sUWTZyRSiaH\nZqNqUOUyJe8EvOA0onnmy+5UuLz0s2rBf78dXMliNybITN3niqZPwom5v/b1\n70io7KxRfhyQZlZcMDwcZrEJ5fkdsQ9atFKwTY67LFKVYMzQH6iQvnVWxgrp\nEzD2IrC2w3knnXcxXJXKKShDRsKCVIyfC5AOUyigdXnRGCv2MrbWqDsBdb90\nUcuR58EmvOXZtEkpgPeLLaE+/MwUu1893hNINSAtSpZz2VE2WroVDvc4j7X1\ncDIFhWVKHFyXaucF/jwWEliAcZ23/fqGCaaVCHXc39O8olmIctQVKzB1YrVm\nlq/ITsyoZuf9xqG2C0Ca39yDW1SQw3xnJY5ly7YJfJD4dvCg1QBpfHOqX7tD\nBpiOonRnXHnk8AuejooxjOHbrwvgHSDSL4FJXGdDkVlZefWIHtTkW8M7LxpG\nA/+O/df6/4Zds8rtb8VrljDoVHlC3qlFs68MVMEAhcmqK5ErQg0Ft4sVA7Ki\neK3P/oeYz1VdadP3tq1Jjv9v9jVALGGS3ome8Y1aBttIbLP5o72V88LrEWlc\nK9s7\r\n=rdA4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBuQvYMXn5K0OXgaVx0pFIzNZiFVVnHJ1ulWf0B+wT1AiBfaGpWN9fWnlIKqqYFoxww+txDuj/8HMEpf+dWuiObgQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181106152427_1541518111994_0.3518041249822712"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181107135722":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181107135722","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f5b0ec73601cc0bead13631bc80f9e8ddaced2fb","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181107135722","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-SxXwgFPBydqc47S3UBAyn61Ea5sIfF3RJHrefu2U5S90MFn7jgqN/1rPGzkoZDiOdC2JfF9dhxGaWZretcqCeg==","shasum":"c6e2a0dd731ecd000e33694b5638aea09ad827fd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181107135722.tgz","fileCount":587,"unpackedSize":4811468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4vA9CRA9TVsSAnZWagAAZMoP/3/vQBy+PTlmn41W02CF\nmCW25MC+s2gues6UKfEF75kr39gM6R69QPUioZk6cmAYrlF15H4Gn2JecAST\nlcV6NZheNtnL51p0+LLpw1at2IyZvG7okYheUOdvCJPRjhmXCvO73XumrGZF\nhoSLFtkI9dnagShCdn22udtFPKcXvr6X44zm7PrzQpTxKJ4JPz7Rb9Em5v5x\nhLSwx8OkROHCiKhl6F+x1FdNHidp9V7M+EH6Lk+g/ZIOB8i6Yrc39E5PdD2n\ncce5Q3O6Vgz1eVUfrlLIuh8KZq98hMQRJzBFg1cUgYDgfrrQfELYpJzcOXuF\nxPF2RlGSUxwc0lFlHDzbZMgt5z8A4oCyRUKMvIkinZj/+SU2+oSU0Kookx1d\n5Tj2G2Pm6S41GNpw4+jQX7wR6pmyquaFyKN7ZEdtQxYB38t5h4Fp1ByfRjvH\nVPArl891x8N6vA3Wo/ctHMmJyVGjowpFvKhxtJu7mVOtm3y6CX+JchDIl9qO\ny5GM/2iMD36KfiJp8zPkZd4IHSNXuLIh42kPZKcQs7yPGjXHXDDJ0gO37bAA\nKW5Gpu0VgG4Oi3FHzsDzbiQIZX1kXN6wHxiclHJ5hq+QHvndGq0oAHLg1f4h\naYs1N1qbWxt+hcVcLg68wAmTnv61vddKRc878WxgrgUSte5sRJY4R5TaAQsu\nOGpP\r\n=e0Dw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVIJ/IIPygXooNj/X8Zi4sWrn0ljFngWhGlDZXk8DilAIhALJPmHToUwRGhRYxbPFe8+Ktb5CgINQ3dTpU+KGO96Pa"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181107135722_1541599292483_0.4219576649975507"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181107141157":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181107141157","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"48b57aff067d5715b763ee052a7150e8f2d1bb08","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181107141157","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+gX5WWtbTuiCR13Bt+SJ6+M2mo87bndesXMndb7NSybFjU9lUQNvAqtS6NfkEpLVd/3Y4qRRd67iscIno/UuuA==","shasum":"04d2f2bd66d9e6b117b6e8c50ea2f932cc45c6f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181107141157.tgz","fileCount":587,"unpackedSize":4811738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4vPKCRA9TVsSAnZWagAASAAQAJiCET9/WhhPzv3olpsk\ncSNplpr2c6AYLscUS0KscYN+9kQcGW9mSs8c33vO6fbGDgP/0Pz2i9Rp0673\nMQdA2qNrRcepht7i7YeMVsq4UJBAWBEiae53X/avjBKVlOf+kd874dTJVEfc\nwnHyLTkXSzraZdwmljkJ1hyDXk/wMJeZPyYqVwQmMPLh0gyOxsmiPsdZ98ze\n737DdGJC7By8SQ2XqWVmLIoC5PQa3FFWXGH1k1B/a49XT8qh1juayKhTtBT7\nFoQ0/IYsWJ+LJszD4b23OYS7cwMiNGmQF7/uEh1v5++Nw0PVVp2V58qjKphi\nldPsTWjD2tgTCz614kRJFC22RokSTtZXz5UmMsROWbsJeo+6znZhMbCqUnWA\nGQ9eZOd1XpC6Dohd0JriH0RJRywi0e9Socsw/Th41k+QjOcjffOOCbKIgu7e\nYjXQF7GQN3rUGWRb1ad4HglRx9h6p3H+xQU+M9mjEzj9U7D8eBldmoRUJxgO\nCTW9N25uQwQdx6CVDX+9pUHjlk40Q56rP4/A5wGdBgucB6OGxwvZOjObhysF\nWYZ52gQ0uR/7Fhoe2BIxIGXIy0sUUBI38fqCQnn2NRqYUOBx4etdlKoFLia8\nbFXlyu6BCq+j4Ke6W3xaqRlB1+xOrAnPtQSZbygx84pE7bwR5JCa9PZjiqVb\nFa8R\r\n=n6x3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqTneShb2f0B8P96u3yx/GGahp55LDZAC1EjoNdACG6gIhALkbXGUEoknUJPrgY2l5vzACnYZsJh0q+UIOPSHcb2em"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181107141157_1541600201631_0.24918250544926446"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181108144933":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181108144933","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2017e7cf6ad245a704843f850685d6e98bc6319d","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181108144933","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-o7KChnwqLZntwSjwbRzhGiwhtqkbGaqzAiUuZ4bYgWaWO6thFv6MD0bL4/jBhDxEsOdkM+1nnnbB370OqBR2rg==","shasum":"a469d4a3e5e68c2440999a6c6266399e04eb4358","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181108144933.tgz","fileCount":590,"unpackedSize":4817947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5E35CRA9TVsSAnZWagAACnsP/3AbUMbk1PJd4BBaTfAZ\n4qFOiP0+C7L2DwdKBsMqAlFs2VXnV6e+DI28VnJwXINnhgho3JB1fzno0B/y\nei05b5SVFQNhzW2NpKrD1swqNHQFb/l6blg8g2kzUJgVBFSnnXu2kuElTEcE\nhsOTQJcKhwxmEM60NsvmPN3hP2oQcs9yF0qHdy+Ych5+glyjNdztUABV7Z2e\neeAOh1p+hKJSLCvPHGiozqdvYeQ39p/1wPQ+4IpLMzUKxc6ijFh9NIXUhQ2J\nthWpEv4JhM2YRuwY/WA8zot/LfmEs+2tlfSngxtyuUqq8NTV7iWGPs6eyToY\nw86VSOymH305fS850F+KnphLvQ+7r4pkHbRh1yZpTVrxHRpnvC5A5mzJSXSw\nJJqiJAbDLcRr48EoQrdAaS2Yc1Jm6buQsqBGWcvyKAuX8PA4SbETgJDuFcJW\n0grP6/2+dbHMQ5NSZXCDan0Z1X6f8snBLrWrmWbDbiEcwqHwb8D+Lk9oSKft\nxmqnlVi92YlQYaeCgPyCswcNM2zoiV5KHmWCAbH22+xu/+XsUhusYhcaxift\nWhcCzzhpBM2o0N9mDE4FA5Kdaq+V2v89HnR4sY5uRRYPUpcq3B+oq4422Mmx\nl4d8/QqIMJQV3k7ElmR72lYmPLBKslh1pMHQ0SPNbt+LQf5xmsYP6r919DaQ\ny/A9\r\n=T5Qs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw4i0NGKkW2O7MdgHeiP8LmODayb67wiNN/ypbtRjX4wIhANy1aimOYieq8Kqv0Vp2RdH1xPkgl8/JXlQe7qEcSoc0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181108144933_1541688824481_0.617267425752783"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181108145135":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181108145135","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2017e7cf6ad245a704843f850685d6e98bc6319d","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181108145135","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XJvQ9CHJYxw+Xqr1ocMEwHWYSD3WEaa6h+9M6ewoDDomoJg5jlSdAoDjfTSPrjpZcA/W/ToCdhs6xixfkdIuQw==","shasum":"675d427cc6af989cf5304d4cf10a2712bb1dcebe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181108145135.tgz","fileCount":590,"unpackedSize":4817947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5E6HCRA9TVsSAnZWagAALBcQAI72883CRkmAHjV7CC5U\n+yOmtyZuYjQvxV96yDB26qd7juKsveg1JS0R4vjEIrrF1Ax4HReNrssDeqhO\nzq44o0RhHsSEC6MOxCt1wq4wIhA+l9aWebF5KtpuQCFhgZqH2+SQuezOgJyV\n1uGkNLN/bh75pZpnHnyKb0LeFPvLZ26XUykTpa92M7LI+n9kMlS3fNKShnhm\nUSek+D4iKjW1vA7sUulRZyunLWmyG1BnDqqBozlCGu8S3KzWe0O/oBxPbSb/\nupRrGdrMHKaatIW9IGPMhFRwThAWrIu6el14caOTcnUMLDKVLJp8sKcP7vfI\nO4zeqiAWaAVxTrbcWjlaEIOM1Q4JdI7sbq1cntoWd07dFPM1aeWr/SLDRio3\nD5KcVJA231AcCh9tZrzH/YNA9BX6c1jEY7BKLNihX1uecOfprYq9cwIKOFmg\nMUNeeGOu7dsOpvDQ4dtse2izBHonfNOj9W9JXILbXT0BJab75AgmdgvYqdhQ\npiS07Dh+c8OLlDvfbGrA1mM6A3om6N/vmHRfSC3H+ww5GkT3Y6C1fleRZOpW\n7YsdOvOlFyao7vgP3tK2u/UQIVTKnl92MvjuwWssjDrUFZR4ylBwoN6++UOZ\npIkC1PPgj9ByBH2i+Q6dEJZEmmObkjixjs58BZsYLBKNoJ6GfQwRMGsTSkAW\n0XpM\r\n=MiGB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJKKQ5AqhOKeuzeCWxszWRd7f/KUYX67kMrbV7ElesowIhANidR7qwcsy9IzBqiVz8v2NFRo7Aud3qyJnci92bwAqH"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181108145135_1541688966949_0.943737361002386"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181108152750":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181108152750","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"80d79049c1e4059cf270ca2cce0df8b7da5edd9f","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181108152750","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XqGgMSWaQPGxYKx1SgbSof9juSFZOz+n14zOpBecMPDDSLHDsLj25ALzcyMzeke+qhXsctB9TK5/KoRFhAkV2g==","shasum":"4bed109a1fc229a8763d91247f7a9a202949380b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181108152750.tgz","fileCount":590,"unpackedSize":4819168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5FcvCRA9TVsSAnZWagAAgpgQAIS0PyTNnw+MIHqnfVTi\nec3zQB74IgtrWXOORhtR4z12CCy/rv+xqXmj8Fe5p2H7wU1h6flq28/+wG75\nkIOOzNmvk3sGH8VAo8KhU22ziRRUxzcfazqT5JCVy6mLIEkSVdea3YPzr3jl\nX+DDftwix8IxEN2q9uwFauQuwb/w33h61RoPjzSlAMsyrAJHVIIYun1MOgA4\nGyyMDUtSiE3nFR4r51uQJqTPSJM/a0u6/kb5AUPjiiGMqTzv9J63JeOyQqpK\n4XXWdUijYL/enav/v9gaHy9GI6njxWUhe7oipqW9utOQ09cy1YCzF/smaH4c\nz62xzLTdzneX+KQ3P4xn9IWjwiP9BeRwXc9Xroty2oEPbl+w2GxTI0ttbeaT\nCABGvbJV4jRzkLN8/AKSKZSdu3BGvGLGfV6Q5JJFniaSnVNaU0NEcvKN4BSj\ndIEgBfBG3AXw7xftPU2+gJQ4nyl42ag5FbWvZXTDxaexSzmPfuwyZi+1KP2M\nlL2S+RfhzxiFGiqhfWLji83CseFNZmUetCnFb3IDqBInpM3d4HvCRHZxBnlW\nAPCPKl6zHEGDSsWY3uFqQx51QrgkuvcIYVZBIBaeGj/jTnaO2mePw7BIjYH+\nlOA9uKTxPoKKKkn5vaFii7yVmKjhdtiAcYkCo6G41+IAaEfTzePSxHQTi+bk\n6dbh\r\n=0EZP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvF4EIeGaXoc52XLky48bxwgMxEnJ/bU0wypu8G6g+XAiEA6ZUygPIGj57kg0MCuIP46RjwP0AUI8ldk6dXkzU8oFc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181108152750_1541691182589_0.7334851970358902"},"_hasShrinkwrap":false},"1.0.0-master.20181108153752":{"name":"@atomist/automation-client","version":"1.0.0-master.20181108153752","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"27c2b0486cd232450e61e99a9a73e4d8671597e1","_id":"@atomist/automation-client@1.0.0-master.20181108153752","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OW201ltN2b8HsBW/EcDeQ3cvdSIVxciuFwn1oBSRXd63FADaMmsaqSdpYd/UE39C5HvPmusFJFCI4uoTS1ck8Q==","shasum":"03b236e8b65db2ab7f265fc0fc54b09562f265f1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181108153752.tgz","fileCount":575,"unpackedSize":4798151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5FluCRA9TVsSAnZWagAA0CAP+wTKT87RCa2ew3TYBkp9\nWPXMd0RnBUPfj5smI2Ka2xoAneWiacCsWz5SCTE2UVu2ScdTw8+VTwwhyzCu\njf7MBiz+hefBUIoHy793eD6a45+BIB2wEorJZA1QcEEGxoLhpS2eZ9r3pfK0\nmG0ZT/xzXDPcNpFE9LGlZqK1v7aXEUZROZbU+OYAIzyxNPm55H/jX2VgSRHE\nz9BQT91Wfl9HFTvdNCb/XAkhPdV+J1UpE2A+KwGscXXWCzo+1Sk3PlFNyJgu\neW4ZR6W3wg5WQQQTVDs/P8WpuQ7fU30tU+P+crDJEJoAwDSVKC2opmz+OAbs\n+AzTn1vEBwIDqBgwjIJX3ruqjGEdECcuCvXRyy8+XtcrkbWqwAWkAJNNRvip\n2sz6+JH1p2qJSerBv5T5QBdp8X4WxLuT+CttoKFGgXTfmAHX5QwHBad1Gy/a\nm9o9hmv1IJswKSzFrvqHZhDgQx53DwRMFitvT3kECRHaI+0gkUmHxm3hMdB1\n9jVruIg656kIzXL2oWzw44/mGZFum5GEofFUTpUUirnW88ughj5onKK1Eb2t\noP5FtnEI3tx4gbm4efdvmBp1lVsKOu5Mqv+uBcvfEMe3u4zkcG86V4SRrn74\niJffHB6W8gwDE7DB9gonEu6doolw4wRa07JDP8YrHSNs1A5SjEwODLtx+8pq\n5bqe\r\n=WYS6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD445Zr3InliQSNBQ50zIp6YOE0f6k7ZllPPW4r7TYCMQIhALtWqygBE+UAcTCoUW0mKC49cMjDfMlCCGORdcKQokcV"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181108153752_1541691757630_0.050111203918306924"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181108153403":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181108153403","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"87276736e56533ae235dd36fa7335906ca9ea91a","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181108153403","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5rHNe4aZFAf2wRXgliWAFF7B+MYWhsWonCcJP35QwZs9H80xP+jz/t1rdeSkX9ZO46ol8pyD20K+tMcWdIerlw==","shasum":"3093d1c3fff515bb36d3eba4da37548d91c5e6a0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181108153403.tgz","fileCount":590,"unpackedSize":4819328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5FyyCRA9TVsSAnZWagAADqMP/099Qs5J+GyN+RcUdv2x\nf7+qpde6sN/NdWVqZiwbyky0nXpULaLduqkJKLAl6vLFklsR60pGt+27a42X\nVSsLk7UeVgpyP2StiOc0aeLz/Es2S8AUU6DmBcpgCJXEtBbQTVt/Z5GC/RFX\npz12CHEjb09vep4FfM30bz+R5zbLEDMWk7vbhC/hbbS0fHUaWwy1YKAkcIrH\nX6FjhZGlmtsNMx3y2Aiw4df9VR+CabVUj0yWJzlSHXXxgqhWBIIIWsE85+eh\n4yZ4V3hwEdXYYpIVuSXBIf0kTzvOCrsw3j4k8YkYNbeZIC7K5mgdtJF+1ZxT\nR5jnuJkbnBZ1UMSXNiW7pw3GCjeQToOhCXCHpH8SmJfkWsFuqllC4k5FT045\nIWbGuOEgX0dfCoIAMEAhCR/Uxa9J0nFzfifu53juTEMMwF7uoUKDPpGCqpAo\n0fMRppP8KjfCaVSs8G72kFxL6wg+6ImaZcitGxbDTqu4oiXfBIrqd8W8bSh4\nx1ig6fPAfH0iqWiIyAFddaCv2HrATZgxzfnQISmBuh0jKIZ6inQrXeHXcy7z\nWglwcAAUtZGufVmE/lKS4c6eTKdnbDZffS0Dk2VEmcjSy94Ms6tfcvOBx7A3\nHhDtV7egPznPsPFizTrbcjR9Qp2O6EZeWgyjIJGwaencNxdg4byOhHBXg1OM\nx57W\r\n=6ZrE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO7Xxo7IZBBwRA+52XHIdhgLBqrd+bl8f8+RhvIVGUAwIgVBMWFp0wB+gXirtN6v9phTVPUg8hkUUqMWpZoQJSjFc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181108153403_1541692594073_0.6135030378830522"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181108165629":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181108165629","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"87276736e56533ae235dd36fa7335906ca9ea91a","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181108165629","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-v9mn569KtQKGEL5xol3swgYqDxzUxnSr6/wzIfz5TrwGwf63vfkVt0wdoABIv/OppfG6BkN6wMJS8cscTn1MvA==","shasum":"2b12c4e7fb6967d6ec54d092e7210b802bb46d61","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181108165629.tgz","fileCount":590,"unpackedSize":4819328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5GvHCRA9TVsSAnZWagAABxcP/1wuAxZlJyZuxIQYrOYk\nobbHntG/tkeAl6LkZsHT7SeUJyB+jBRsRIJHLhqDDA48JvPmNhJFKj+3Fw85\n2G0ZQe5jXMogEpCcNsn2rV+m8gwZ1oIe1Q0ECvc3bbGbinoLwD5c0WSVWC1h\nEW8h1WndKqPMQehakfVM6IEAoBmN1sPlC/88jFh9QiGZPtcm5HbZ0nggHiJ2\nWyjLxzlAxJ4JgzS+RJnqcpNhzmg8rJAR51amUBPKtPaooCk1YRzvXxeZ2XCj\n8Sy/ZOGd3AfkuTRdVbGseOuc0kmDkDC0V6GJOJmMd51p0UV4l86CdVoW0+Hb\nT3x2Wauwz6NJJhUHmGLey3nXKQnfYfGyQtonde1T/kQiQsIoaUNB0psbk+iL\nkBV2Kel0FVu+0ZGM1jHcsxqSx3orRSfbpLZOGp6pUSHleCLYy36895qyKe+h\nSAqhdBSD0J6VHT2Py9gNGLNIa5qvnS/AURL9a3P+z+Rzdx2+ZEza2/TtalyR\nuo7UeDVfCJMuS/cD1TOEGILmakzFm302+cM7UcolAQRizX8WeN3wBCmKVjF2\n/OjjqOEgv/shAA+P+X7r7rYx7Ed/hBMv97qZrOypjA5kY8zB/JK9bfmigFuu\nwA/o/EiCwYiovQ8uoadIJ60KFDeZqilX3+RZ6MXa8/nJXMyCbJoE8J24m6mI\nDoNa\r\n=ppH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/4UCLlW2wIzd3MVIXnEYITo9pdjXLue3JmHjtMfB/BAIgLauCelhMqZt/aT4suW2SvWCB9sYo8xIRJDCSZ4kue5g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181108165629_1541696454668_0.038891581676556264"},"_hasShrinkwrap":false},"1.0.0-master.20181109092215":{"name":"@atomist/automation-client","version":"1.0.0-master.20181109092215","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a1ea60faf714f41fd67c317f52c43931900ae12c","_id":"@atomist/automation-client@1.0.0-master.20181109092215","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TKt2/oMJ+jpfccqOfdfRXcjlu4uWHSy6+5/qy2x+0Eyg4b4dx2/33/WO3TI+obyyyq9qaWJRluIek48hTeN8Lw==","shasum":"096585dc15d2bb14a4c605fd283fcfc80565db15","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181109092215.tgz","fileCount":575,"unpackedSize":4793565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VKdCRA9TVsSAnZWagAAFYcP/3WJ/3SGPyX56Ipf/hcS\nL5mcjJgLTHbgjjUUWtRND8V7DGBL7FiXJP5azT0TAUIQGNw21QO89WK3Kg0A\npKNxnVT9B8+0LQQ1RWMEH8V3zQHPNQwSPdM5fln7uYwLfO560JVKlK+9IU3A\neW7RMN3AKP+zYcF+uSyeOWu4NgsKikci0rHpgWzKz0tfTmGziS1LQIMgOhEi\nGxjBu0h52wmsqsSTpVMNFffy+yLeIQJ4HVK6Tc/exNtIO9DMAs2jip5HGOSt\nOu2ULRBpTRNEiO9NA2liNo8xlsquwjXAuq20J5IN85nvHYvympA5wA2h/b/m\new7+iV4DobORu1JKuCkx43ksgl9aU/AwA7jdZnvO1GRplLPj59pTJnMurhJk\nUYKGOfiMkWThtB6mJstKm062g43TfwjyJyB/jgvRugYdZgxTN9jSckIxrAjg\nkcQttjrOlOJlsuJVejZ1vagIbe4rNLophU9tREbeN8PkwZuKdR/IZoZbiOr4\n6HBXTrkOIWW+IvplFT+6ZBMlMhKTZHKxTqLgqO787+avib7aMTcv2YpH3TaW\nSD+V/SF+CTcHdZLPv2nLtojqkFUQFAtBZu9q0Ix3rappLtPYh8Nt6E7m4YhO\ncbOI3d7TkIBcEzn2/czc62D9A0YXiY/HS67LYcLs+tWPbS+S6HsEn8JuV5Lh\nPTbX\r\n=GubI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQc8AgHSN4/4tDCfZkHId3gOJSd1Fg0C9we0l106pcLwIhANxzJdoedbM+t3QvoUHR5yA8An8bfr0iDzFbYa1iQs4b"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181109092215_1541755548341_0.5392641688173048"},"_hasShrinkwrap":false},"1.0.0-master.20181109092947":{"name":"@atomist/automation-client","version":"1.0.0-master.20181109092947","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"48812015d53d96d68ef0bce89ad6a8d424b085d1","_id":"@atomist/automation-client@1.0.0-master.20181109092947","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-IaB25FpcDdyu8tTYRRArE6Ga3suqURW6hUaatHx7/NjPitKdxaUUJCa0sbW5qLuL33eSvJ36nJmeaCSgooHXBQ==","shasum":"49b916b4001d3eca44390176030c28e2c822553f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-master.20181109092947.tgz","fileCount":575,"unpackedSize":4798151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VRnCRA9TVsSAnZWagAAVAoP/jk3SPYEH5AnCozpN7UN\nm6/fq26YjVbD1nu0UOHxoDwdaWCWKod4+pR2MzagrOAVFzXClHOtFfz9a/AU\nRS5spPBtSVVTOqZAi9PIYjXu/ttmA1aL0nuO1R5jNjSZOYJ5Mw35q3DA2zPY\nItWS0bw02m3/6oSufNrnydHl970WZbEskUv+7H8w8ZvZFgdlobMory8XrS7b\n0mWkNO/WxgVO3jNELqS40sm24D8q/K10e16wvQt21WIF7Eyo4EEfz6eGfh5R\nNbBZ1NJuWDreY0TANCpWc5eP5m7uN+hCp5Cn6hp0xLbWJL5eDe+Lf/rySJoL\nveORoYKslP9OyDZ5jN1mtnK40OgFXxcJJ7QVTVgvXbBvFRjkjbMcypD3W8e+\nc0xXfrMCWLFSiHwZ8XFg2eYjzg8sW/g9PjPq8ZliPwad6iBMplVQVps/Qd3f\nzte3zzDKzhz/FYlNPYYMZJH3EB9QI1WmRBEv3KWiFthXhfXOVJu1dj3naYKJ\njzpk44zkj0QlSYbLqbmGux5OIxid1cWFXB5WYtkJmuckYjioumPI3VWJo8eh\n0PqezhlK+CHMqngibhbClgPpJ2mPGfFvqgR7CqPk3fjoy4ShsK/HoxOnMoPo\ng8ejJPacj1ENz1vxL0mGLcU9fJmLhDSXpkPfrFb2Y6/A/WOtp+YT4jEku9Gv\nRxsj\r\n=KafY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz6SDFX1BdRsb7ktuhl6coiG+YwKn7pOwaR9uGLFeatQIhAJWg/DD/wiH1gTtNdATKhAzF6PNlUIYi3OChf1ftTS0w"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-master.20181109092947_1541756006101_0.5192436724254201"},"_hasShrinkwrap":false},"1.0.1-master.20181109095334":{"name":"@atomist/automation-client","version":"1.0.1-master.20181109095334","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d609ef394a8bcede5f60abae4960697221d84412","_id":"@atomist/automation-client@1.0.1-master.20181109095334","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Ho+/MTdNhZtfPtFIZIZEf9ljgex2RCzsgGPAN8lGzj4kqD3Yj4u9LmDIMp7qZJvIs2kxTsCp1/TjCUAwl69Ing==","shasum":"109b4906a9a63552f1d980bfe41d64ef6b0b1e1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.1-master.20181109095334.tgz","fileCount":575,"unpackedSize":4798273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VqKCRA9TVsSAnZWagAArCMP/0UZ+MSXC1lZP6YyAaVV\nOLDwJLQCqYePI6QUoDTSRnmAwKsIKngvSpYZYEASCBkXPAPrftMdqEF8AUS8\nVYoy/nlzVQHjObqHlrOQwzVOBTwrV/z5dgqWeYML/pPy9YD258JNFxbo8hWw\nbIQN6HceNFYQDpaewWN5pX4ZAl1I4IrhfK4WgQXc204cu+djXMxpNMjnJnWM\nDXZhca3LG4+1ITh5nWQeC5ew4BMG8KxUpiKOnwQ2rRge+jKP4XaeSAdi7CKl\nbSnAgjPOiI2Na2eiYd3XibhjAzeQyEeujbExMyi5cNelVJn7+5vgN0PY84Bu\n4PRXSxPpgM4pYZnoZxleaynvd6QyGryauaiCdwEGlHBSdQFlLDD0amuFuF8I\nlYgHYYgAFONVMszWsRSTX9fOhv+Vl6X4I0WlCgt3fwWwPAF2dkTAAA0eS8Ra\n1eANxqyX9JeAgascRv16Sk60uoM/+Q7Q2cpjecIyezm69BkqJE+RUaCfoCU5\ntWNSxhoJAERvBrYqMSl/i8h26wd9qtLDkkG4wyrv6f7RNTVRmKm0Jws8WhnZ\npSt1dsqP6BN1QG7ZScS89rSiDt5prZW8JmUAa/PRRfNboyP9TrfkVC+F7DWA\nlEBdz6xnSiKsjq8J1P+C/WhSbfU+GR1XoSMAasdnrUgC4wGva/FfYMd+vR1t\nMkQv\r\n=whTU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICv3J2aaFbIbRKao6dWLtxuS/3kHo2lp+otk83XpGC2cAiEA/W0gt5vOAImqzZRjbf8kHrlgog2WEdtU3xdspZ1HZFE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.1-master.20181109095334_1541757577663_0.07800834652164323"},"_hasShrinkwrap":false},"1.0.1":{"name":"@atomist/automation-client","version":"1.0.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"2c3e820713bc8ee15a799322e4a394898211627e","_id":"@atomist/automation-client@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EYhvULtbS3GfjKxTEUWRkGjzC7P44avGQ61KO+jnW99/+Mz3vNM4eFnvym7Qdw89gl62CSLowbgsYg442wonMA==","shasum":"7fded500fff1659c658c5da64533c89b6efd3c65","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.1.tgz","fileCount":575,"unpackedSize":4798251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VxOCRA9TVsSAnZWagAA1DgP/ifwCOX2alF+zgEQdGp+\ng+AL65QAUXPhGoSOfdyiNENR18prSILxVIN5oSm0Yvvm4xkBB5mzhMiEHMR8\nPwyXvV2/Itu3iLDdVjkIab2Mi0itETo1fHmniXXD0wj2AM0YwCH8WAdIGPvJ\nHNUhZdFHYFXZJCurALNJu5Sf6jAWuopNoK1VTwRacO96RxgmrVinW/w9x8Kt\n4BDj5xBnlRkawoAaLMMs3aZC9wljmnnvO5gErgcRF6ms3MdQG62ObLdQLvfj\ntOgXRkCXAP+T+lztPHJSQfE5Sjnxn0QN/XNmo86Pv+7hjWA/1aD4iuheYYni\nOpVTR21qSOjyz27ZEZB9F48ASz2GpzU+/P/8vhstBslBwazeVW8f+3CMMqm4\nOsMM4PR+6Y/AAd727Rz5/yzs61rLzke1ssJ5xgmvELwKGwvf0ws/Y92S2wQq\nLHwBw56WMi76DrhudTkUO6bP6bscMhImSxhAjCYgD4giZsraEeEr2V0nWnAp\nzV9UpOd55NwQBg61khmrJZIkCTUNwDQdFw68OtAraE7wt93ZTYLwQtkPqk3e\ndChqg2joZxbA/k6orLV8ZNcVlAY1DXgpg5n1lZfKvNFxUJGdcmWXvHP/ghZL\nijL5jA+ZzAbRiFZsL34T/Fg9QZxV0GbnACwsOYj4mtmP/khMVZjM5CzubtUP\nkhJ7\r\n=g9KU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3cTqM+Y28jr8gO+gLHfL/f9lfJ/C0lqXsKAyIVLgoYQIgBaiANEn54IpdnWfl33S/+K8goTTEXPODbHzqyZIHPOM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.1_1541758029908_0.8146888671846169"},"_hasShrinkwrap":false},"1.0.2-master.20181110081120":{"name":"@atomist/automation-client","version":"1.0.2-master.20181110081120","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"84d1117c3d8304a9e0f99bb8701830b08f961c55","_id":"@atomist/automation-client@1.0.2-master.20181110081120","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FQQNvaEEJf8ZoI/F1nDuSsiClVWcWQ156MZ730z50zsstEIeEmaw5kjp8dquJwvKEKWoKByYYbyDI2oqv/HojQ==","shasum":"634a211a6e6cbe87b412d7cbfe5bf5c231399c42","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.2-master.20181110081120.tgz","fileCount":575,"unpackedSize":4799225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5pN+CRA9TVsSAnZWagAAGQEP/0UbRwljd6Tk3MRUS74E\nTla3BYBneuJEKjkT04XNMQVRkHcDyswHLi3wQjhJ4BoCVdNySBEjxHZj8QkF\n46C8Nz1ZLT/7bj9nc6cY4UlMERYFWPRKfPm1HXtUIlSFZtoRFB26A4XwX0sD\n36OckpgSFLknZNKkD3pI1xYG3PaeJywfNQREWNb8IAx9eP/s9+TfzacrQNz4\nAaq0Eq17KdoU2DgN1M5RtIJaz4o60cAf67i/EcrxHVM3eciy22mkYIgNi3VX\nm+ORO8zOTEA4Qu3PJbxwIcOkpWY0IFTwZcG/V6vb+ty/6mdgYKAxj8GTb0I+\n57HuJE879LTgl48gJIZ5LbtDlczvEbBvApRcrG6hVce4WaqFS/3sUlwdHbpS\n4eAyG8drodYeNSid1ZtfTgrdIfELSNbbZMNsfbnFmm0A5KKgjWU/lRmdpnRc\nYVwlwZa8HX0fRq3mIubCXc5QJvkXet7X5m0snOTjvA3IGcnGrlIR0evgfWob\nzlpCB96gGtMmZMjieA38SzGJQQ4veWuCyt3f/BiWJ5DYgfPHWVnj78GQORIT\nt3PGqovRlafWgvIaa1BDodJINnvTBhed8gZHVfpbCgIzRlMUeVUZnFvzijJL\nyBL+NBW1qeWQW+47Oy5mveZS/1xyqSqqICmZRxVtmm2ExhlxgcMJDNsXDDUb\njYMK\r\n=g3WJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXHbB6t2F9UT7wTuhItBEoZyIdsYCutnonn0qBsyKK2QIgTO5al2JbEsbo795Y8fJHAWgBglj40bOjB+3hiFzATvg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.2-master.20181110081120_1541837693947_0.7670988240003758"},"_hasShrinkwrap":false},"1.1.0-master.20181110132646":{"name":"@atomist/automation-client","version":"1.1.0-master.20181110132646","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bccc712300984f01e49529ad14904dbbfb2f4714","_id":"@atomist/automation-client@1.1.0-master.20181110132646","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-64tdc3HCc8jvIHj88qIVzS+HSPZLOSiOxHL/Zf6QOOe0e5Ca1E8SJDZHFGLfviQpLS3kF4bRhjH9UfNzxxbBmQ==","shasum":"2b3a8b3019860c81626fc8ae908740d6a8732171","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181110132646.tgz","fileCount":575,"unpackedSize":4799225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5t1oCRA9TVsSAnZWagAAJ8YP/2oH/EsUSg22ozX5uvtd\nrwC4v7bHV//UwWhj9DiLBjBeLeHXwxUQ8ge+UuxO9W/ngFoWJblmyROWQ6ef\nIXb8BoNqC39Cfogq+TVCZ5Uwa28n7NCV3OGBxBqZ1foUltxMleTAzaeWFZz2\nd9hPyCt5XWWjlfqTignda585S475UKI3cDpo9VhtFIfkkuDIYOiFMtN/BzEo\nGzCfZlNdE1LooT3FEy1CfLvf46hmh8/g1LS17E3it2sd9oMZkwdsWb+4UHab\nv+Sed0sb8Dco9FXOYD/BLoXVKprCgGosTzO0y+8Isl12oCTDyiBthBcfSoYi\n0KwQwRv6Bjt9chlDJZOLhCp/bG1XwhX7CGaQ0yIq66DbNf6Kf/Vp6rl8lFS3\nxy3BEa3ft3XRzoU3kKeUEvd+8Lg1ZgxCpg+T1Dk1EG5ItBvShPmqKhxtNsmW\nQ1iTVWFNljSuSTVf2qtsXRhReR7vV0/1lWpzcFsLU7DA+ac3E4WSgmvLepV2\ncsWx0RJYr8ckNUNyK69ud5ypPf6e3tiZIaFe/auA/F9XrKkDhLAixJq1+evU\naps7SlXfXV+8xJ7lb3HFn9/+ZyheATAvpGPixKDuf6YYzxv6GbxK/rRdAD31\nGkaLD5OQ1Qk5LmJhUI9lpzA6yi6zXMTmyXQfuar2P7/yTtzoOCbHp51MKwcb\nV3dL\r\n=3h2A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4UtBgvnQK6inA48Zd9OmsYYDhg7Wn4xE627c4ZrFLrAiBYPdT/4BEbSeFlxpbmIFmNuPG5QcmZmPQuEyFGG7MLrA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181110132646_1541856615926_0.7841768372349252"},"_hasShrinkwrap":false},"1.1.0-master.20181113125908":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113125908","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"peerDependencies":{"typescript":"^3.1.6"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0","typescript":"^3.1.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"308ba68d596de799d23252b34b58058ff04313c2","_id":"@atomist/automation-client@1.1.0-master.20181113125908","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3Y2P02Aq0ZFveR6OOlmgb8bzr/3752cV6cPDU1E7rlMnpMnbgVoidRXkIXgSwULz+E2YKPQmxrB/pHI23CglUQ==","shasum":"93f468f9774cdb8b2547c61d6bff8983e7434b59","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113125908.tgz","fileCount":575,"unpackedSize":4799281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6st/CRA9TVsSAnZWagAACvcQAJ9dz+L2r34Lc8R5RJMZ\nXDGc/ioS4FWeLpGHTJkKqmLBgIXHI8IsQ/ns0pQyUVnvbcXXfikb2oJNpjIm\n4r0udTJBgTaiBNPa18X8cPmN73WPX+1yBh7lN2SA8Xbnl+ysYx/qrbPY69SV\nX89QHV1rn6vSVoHePk3ZmvVcpBrt+bnMYmBS/nQK8vuqWYxEsuSP7rb0pd/m\n4lmen9ujBU+OoNwAqmoa9aN0WnozSFAy4k6Tyw3wXI1zvaByc2LcEpZ7eYzR\njERX4ZluBgl+Hl2pJ+RlyV334S8gUfDakYr7NDq38mCCyZCTQPMFuP8Vq36Q\nxJITZJtnyAJPqIHhUmjga0Ygq+NDXzNRT2VYbMN3AjoBceu/j/8RSAIQwbbZ\ncE5Oq3+d7QYCy7U/l4dw08MDxLx6HiBT71FfFxpbthCcNmZ0BJ8r5Kw8ugGB\ni+wZzoUsdDeGELZ4s8p0jCrh1MCEBklaNX1Sba55p4uQhN5nDUbDNnULkMJd\n46D1wMvHQS9vc+euLdsJxIiOqmpP2bTcmUdbXpfbEDH24rMKSDWqJ1taPjhJ\ntm3ld5kCUGdBDNFthBK21C9wWrDJeuilWttR/GpobwFbOZIUAQb8jl5Vy1im\nMiZnC6QNKWjI+88iIiON1bMZc2w9nt0WzJ/T7M6ROEDZ1B22jju3Q78QmBGJ\nvVC/\r\n=Fv78\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxH5EihdjxfngpPWN+hsuG8nMK7+QwAqU0PR5EUwdLtAIgfgnzfB8hvJCScuqtY5fLGwAB4b8H4bHCobEU2xTWJRU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113125908_1542114173963_0.6090908653332909"},"_hasShrinkwrap":false},"1.1.0-update-graphql-code-generator.20181113133345":{"name":"@atomist/automation-client","version":"1.1.0-update-graphql-code-generator.20181113133345","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"peerDependencies":{"graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","typescript":"^3.1.6"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0","typescript":"^3.1.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5c50e5ade73020ce471a2cdd952cc3cf36d466bb","_id":"@atomist/automation-client@1.1.0-update-graphql-code-generator.20181113133345","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-h8723UyZ8xpF2oDB3NVSuxYRRy27V/oanG60LDZ9kY8T/mk6wksrx+Oq4RZ6ggT2pM2vztgiFnTDaqRVyl/A6A==","shasum":"d6fe794110f13fc501461f2b792ac0032d9cec4b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-update-graphql-code-generator.20181113133345.tgz","fileCount":575,"unpackedSize":4799505,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6tO2CRA9TVsSAnZWagAAOv0P/0U4kXaBX6kLZMAwRRE1\npQh1qR+reo2RR+54hKZXTM719qZCmdj5wMlei1SEdutN6Fiure2TF2jGv0yC\nSi8fYiSpZbh50K5PjMH9GsvPfvvIHdvv8npjrIykjuE2QMp3jE0pGfty6Z8U\nFRU9797VmKmBh5b7GUkgVe/dbcv3FUrSNwbZlmZEecA7g9buIZs8lAN83XlV\nXGTlyCNEzJjzwbSvBnUg3NVU4Acr/yiqRxBK/QsxzSf0/Hf1qEwwClRqwBmq\nB33WKWlUVNXlixyuTSykepmp/k7FmZXDGp3CH71YU/ReM9hGkVGzdF+zlQKc\noYgiogpCNZQdIHEiGHJrFHjWueV0TpVW2dqXUK27cOdLIzcDsJVQZUzOa8B4\nl8fgNGCFhrbLedrN/2GbEJzvE5pl4iK5LC456ht1J8RejhgQZ/qUNi/Eb3YY\n+3ZAdVGOAanQFVzlzyLnhBBtjd6YrCpk5bAKYEPYafySXb2RujsMPag06lEU\n32UlB0fC2lYBnEvsUoPB4TXxjzRXHDBMvOqFAnUN2TsT51mNId9nt0zJJxKJ\nIfxJgz069txP478NW/93FwiXcRyvC+wZJaE+9VA2rXgjL3Zfo60cOLMU830G\n4flOTuEU+thX9iMS7BtbtV7avGMoYjshHI9r73X/LOYrjEDXcGqtU3dbyByR\nTO5+\r\n=hgdV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMm1571RthTQ4QomfLYdCndB/KW5uJNG39YVeHC1D2xgIgIoHryY5yWY8MEiP7vHKBgmohDeJQ70KHybwuAznnzcw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-update-graphql-code-generator.20181113133345_1542116278128_0.6647438696914616"},"_hasShrinkwrap":false},"1.1.0-update-graphql-code-generator.20181113135015":{"name":"@atomist/automation-client","version":"1.1.0-update-graphql-code-generator.20181113135015","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"peerDependencies":{"typescript":"^3.1.6"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0","typescript":"^3.1.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b8c68aa63d44e3824df50c4a2c9c02bc943e063e","_id":"@atomist/automation-client@1.1.0-update-graphql-code-generator.20181113135015","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fVgVkbB39s8cVdzf20X9EOuAxH0Ih5Ouem3lV7xnAggwFVqOqBMWBjps0Eo62p8f8KQ/1FWnjzsLxtX146HbtA==","shasum":"e36636dc8e551b41017a091588160464b708d9be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-update-graphql-code-generator.20181113135015.tgz","fileCount":575,"unpackedSize":4799410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6tdMCRA9TVsSAnZWagAAVZQQAJI2FSdAsa/DegEz90De\njz1fSp2WMVupXcbzuGqVsXECPqG2zQPNG6H+y5meBvHwGvcRINnOU8FCsSj1\nH5d37cmO3OD5GFXtoAMJajs5sJ6hqJ0bTCE5U8SGy8g9oXySUhaRAWAg8TG9\nhutmnm9PLSBGobN2LvQCGpLMD0p698BfPvQwcJpngwOfDzTmp19c6M5mxCYV\nA9Tf9fqAzI4isUtBJg1LywCJU+zxRbXAQ1dc/vAy7tDS9v+Zmr7UQ/TshXMJ\nh9vLnDM4Gyexj6ToR4kS/ZHS6Zmr8+lN8PllJyXcL2D15mVgBCCI6f9Lchem\nl022aJ+5awAHuqth8oyUY1I+Ip1AxtIxqLF4H44o5z3GwU9UL7JSR1maPEui\nUCb/xehopPFfq47oIzacXzAFUK65iOLqqk+Z4PBJOOTOxXo3+tec9dhBN8Nw\netionxbPuNtUCjLa0RS7xzWxDkIhZ+81/idJbUfzX4bH3paj+j64h0U6mKLk\nd0CyjFjp772hrERLZ/0+YoTbjiO5Ubpsw4YskZN2+qITmMUePsKKK0eCtRcA\nk8MP+M0hlz+pSRU3rqQ0pAnc0GnUnr8fF6LU4FMWDtQSyFUcLB7i2ITmr+EM\nlJfL4CuBfKGsMnJFnWHSuBUBzHC0yGT2QjAYm8ERB0B4lZAOivF7fvYQXd6O\nP/wi\r\n=zvcX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0KrfZNpmfC5wHuEnhThsJF5Oeqgt5L9KsEvoyKfojXgIgZDr//WGH1DyFqrLgRMQYxN6RBIFvfNiFJ/HYImxxBPk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-update-graphql-code-generator.20181113135015_1542117196287_0.005972512576018607"},"_hasShrinkwrap":false},"1.1.0-update-graphql-code-generator.20181113143249":{"name":"@atomist/automation-client","version":"1.1.0-update-graphql-code-generator.20181113143249","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d8f292effdc3c1ff0f1ab0519cc514aed1ec0c30","_id":"@atomist/automation-client@1.1.0-update-graphql-code-generator.20181113143249","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-O9kWh1MMo5PT+9uixgzOGng/kh2E6nIggBOuIPCVPif9gp7hNleFwjgXa6ylCStPXdJ5INgYFnmqRbGVhWamiw==","shasum":"dfed783ab8b4d8ac6f17cbe4037fff630a9940c6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-update-graphql-code-generator.20181113143249.tgz","fileCount":575,"unpackedSize":4799354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6uFLCRA9TVsSAnZWagAAJHYQAIWURew/OqfdKRv/dCx3\n0XK5QArRX/DOcncAjatkAPBYt82VyJVJT7wOky+7ghPh3tAQcWbKg63RBYaJ\n3PrW7Acpp8igGcJfShxRZVt4/Y9U/79pyI72eneaevqpLSWEZ3lyLSJnOIUn\njznGTzdQk+T2p3CmV+3MyNwfgQl4FsQDH3DkBsCBcp2Yz2DmyUcnZrYjOqSS\nleEb7ECa/9t00hNUNgRPVMWYB1TfaqSCIZNbqNZlImtKpUkWJ5YtGr3bK0dR\ntvBe9KhYT6V6z2+hVA22CwEwmHY4mt/feAjNyai+dz8jwFbz4w1JLdkVr2Ip\nO95LIiFeGqob0GH6a4F79ysUtTxpbwMXPmA3V5gEm2XDo7/F9XDrjAh5MLzl\n6xJKvqjGfrwq50jsp+lJYZMIKJbmG9GLXLqDdc/BsEuodg+3PfF5mphjT4TQ\npGjWAKEsKGY5oghLFhWDhfFpwGi0Ndo+sXP/FIs+a5UJGYsCWzXf5LwgjfPa\nscI+OGTbILRCm0yacnOAERtM45hjp2iuFwMYxNVtA3JyaY8wwX6ewMTc3jcb\nQD33E2EG+vLX8FWlPHn7B+cCyLHw/5jBjfIaqb7JiPSbp8WO05Ow9GMmOsfG\n52i9s1PvrfTdfaYcmZxGnN4a1fFKeMcXndgtvTHr4U2/dvjAM4396BwMprZ+\n/i8L\r\n=7k3w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHakVx8cnKjPN2+y7eGNZNa1BWSOrD/Vaw5j1QsQiUR0AiAktrIW/jSXiErz8s+sd2JLvUSlwPsxwHnl3xh51bmxcQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-update-graphql-code-generator.20181113143249_1542119754469_0.9162705590218292"},"_hasShrinkwrap":false},"1.1.0-master.20181113143813":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113143813","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fea147fd53bd325e25a25513e1192d6668eb1383","_id":"@atomist/automation-client@1.1.0-master.20181113143813","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-YOUPLYnyl5fFihap+mYiA6Z2NMnVaDeZlAl6GPFjxKdRLYR5wcofgP5FJLHtJ2Bd5ol7UdI4wU3yfZKviiNi8A==","shasum":"3ed51cc151fb3c1a8958240360cd56a9762841fc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113143813.tgz","fileCount":575,"unpackedSize":4829981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6uKaCRA9TVsSAnZWagAAOPkP/jt+5jDIt4weRPM2daXu\na0NsL3eGvRgdJHof35m/ddUS5Yq/UpbIcs6PjOVLsrBY2uT1hptxSYgxvWq3\nlGwDcqq80n/aimxOaNzeij7wCB9aCC/3BDfSDZnt1ooQaAqVXPZJXlQftzow\n3EHU4TH3nI4ZSDtmrX0CBrSUF4soCjCjF3hCR5Nho8EoCCMeQVpKBtFL39vT\nzwFjF3J6hg557jsmXKsrMEP04JnaFGja/pS5klC6Tqb40tNqyX1loDt7vzkA\nkmoR410LbkqfIGWxacEhMzVn4zb7adawwjnyBj5UcSBLhWMWO7B0PQ29uGoq\nBOkoqUmSJNeQ3s7w4jz6VObLne3ebCjURTfnrzmdLIlFBENiPuWinRT1KExX\nRCYqsI2YmJkzuiBnEjEJSi0RJehw24gP79g6aXC9cgoxPNg9wDid15krKhga\noygIDdOIn/vtVgv2McFrLWXgwQFigzP7T4hUCBgmo6qwqjsG+ynT+Tx6AiaC\nZ90LpFnjQN7IIQmEvdhikdur1uhJOUj5GH/vMyLtRGVqWGlKzKQnV2953pcC\n5x6s2r2VQ+d0Je/mup9vqcEQSFHFEtUyyS7PDP84OBkJSCSc5ud57QMP4PfZ\naeHtrjwcXii2lBCRSIR8NSYtf1FTmaa1uWWGKL0WXZhuJ1CMYLC/4RyHMcja\n8IV8\r\n=VNKK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1tbVJv7yMQ4pSktjkTFjoF0w2dwgwkdX8sS3bwbvdtAiEA/UODnBD/SnAnhg91u5SEf6Bd91hhRVg4S2S3eclkvaU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113143813_1542120089839_0.5854602076258599"},"_hasShrinkwrap":false},"1.1.0-master.20181113143943":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113143943","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fea147fd53bd325e25a25513e1192d6668eb1383","_id":"@atomist/automation-client@1.1.0-master.20181113143943","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XX5nKKHE3zw+My3sB7RPWbYQmPzM437SxQOw5DKRK7uI6D24Dda/NEIr5sDEHInvfxWogwXbpzFFeWb7e+BOQg==","shasum":"311fd780b22b2e8dd08eab749fd97cb387fe7580","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113143943.tgz","fileCount":575,"unpackedSize":4829981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6uLfCRA9TVsSAnZWagAARoIP/2lMXObDo24HlS84c1Cx\ncC3/+HAnYvqxbJCo8ruJx26CXXN/k60fjBwY1K6o/lgHAVpYRmJ5gaY/vypn\niEnIZf0oBetyVKw3HbKX+E61Tw876Wjah7l0h+uh9F9X0fxUh0wWvb9L/AHJ\nyHamRwlPo5sQ5/3AEqVZXBpG6W+ZMe73ikNU4qUDmD6e3RHdtIHeeX6HSEvk\n23BWJq/di1hvtA76MUVOyX+iiwbZ9tRGUGsaw8empq9yMANnb+TcuugucBjn\n9OhdSgP0TNMByhPAZGjSP+TTmqEiZLLtMlubOz0j6l5xzjtzaZ/QvLQqSg3G\nVBiTmgMZZvWGWngFZKkqjBvYFRlyjsS4uur35WImZHCeNQRxxK1IgqUh1feG\n0D22ESbDVbm/tRyw2ApsGDYKRwreLHD/tgorQ51RWUWZUftmi+1nLCBvvMD4\npOZahFvu+ivQkmx/3PbQXGn17KcW5aUWGttdbxgMPG+3xARuPaihruH9uQh1\nNEQEr5tewrs2CSAO4AvjaeOYvldqZhLPb93SzlhQ2QWIh6SHBCCCdr738dAx\nkZF1FiqBJjvQGYvXFkZo5JMnXT/oojYWsKjhT03B653R84hTb2YgWVmYUu11\n9D3rOYP9FR3T53sbbaftV3O3iXbBB34U4Q9/mms9R1g7LZ2acjtV+E9bMziP\ngNWO\r\n=6X9m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6BUpfvP7i2auzUVLwxh/u34hxqHdRjiWDFyUI4x+bYgIhAIitbsld6hbVJcBIEbsBNqotg6YZBqh+20Kx+XAZHnc0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113143943_1542120159220_0.4884063221395696"},"_hasShrinkwrap":false},"1.1.0-review-comment.20181113153255":{"name":"@atomist/automation-client","version":"1.1.0-review-comment.20181113153255","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f6350e1f0a0d43b30d2a3f142062df1ad26a5be7","_id":"@atomist/automation-client@1.1.0-review-comment.20181113153255","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Vl88kWHWo0aI2647XaRzqxObdiL8EpwSZ2mcFFOJ39oCWIrMGlh54w62hB/4Pv0Rbfae0Z5KRKauP398gV0P7g==","shasum":"d6fc1eb775a5751b78d1ac8f928252f88732eb79","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-review-comment.20181113153255.tgz","fileCount":575,"unpackedSize":4833294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6u9MCRA9TVsSAnZWagAAxfsP/1f8FrdSRZXNZi+itriF\ndGRBWk6USzWcUIUuNLhp+BVHFxg+cX4qhj1DaAW7Ke8HcDphF+7ibk7Tu2Kv\nARDJZxQZWYc25sSRLo5zOh04YKpx/dKKOjyBDbBXCAySRa+IhW0WLM46z6RK\nCAuNX7X2/Fd/HEreo6fjcyylHXqbC/PrPV/EU7TcTz0d8CuyUfEhHWVX8+WF\nML4yYAVVYmvRM0l7OZKESlg+D68TEciLxKu5Ze+Q3LcP1LPVKB7r0NtIY61y\npnCYE/7zMgt0tvXk+yZ1+GcYqKVvDccKNbYiTPg69wAFLVgHdcMzZ2ZE9m3P\nTibicB+8Qf9r3bhkn4cIg8Pwwsvy64Fw9nMshUOwSADBrew/RNehjdoaCCN4\nTRUIdBs/9J9RdfNcEe2MVabWeVSPhh0pfLaM69ngDiTTTDvMIAHqgwuaZQ7w\nAllAY34zvfB9Oi+cuQQWHiDcpoluzotrtLRPinwOoT7+urHc8PpXoDxA9nMw\nMSPclcC1L7jFEvnZ0j7ENV6pjNlsLQ6292VahWVr/l510Hve4LdalfOJMKxd\ncdg2mM10hTFQWYa9fuA1KgF0f2IKd4BBy7oxVnNBnxj4nkEJ9buJnSxAABkb\nc1BUvO4ijbwVllOZrF6FZPQ4X/Yd8P5IJgf3b1hr0AF3tT4ByccGjW1VpdDv\nZHWt\r\n=vNPC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBv3icqj/E6c5nZkUJecGQvWSfO1uro9poUE5/LN5CWgAiEAsYcNojIxziMlJLUSdQjQ4k8iJCBPrtS+WGzgOj4R4bk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-review-comment.20181113153255_1542123339422_0.919913443626007"},"_hasShrinkwrap":false},"1.1.0-master.20181113155909":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113155909","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"807060bd43bb037552cc9f69247be7a6fd75a07a","_id":"@atomist/automation-client@1.1.0-master.20181113155909","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LhUKBaD3PKDnM6f4jnG1PcQmawaIXp0WvkzeZQ82aNV0SSgcRxJ2IaW7+0z+gb2hiXZj9GMq6ZzXmA8kOGGVKw==","shasum":"a8a00ea0cb2d1386a4af068a1badf91154650881","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113155909.tgz","fileCount":575,"unpackedSize":4833393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6vV/CRA9TVsSAnZWagAAsT0P/ji+NSWH7Ng9lEMf1YUV\nJXBH505xzjzS/H9K8+EL0Bo5ObFMNFFIhSA6oRXjQdjY/PFwVuKn9MqsMwMV\n102rK3KypfTpNGJma+rKbnpU9+1bRapSKkMh8qWoCc0cUm8ngCTLLd8P9JAP\n97w9Hl7LyOnWbueRXkYOmiMKxUrV2vK4SkgBn1Z/1FLZ8dAh6SyESKiNlsQm\ncv0+pNmj8g7u2NoTdJp4s6BzjPU9Xg+401hzXwWIpjZC9g6yGHgfuc8YgHaY\nw5dW6vzkXowiAcRWYe/rG+uTIl1FZYVF2GIXmAs3FXtu+gaH80foctka6a7+\nC+hn/G5Bj1qRQ60UJS6jdrP2Q9RStXjdicR2fbexcT9nBQeO5TclTXdH37fO\nPvABzjAhRG0ExBvaRg6Swmq1LK/IyZkY4QPKb+r1O1mQxbHASMTIi/1MUcxp\nn/8ag5RGt3njBbZI+imEZ9bVkF5y7puiE7Q21n8zcTaSSjQeCbCB8b+Qy0tK\nKPOlHyWQLD5dXQAjcBr+6zEJT+e+OCF3aK++NS9Xs757uc/T3DAyonYTRjnS\nwg+94W31DMOK0FVRQUEjNafgtZOQr9g/o7g6ZadyO763lCbO08rhjii92BTD\n5nydlAShu6z2wKDz6iBk4ud6NkvDd0soVXoboecH/aak8yYDcEhnwmnrugLW\n1dWI\r\n=57XL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWJrAzwtyJwVir5ZYCsZrZEtONXyDC4WLYwRYmT2uJPAiA+QfFaOHxZn1Lr1dDOddgMzf3BWCtNcwC5oDZykZhJTw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113155909_1542124926643_0.39747016291931647"},"_hasShrinkwrap":false},"1.1.0-master.20181113181046":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113181046","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d899dd0004d8142f15adcc6c91552662ebb501ff","_id":"@atomist/automation-client@1.1.0-master.20181113181046","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-G5q3mfsSbVHWvet77Cjc+a0zrECrcS/U0juTAGnW2ZN1qwviLB6sX4z8Ow+pVCMLkKSg0jrLKbbb5NeP63UI5g==","shasum":"dd2afcc58e4b8e7566c63269b7de647ea6811ee0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113181046.tgz","fileCount":575,"unpackedSize":4833415,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6xRJCRA9TVsSAnZWagAAHLkQAIYec+HB7RbmqQbJWwz5\nKayPqHZ8Jckdm27OE1A/zQy4R5VDeVNlx8ePb53ub5nW+MwEEGjiNkhAMQ2V\nCIPOJpyznSOBBf914AdASnKhPkmBg12J7SECB6aBjrKQB5xJqsWHAjz8hUaa\nzo3h089hBFmcQH5Lp37wueFWVWYQpVCqtvMzBVpvZVV/VLtKrar6ZUquAzrR\ndiI1jE93s7xqknVqLYILD5bVPshos+u693ELyaQmriEP2hrBzMq6DwxGc5z/\n81AKzjvuGt8+cyxDHJsccrrjd34TGs9u41nZpsP/kr487YCL3/bUVH+dakKY\nUkPiHlsNSdreqDo7kBUOHqWJyKb95suRdDCLkbfS8u9IyWv/YmKH2Wm39uF/\n8jkcAg32BloyUGp12Q2KRNiOGkURi+3GzPoORPGQzeBSwFdPk2+ZAmIdrKWr\n+w6GZD65253jMBF4GawK/jlHWjg+K7As2sAnG0CCqgCiXIGxfGJxocDtnvj0\nnqZ8TL8frfHKkOSae6nWLReIaOGo2VcTYeAGQRezrq58bO0Q/4NyA1gnDeb2\n1dnbrYCKoV0faktwHcP/9evOCZFP4n72gyNyAqBfr+NyGK5ch0ybu/fIrIGb\nksCxJ5FfX/oad59H4eieWuvSJgW+SNYdiczBpjFKzhmWDYTPJgEj1oxJxWaX\nl0bQ\r\n=cfKw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHIF8ef3O8rzWmOH5XgC8c7/BjWAYycXeB0UVbbR2lyAIgDAlVxjLcmKuOCJzcIidARFyDQVflnGwXSv6RscQ8e5k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113181046_1542132808547_0.6081034509404342"},"_hasShrinkwrap":false},"1.1.0-master.20181113184417":{"name":"@atomist/automation-client","version":"1.1.0-master.20181113184417","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8ada79df1c4021b577bf8c8f1b53961100aca7f4","_id":"@atomist/automation-client@1.1.0-master.20181113184417","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-X90l4CJMa4nbxdFwYP1SE81YUSHCs4mnEuZ24ns58zUMYUyaFYNX50Kbc/YT9cgCCuRCSEWU4mjCiF3OuB3PuQ==","shasum":"d29f18ca2a92733ecc3a447d00d27c973fd7eeeb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181113184417.tgz","fileCount":575,"unpackedSize":4833459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6yMlCRA9TVsSAnZWagAA/K4P/2G1fqdiiMO2DcjtFS9/\ng8n+15rxi6amYr/wg48/XBIxsKEm0EMrudhXag9mP8Fkxy2sm5HOCwlDaL7R\nrp1MRQAEDRXNumTgY6PjvyUVvmHtVz7WwEsOn468EsqA5Zb/EWznmeOJut3v\nED4QA/SRanAYyDRKuah/ojBmP2ufsU3KWhw9H9Jm1bWvP8f20MsTyNBf8cdv\nvhzxc6LZ02ymRoeyjqY4X4ZBSfqTS95tLqsq9t6GERpPHXGckm4eDxfTVEUS\naGnEteLrZdDUkIfx8tEvtzBUaLBU4qbPbVhM9ZwwzggTfSmxg6lwABG7TXpW\n/MHQE16NjYU4hHo4nd9PmkbxQWoC7Yt2oCmHFMSJR1ZddIux8gY4zbQzctGr\nAYDAh9yN0d08oMawPtAWBZ42YkyJYq92RUuR7KApOTGG3JGU7eBKG7dDJQq0\nCyVLetxeX+hFzglicvtjRhOXGHbGKzSD3TOzinxzbxqZ9gQtKDBxUjxNTfZ6\nJB724UmqchD9W52mWkq7NKggBpDbOtftC+0Q/7SBO7ZK0XSgvUArGtyd3Z+4\nOAdj4ipg3TA2WMp8hlmypBqDsykAqDW23LzyQ8hYw3qwOAaeG/K1Kw9T5qRX\n7c49BcTaWX2zZ2nuXPWf6VudHYYy+xIarOtAl2Iig1JZIvcRroamHbhKSmwh\nzFTQ\r\n=EM2T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtBnRS0gECPy5HaljIL/KXfVuy+Ze+zbMPsQWzpzbliwIhANdNnKc1vNoSz4p3BAoAHwOuXusDmmAYnWChWnIUmY8q"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181113184417_1542136613158_0.31521584010492365"},"_hasShrinkwrap":false},"1.1.0-master.20181114141144":{"name":"@atomist/automation-client","version":"1.1.0-master.20181114141144","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"572fe2474f2c67f4f94e4f3fd178de76c125a7cd","_id":"@atomist/automation-client@1.1.0-master.20181114141144","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Hw8XZraTBulKTBAGKAjM661uvG7DYyIWBJa/kDiUpwRzxy7n1N4FqrLltRsesEaUOvLhuAVixWMh6WUxAU4xOw==","shasum":"d4258ca6c77c7ac6ed23f87d5d8316dfaaa27cf9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181114141144.tgz","fileCount":575,"unpackedSize":4833404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7C3SCRA9TVsSAnZWagAAtrYP/2fNTmT2UeIjZLfH/ms3\nbZS7IJJdxOzKcknYV7ehsqaSpUVqcSH1M9r+vT/WMEE7kzyesofuz3AcahOD\nieZGM7CtKpFuE8Krp9GEnkWWouV7aanPamEDwM9WtOzsMVHHKBgk94enaD21\ns0n/vhvB7BI3nXulMtgbzTqgENsxs9njwgpXf1nqdu+wDE+Vr1AveDCgLkx1\nHB95UiAYr3pBrpvsgjiTyhI7Vd+L9psjxRR9ugPC7ZHJXGTLynC8T57+3BRz\nGHbD1eaOcEphxp6K9U//NT6xDgBtubt7f7XV5cN7i4o0M9h0iAeTDMKH2SfV\n0DZph3r52cATG8b/qUDKy5FNDLEnwiT33eRkf+AKDrqa/BOoKRm4zLRsR9bY\nhHzRX6qjOFAmaK6ckjzLg6vOZBTzMQ7EHIVdMXZlffRzO12J3+yCX8ihFD3I\nlWAiGElkuqXIuxrnhIwoBnb5xjSIKMpJ/GOwRDnjI2QvDOD1W8ckhRJKiwBk\nP7/IBZChb1haNqNSHaKIQ1J3xD1B++NdF1uZuAg3nUk5ap2RBbdcAvccngPv\nuAbAghNpRIOL6mGtxOmTPe0yjPlhndHSOhCbv+J7pxDaTZVajpPgao3BBhxq\nsrYLKbamxHmD6FBbciYz/Xr1lqVEOseW2eQMkzvSFIsVXP1IhHQAjGQ/x8H8\nTFt/\r\n=fDNM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTsXkNrm3DbxLK3OKcPa9FrTbiDKWdQEhpAQzKB7jgWAiEAsz1+TPNtNo8d/KgSOwAoIWoz6URV67Nw1zfTp5L/l9c="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181114141144_1542204881849_0.7302812162928212"},"_hasShrinkwrap":false},"1.1.0-master.20181115072619":{"name":"@atomist/automation-client","version":"1.1.0-master.20181115072619","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f008f35a5fc85832a41de3f638fa08b46ec541e5","_id":"@atomist/automation-client@1.1.0-master.20181115072619","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gT3sOuMgsAZSRl3VnGF93VVvK/n1qU7aoINeSTBZmIpe3G598Rze0ctkqJdej526vLVOuwHSQwEvd/tgPTTHmQ==","shasum":"a5b41da6a563bb1b055c1e909a8eaea27afb16da","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181115072619.tgz","fileCount":575,"unpackedSize":4834569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7SA+CRA9TVsSAnZWagAAcYUP/0lc9Q+qmsZWe7r1w43G\nNYtzjC5QelZ9pozqkP4zjfQjy4Aur6O14IACE56L45fiNbUmiUQ3oCNrS1Gc\nIp4TbI896GUzdhrEKSFBTgWUtg9uYIu7ZwtGkf82ie2JpgX7qKH/t7KlafBw\nfuxPVJNxEWfpEfNso+xjMQfIz8c1CPFQ/uehqZcFneAIDpGbHXlhagilHwEd\n+e65ns9YrYlSraA0eQFC3m8ZxTNDFXFw9nTKME+4TEwGcRBYiR84eP0l7RYI\n3xA83ZTWD//jarx/XPRutrU+WH26BMevUSToy5hcbsudUYIoDCpkucmhZA3j\nUVrD5x2SrULh88lCCI1MndxySMo2ZrPnp3refX80oh1aZExFi3bw08iFXOZb\nUaXG7Zxx0UzmAAOYqgZJqmNUMDoQkHSDod6phFRh1gY8deSaW70Xjyg8hrw+\nr0DvtloyAIGSBDrYTwjy16YSQ9/MIsknYzHNRCdCZ1M3K243t5bwqjygEnBZ\nfVpY3MAi5XJtvIb9SKRlv9kXyekg/vWrgQbSXkmzlmu3FFHclcrdRS2xW54+\n4s0nykkcJ1zJryxr2Gmyci1M2mkLuyTURTNuChNpFGxn+k8S1/pY0NDTi2nA\ntZXJU/khdUqjfg5voli9GZIgFascTBG/ny7I3t6evA/537i62q1deuTR/AHg\nZQ28\r\n=4jp6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKavaPUklHFIF1aogMeRoY2fWF+gQFY50YB07Sk+hU5wIhAJnH1lwUurAPj1QjDAcEdi2eHxgW4ufmGqXf1P0pDomm"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181115072619_1542266941538_0.44005106120134374"},"_hasShrinkwrap":false},"1.1.0-master.20181115121154":{"name":"@atomist/automation-client","version":"1.1.0-master.20181115121154","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6983c504bae0da302b949cf786d06f0e72aca56e","_id":"@atomist/automation-client@1.1.0-master.20181115121154","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xtq6TfMEoSP3AufJN0F6a+Wsu6p+PVD+OtKUmXM3W2+FLGyngHVmBcv0CeViFkJ9iWibo2tZad1Iwu6VARyPjw==","shasum":"6aaf87ef6168111d3d2486cba163b2bc035690c6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181115121154.tgz","fileCount":575,"unpackedSize":4835521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7WNHCRA9TVsSAnZWagAACgAP/jOh9CLd7nyhXkRFPTMb\nx4XI6iWcMSg8zetOfaMHneSHuZ0nCAaI46vn4UOaapPQMfiOsSxt/5ksxezr\nkKHmHmmFmla7W30NDrUsuk5rMqxxNTgpGy/BBhEJY/mzDXEDVWSTilY/daXa\nJqwZftOucCBzCMb2AfJvV5EbpJbYiExUbH1MPUGO6SHXqtalyM8E3yE8Msk5\newYtnY1aHhy5TjjICkglvfWJauFcHkJimg+Cd4gzNpQGB7F+IQRkFtO0A79k\nrW9tFnwwt45JqcQeN5F301U4Zs+71kcQDL3b8zxIXGzZAaPp2iGxr3piLch3\nOD9cbqB7j4Tg+FjS5xiZy0fI3z74/Y1QbX18NBMLIWC2Au6XaMgM7ZsBd1il\ni6PRtZpvG1Sx53pBCSaPvcX6MeuQF1MMRQ0FRzBDZ6MtPnlAUtycEYCWUgIa\nTRkAUzZGUlFUtCISJD5kljdf3EnQ+SO3fd1jSyG1gn7Es33tnIdUodi0emFC\nPFx3LNZj08Cw4vBUCh/31VOprUT+TPe7DYe3/yhJYImDzPMw5PhAtCnRYwEA\nIIOfuLm2QzdgICJ4Rx7/nnhW0vNpsiciDw+aRIe9Nk1dOplKMvyYzYWCPSQv\nLq8W7Zkk1t48TDas0Lwm+THmJZoQmK99FeiFKX1h07I7cyaC2HSbK3+O6ZEh\nYPCS\r\n=Nhrf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjEBzSEmRTSEgTsDdV+pXQELwav+5y/FVuVuEXGjwibwIgB+oMXBAgWWlzMZ7jq4dFswSmtT5U7KEeAIPf262ACx0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181115121154_1542284102310_0.2783523579799072"},"_hasShrinkwrap":false},"1.1.0-master.20181115121400":{"name":"@atomist/automation-client","version":"1.1.0-master.20181115121400","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6983c504bae0da302b949cf786d06f0e72aca56e","_id":"@atomist/automation-client@1.1.0-master.20181115121400","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-m8HksTakK/3gqTUDDVInfOld9GarRDDaYYDx77BXaSBK+53x5WZdQrFJmuApvVmQyj6mLbOGLbUmi7znP7pD0A==","shasum":"199392ad6be50814b42c528b34cbe486f608f2c0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181115121400.tgz","fileCount":575,"unpackedSize":4835521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7WOmCRA9TVsSAnZWagAAYv8P/1vJ4ZzgPZ6CAJYeMBAz\nO6C8TrEX4AuImq/5R9p6gAgFsbi9mlbX1Y+Maij8hQ8EpfZOjvKjjr+gvBde\nIX58bO8pmtYILYZ3pRW94AuFyg8OqTnQYGp61eML0v1p1kh82wJ7PX/lNHIv\neo5XSqfdQ+xf/ywcQQ7EW8afZSLKw4AvrzXHUlEkmMVyz7vxN4Vya2thdcbf\n0xVtI2APmEN3Je4ODTGn2nqzAZf3Ct0RHRnKU5vbZ73QIsv9GYGukakbF7pD\nkAihKQvR9Ryj7iAi6ZzDLvmPzwd6gD4jBL85OqPqVGunPLOJiorY1hQX1Pl3\nwrSPo2GcmJO26YN9ykp65e71/Dm+E0qyyGFVTDp//ZGGbyVMNFBrUDOXXomj\n0R8LznGlp5/aNByEtv4cMg35dkHOFhQwhVk8/JwcsauSxl7OEf+E529l6tAK\nd0/uP2UdvZqIWUTudkuplzOK3XI8SbArLzDPi3HqTH2roUo1kfQLZwJOXoa1\nlrYn7HvybhTEf5y4V8ENGhwXYnglMSBrmZqac15UrcmwvAiUkVOFsPwjPZ7z\nO2Wz8QpZ1Lgi2+04B0ZDBW947z9nOmnzaMwxzou6s7P2GPpX879b9ysO8fyo\n5JUDIccevCWNkA8QrzNrRl8pbMiTDvC1QXqk9U25fvOt1fs0+OwCzgzeiB9W\nAwh+\r\n=mwLl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeclO+6CJH3N4AttWajHPrAEDArsuw2c32rdHC5fnBLAiEArXKY8iSaXPMtgqI89YROkishlRDRnnIhnx951RSJ09I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181115121400_1542284197370_0.7027992317645317"},"_hasShrinkwrap":false},"1.1.0-master.20181115131826":{"name":"@atomist/automation-client","version":"1.1.0-master.20181115131826","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"166c432e950532b120fb3a59eb4f3b9c83d857cc","_id":"@atomist/automation-client@1.1.0-master.20181115131826","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wPhhIEFS+JA++rc4JktmvlQoesD96EEK30bA9VxURdtzyuVZOXu8r4BalPEur/53YzmcXNsD7TEYD2D1lMNnLQ==","shasum":"fca68e0fbadc58ef6a4ab684190d0f673c0aa6ae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181115131826.tgz","fileCount":575,"unpackedSize":4835521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7XLOCRA9TVsSAnZWagAAXAAQAIyLLErfYPMkVAM3PT6g\nswQ+HU60sK9GpmXKXl1UsfjUBPRor6K66VTmRKSImGNXhJ3oqaE3wDisVMQM\nMcLF+xbr29fwOGfa/HQrE94sKxbS1qKDJbDEIpiKKV6ypN4rycu9susYVvu1\noOaIb8aEh+Mcx8ajglvWvXAw77UjFFjnMayc6ud54A0NGc4wV7NHxfYpDODN\nv0hIuqhP3zOXAY96E1wMolSUaHFZ///2zghNy6hSSE3HT4H2ZXzqH0GCbwH4\nh4T8vLjd4+KfGc/o18ZB97iPKyMudQpfLHoitPAGxSu0kPbfALrzeih0nuKJ\n2dJxf1Zgnq9bbRV2TwXm5DxRbOuUx8b2eP9zfHsVgyOUjdqiUcxaalnvT8KA\nPIldyPsPvXBa5JSGfpDUeiC7VCXXj0jyHz/5tQGlzMGbOf3OBJ4UCyY3wjyy\nuKdmnLaClpX6qpXrORnP5C/YhfDxJyWxH5XOz1e77CSd5iC2jFuosFahw3qR\nob1n6CgAz/lojklBw6ZdWEoLQ1O+9fZ+MA17xnBBKFuAbeMN1A/lus+hrtRt\nwouJvARLvf4IajJgxeIIaOJf8BbK47iv6gsS9ZelIlAw9kHSPEc08ioX9IkB\nLFmaL3b/Icd1fwsUfIYHGNkYeWHfNdkRkzZSRss0/ANce3sa8QmNdBgpP19K\nVJbz\r\n=sS53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU9SeSvUbXNDRENS4BRy3mSrFA/QcBOwNvtmG+TnwT2gIgRDkNSb7P5lZCZPoMQeYPYq6cpoixT7bhXFtJmf9NArQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181115131826_1542288076589_0.9050436354862403"},"_hasShrinkwrap":false},"1.1.0-master.20181116082132":{"name":"@atomist/automation-client","version":"1.1.0-master.20181116082132","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"11e2bc679452c6751cbea0f955a9ce358d8ec430","_id":"@atomist/automation-client@1.1.0-master.20181116082132","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UGjSCtlZro/1BKkDI08SBBP6d1A2zgp9mOtHatHRCYnUdZRuRS5mGhA5FzQkGySt5a9Glu7GDnQK7CzoOM8AUQ==","shasum":"fff78afcc006f52e62decf0437ac35986846e5a8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181116082132.tgz","fileCount":575,"unpackedSize":4835538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7n6mCRA9TVsSAnZWagAApPIP/jHMnuCgMIiUBEk88ldj\nXhuzgD4rD9bKjUI3bweiBZg+hpsgQ0JG8RPJx0z/3NlraWWM2gDwG7oe43Kt\nuzRonokXw6uCcfIgjTrGBX7Td34wBI4Wo93ss0YskG0e+C4isqdaayh+bHFw\nuFfs/equtuzJtpva9mQWP6YhgDCgxc+RiJDuB05A49quqEAkwFav/LtJnHRF\nxjHdl+9bMt5U+cKEDW067q2eeSAgP/6pz8I4ehhdiGVyPiOrX3mZRjM7XlyJ\nTQxouiBYkaAGf1If5GVEp2K3xGnzVzcM0IxEkuW4q1tJSRTyLNv9OgPxEjQf\nx3CGN4+GFdCOGW/hrXp6Ocnn+m4rOVGnl6lIzhnIWEza/jAsy0oSKfMRMQAq\nhrdXyyS3as+8GNUKdP2v+FhMxbJJULM88H1J58aBHVJiriw+cazcv6jqQUG5\nNITaiMWSjUGcuKuvpOSGUIizP73o64uD1N31G/3vq7ImB23thDfZ3OLnAdgH\ntZyuaNN1Dr3cftafrJoPyjTtxOQQlugSrMWPNI7bZ3LsdB8gNsUDtD3sbzdO\neqCZDU6zgk2n5E8QA5LNfYb3oC1JCw6L0aEbCk6RONiPpvRIUJok3StNd6A9\nhxATZV4BbFGsqoOKhl0tE/Q+5Q/S6/M+os8hTaPfRuSvbrHaPmbuVM+eYaSw\nyEwf\r\n=n4Y5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJPsbHVLA+GHKmnNEe2zhtKwIbR38Bt1erOSaFdWRk5AiBI30WbA8IDaL7SVn8o75NuZBg7BonQ8U8fKyzDB05S2Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181116082132_1542356645576_0.5290730426624464"},"_hasShrinkwrap":false},"1.0.0-gitlab-support.20181116141120":{"name":"@atomist/automation-client","version":"1.0.0-gitlab-support.20181116141120","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.0-M.4","@atomist/slack-messages":"1.0.0","@atomist/tree-path":"1.0.0-RC.2","@octokit/rest":"^15.13.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.38","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.117","@types/minimatch":"^3.0.3","@types/node":"^10.11.7","@types/passport":"^0.4.3","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo-cache-inmemory":"^1.3.5","apollo-client":"^2.4.2","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.4","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.0","git-url-parse":"^11.0.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^0.13.2","graphql-code-generator":"^0.8.13","graphql-tag":"^2.8.0","heavy":"^6.1.1","helmet":"^3.14.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.0","typescript":"^2.9.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","nyc":"^13.1.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.4.3","typedoc":"^0.11.1"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --format verbose --project . --exclude \"node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"","lint:fix":"npm run lint -- --fix","test":"nyc mocha --require espower-typescript/guess --require source-map-support/register \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"nyc":{"include":["lib/**/*.*"],"extension":[".ts"],"exclude":["lib/typings","**/*.d.ts"],"reporter":["html","text-summary"],"all":true},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e6a23e8a6f1975ea34ab4e182019bc55e283b554","_id":"@atomist/automation-client@1.0.0-gitlab-support.20181116141120","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-6XeRHN3w1Xzj1iMdKRpEDwn32WyGHI/mF+AQvRPJB5RWRxBoHmCOs2R9p+KSlOk5miDKKLONlBqMFDGVhkBDIg==","shasum":"05b2872d886db77e338c47099375812dd61ee51a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.0.0-gitlab-support.20181116141120.tgz","fileCount":590,"unpackedSize":4819982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7tDACRA9TVsSAnZWagAAhoYQAKRsusotIjZIXMlhwyj1\nCtLtzuGC/Li/mqnOy/KzaBC8xuZIGFxrBrpNU4Qigb3GyqQwtUTBQBhWZyDm\nFJPNf2+mKnd4XG8kj+hWxgW0oBummkH00zr+FGs9yWKEPLRo3lXzFzFpncQC\nGOm/OvS55GiSWvqPx8SddXtl/WnJnpZ0PCUJwOJwhKF7JCEsVT9U0FwB7qMh\nPdReeJCn8D0LNd3m+fUK1Hxxu0gJ6cAtsXKKRHvOVbRkEcnGJVXRF3cuEVBc\na+e7Nk8/MDOXah8IZpSl6DZj/NBNMzV0Gp1N/jAEIUqaq3nwVKjT69j+f9Yz\nPgA3rTLARA9dND5IgOga8qFCrtmZ+24g6qmurGZpN5WXzsD1sYuxNKzdYiq7\ngu0YXKIdX9togcgRA476kLlboo+S0hitGjB2Qcz2ToosCCe7fA6rRKbhF93d\nHZZU0Jl0ijUQI8r+whdN73JGv5gJ35MMbKILqJKc8XKPeHVCLiD2KZVeVVDV\nO+9hlpqVUOhjNmISuT/OWBHkK2/aYn5w5xQ++xfIWelD0wPldp/r6F1k4+1I\nv8H7RsZqFoiiLjmFUXLmFXJX3WUDOj731/1+Ua0cyHpAaq9LnzcLQHGIbshy\n3nSHRiOQ73V4oZQhByZfRxGCDH+V/edLF1sdXbZXqrNYFrWRRGxf1oDPfmP8\ni7Pc\r\n=FWF3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHaaQpXGhmQF9rEYluTSOqrJdRpczxocEpQ94sn8jEirAiBpP3UFpL84zNSVzL9VjKUvdYfAn+QbmCz83eMoGj1R4w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.0.0-gitlab-support.20181116141120_1542377663865_0.5407823391555648"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181117030236":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181117030236","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"296babbf0842e8557fe94aa4c6d02ea035004c3e","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181117030236","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0ASVTv2sWdIR3Kg+FhI4fyTclQMeSoXd1pH/9roMOR9bcJ6YREC2q/r/4suH2YymGXfRvTWdUpLS+ucrDLAPwg==","shasum":"c909fe22dc6fb44229c7d2a28dc4fbf18b2e60aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181117030236.tgz","fileCount":578,"unpackedSize":4857404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb74VkCRA9TVsSAnZWagAAP38P/AyptS1tnGc0+fj/6rby\np7DE7pgnBFyJa3PIIy1kcMJPq8zQmuqhT95gWExpWHxgcwJVVzzy6YQhFafo\nhjsja+Sd8rB0vxclj2ffC3UJarOlN3a1REDztDdnczdXdID+cpOJ6z2MMZrc\nHt3p7wyCuh12pCfbNyrr+no8RMpEuvT3PxAhnuS1s3553ItLKla1Zu+KnbQR\nkXJbMQzsG2DKg+kXUMJ8oJWkb7Jkjvy131WunBc+XJw8XMMGatEknz5qkfdm\ncYed7u0JBiA3ITxDsW2SQ2ZIgdZNZ9Mw0vuVqW8zVST7aYJ6wlPJdjtMgU47\nPB9YSZG+EWcrnC3P6g2noQuzmE0nNpT6Jyd7iuWIKv+lFpoH6EXY3+2R+cVs\n6x6PQ9wnuUCyZl9RarMpd/gO6qt/IfhN9uKrhFrvf0RyaU+gyeyT369f7PcM\nI9ClUkqm3j4sGYXs5RAfcNOVPhcOK5PV0KnaYoP4SD3L/K3Xw3IiJnCPP03G\n7yR/wIsSk5D9zOAmMdXrOiQNCIv57jruz73qCVfCJtbRYf/qedISqnSRzFqT\nF7A9f+xDL5f8wWao3F+w+wNAJY5WY19BC1KrtfXs/Kseb95m8y+5/IncEYWM\nxoDjNPC8T9Ma6UoPTuYXlLeRagvKe6gktX1TEKeY21pgvCvNHmj1QMYyNCGE\nAaLE\r\n=O9Ao\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuNdRSWa7s1Qh6YaGZJSrCpjMY8MdXA+4eHbARh6Z17AIhAPxlsIHoleelKsYin88SWlzS8Ap2D8JtTBcs/nRcLpV0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181117030236_1542423907441_0.8424379952393772"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181118025118":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181118025118","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"213a9f211c01992837405295ddc503ebcc95d835","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181118025118","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7FMi7bitAASLiVuSTELPZtDRnwv5PZJXyqlxXOosQHq8ovjij6+ZoigC9D9HoUk2tkw814sAvHJAY8x9SAuVyw==","shasum":"a5855993fa3d42cf0929eae0ad06f50c4d69d925","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181118025118.tgz","fileCount":578,"unpackedSize":4857521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8NRTCRA9TVsSAnZWagAARtoP/2HzUzj54EE9Dxv3Dh5Q\nK1DbZ50Zh1CVKWgBiKjP3JPb90CnXQhmjiSZV86PSc3kcUTQMG5s59UQLhVE\ndzcjCh2uSUJ8YH+tyTqpkKmg1HYWSYgCh4H/vMmRcQBYuhElFnkjYC4wwyYN\nim3WBvZPrGywEAdUJLC7DpeRPhaeqmg8xp2KAd46jkEM3L6oilHlnIdqHOeA\nBDSP4+rDyCkEIwn7JLefXQYUUeCkR5kRkOyZFzaoMbjlMP5LRopHfBt31E2E\nzpcmzLLwxCi8ScvH6JltxGUB9K9aqJoDb58nM1gqRGdorVF7eNniq1XZshAi\n82J9FhrajbblXuqvGnHgeMFYWcgK5dFboFriY85N14iJ5SHQJR6NRDW/UF+l\n+9cDQO3rXmwLsd/aRWeJ0FI36NHAFsEwbA/wEci7UcD9dp36fV0+Qf698e2D\nugX25SsgMtNyXq97ZyxeZIWBwEuclBy0mb0WUWagD6eqLhy4E5EwtYLWO2fy\naS0VX2Q4ZVVcwB2GgCMXbTTAULExlKO5h7KKO7bVdd/fUTvWYK4RL2EsdGOa\noIa4vl2W4+PTasXFMy9IB94cCKfEGJQob2beslq/Gwlg1Q5L6n3n4qJ1te7U\nbJrK9f5ag44kMV/yPFxk6dwHmcGaanpopwzPv3mWpCk6byA2z6lVfeGWOplX\nD8HC\r\n=KE59\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0qAV7ZzjMZeGfqv3iXey4YAPoV8lpN4v1n6WKhq/hZwIgDAHD+H1d8lU4Osnbl87Hv3qX0rWDTLL24Q55pZIKlpI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181118025118_1542509651187_0.259504092247681"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181119135048":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181119135048","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cac85d02599dad1c0ef24842c1ea15f2a889e549","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181119135048","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7Ywab1Gg1r8EHE6vPeubfN6kBotrND3pYqUilppMRcvTZx0O8DnFpDq4n8qJL7SghSupSlsB3oebxSX6Q7EVWA==","shasum":"a4055bbfcbf7b4ac3cb8477946b47ce72647f710","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181119135048.tgz","fileCount":578,"unpackedSize":4857729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8sBbCRA9TVsSAnZWagAAs4cP/2AJOY4CcmuUP/y4Puvl\nrue8iJDwHR2kfAlZXm8/NbjcBGHbn/NmKBOJrPkejtUddoOENW51c8XhhYl2\nNGd4qTEoFH0fOfY3Dv6bLM5Yo+e46XWU4IL05zD0nRnfvcHHQvb4ATwdhVtE\nL6/oruA5MwHURdEb74Vtg71vASjk+LiMka3bb5PEQWwfFkOQpKJ039jJ16g+\nYJ4qCoRIyVpV1zK4ZQA+c3HqnMvhvDrDva+Olzmc92H6/XWvq5N19tsNEklY\nEvg9DCs8ECWXAh5t7Do6s49Gl+fVaesUypplWXHngl//zvU2mrbcKiVJ6A//\ncJNQtyuJWlRqe81XuztqtwX3qv3S8F+i4bzAeHa2cVZ64hucpF4JPNLEzzdR\neHLv/m9igMzj4DpBzeXc3Z0l/JhGt9bs3AiLN2ggFU5WhLsIap2PkRJfE47e\nVKNxT9HVKGexdgYP8YrJywxLRrNisj3vkVk0cwRRCSCbn1c1OOmMassJDHSY\nBqYO/47cw2thATwEPBpluNOmKHu8WHBZqVOVuRg63oWS1y0luWbaeoRVP/BL\n8YCB6jTBie4ZOwUJuNBGayZb8ZjPVx4y/UFuVHmA07H/SNSoezCPoV1968NN\nBnWiMmJDOkBypLGaZN9U4XbGZ+7tBKpflQ7kGYdGKRvXJ/oQejuuma1FXI/o\n+2sN\r\n=izrq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFcqWAXX7TkKeOoiTaqboegT5Fj7O1sbbnPFmkfbOQJDAiBGR2X4ZDPPmN+cl/nYtENvCdAlVqOW/KQ3u3JkRL5gHA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181119135048_1542635610795_0.5674300810884092"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181119140326":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181119140326","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4740519ae1c70bbdd03a476241d302e35eb7284f","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181119140326","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TYX0XHtjeYrE1eJjRghlBKqUpt0r9dCabCG2vuuBUO3ejRu7cK61uOWVN8eDPVoMrq4m4tSi4Wy2QQCCZnYjQQ==","shasum":"66586880e8c5e2f1e565e795c8c42d5f8700bd61","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181119140326.tgz","fileCount":578,"unpackedSize":4857729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8sSKCRA9TVsSAnZWagAAnMoP/085JVfH16+YskLQI7UD\nNorQcCZgUgMLb+X2NcBaQY/lvWWaXaM6bCTTnUe29S2y0jl12TIZ5AVya2ui\n25IqfBu6+vhbLhbZNzHW1OFaYq4wov7P3lUCP7PIq8ZhCWV+US+lSF5VUyPb\nj/BxvBCQqL5aLD2YHSzZB5ge/jiAxjpDMWAwWibonenavoTpTSnxPsmj1KeX\nRhypnyDnHqSKtwl8B091kpY6mmjjM3WeozuXgqb/RjerxuzdmF5GtggRwz3s\nYkcpIJOLs/KuO5CXqwM5rPsBy5RtNFn3FmD+IvhwloQmhK+QxwQYHy2Qxk7A\noOa4xAIq/RmoxTtSreMumyU43p00p/MJAqN71//jwSbeZoPp6oxCBI7cAmGq\nn7hV4ryLbCywWmzcRV7St6h64oo01KoEzUQTIZRUAFFZG1im/WQYAUMcsf2T\nuL8vy1WqyV9ZWk13HIMtm25NzUss4yvSPFh34CFIlW/oNV/ZgCtQ77qo9tFJ\n3D1vGE2bB+L1P3TdSZizOE1uCIcbFSVl7+xqQKHpG2oZL4UD0uq0BMuUsgWJ\nEDVwXjscjUPu5arUivU0e5bUDTIaYpCjblzBZLQhA1ZzFB32RCMcwz9kPktq\ngUMVuCTv2BB5txNcNkoIvrmVsAQYPbMqkpHdX4RKPVGNLzf2zh8WoVt6mtMB\nWrjI\r\n=7BXG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwQZ6BxUF54H0AJLgXiO8iIzU0aw/82P6Q5x1fZmcCVAiEA+SKjgjyAq3OI6bj+MVY0qx3Av64fbcN149qgJCFHGRI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181119140326_1542636681740_0.20236458444126315"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181119155845":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181119155845","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9e09f420636ad4c857e62a17c694e7903b3fa6a1","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181119155845","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mS3QnWsWW3TrWBOmMwdIpu+5Ox5RMc+aom31yRtfwHLv33KdQOL5CRpikgv+ycThmZmQ3M6eHJloXTIIFxnsyg==","shasum":"b55fbf0acc55450ca6bba01f56e9cd5bed325dfa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181119155845.tgz","fileCount":578,"unpackedSize":4858187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8t5aCRA9TVsSAnZWagAACkgQAIbZfXAprZlhV/x5AF2M\ndZJGglbjm/smr56eMu5OgTf7idhK4xRueTHWZ9pl5KinaTUzw2q/Yqv9A0dw\nK6pL+WZhRbopH/mHshK6CN7fAtsc2jgEIT4DqzyCcHmeqDxruNPLgGxVeZ2L\nlIuoi9Z7X+NF1ydBJn7xb4hZlhQbxPjAuhOF1ob/vo1UZkGHMbqR9Zs3Dupk\nBc8vGRtsfJkQR0UQvnLhA4NGCsOsPUZp4Bu8HBECCcNAPyD87n1ax8YdLcnZ\nYKrXGduGBNAerG9Xm1EESHSy26mDi7lQrpoTioHlTlEELay4dCQ0vkD/Or5R\n7+Dlgjnpz4gvgRu5GxSE0BSiuuPcX/YIkGG2IDfiXDLoqORe1qszNRhbtsDO\nTyZpJdmhZzBnZnq5w9qEFQ6fhhc4p3UPrLI1x+OsYCsSz0+0Z6qefeDZI+YN\nY6PHMAaw8jQBVkgeUuHB/xKRNBgC8Ed8Aqr86qbqI2NsjwimYNUYlWGEEbU5\nXQagM4iEX+yjKmGo8jD2SSP0NtOzq4FO109CM01kJqdv00x32vuHb3a3cBZX\n3CfOovHZrT9QJ8TCpQA7L43dqNaXBmc+81Tpr/hWTwOUyrd6DuNG4DD70C0s\ne1Hb2hQQVl/UztTNDlPOAFYMApD7sCYTYUyCp2oIvnL9KGbh5/cb0HOeRQKW\ncQig\r\n=AGCz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDobzME5JrAa4ZYFCjshia5ynNWk3ltqk8jgGaVSr3IWwIgJtzItU1BEd3EO3zvETV91A/jjBmzLSDR6e9E1RM1LXc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181119155845_1542643289214_0.834999994581977"},"_hasShrinkwrap":false},"1.1.0-deprecate-spawn-exec.20181119182424":{"name":"@atomist/automation-client","version":"1.1.0-deprecate-spawn-exec.20181119182424","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2c9c8e1d133c840332cca1e669c242633a71ba09","_id":"@atomist/automation-client@1.1.0-deprecate-spawn-exec.20181119182424","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rPN59f/r0Wofr2etc7K+hIiTag32GFu9JSvfUHLXLXaxH/QQDb7iiYt/nqGJ+5XiHFAfB0LbcsxRKDjqMGfjiA==","shasum":"36c25959d0d11fe40d4b5a8c602e6b940473a814","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-deprecate-spawn-exec.20181119182424.tgz","fileCount":578,"unpackedSize":4860515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8wB/CRA9TVsSAnZWagAAqaoP/jWyAGhnEJ/6YJdOJmo6\npuYtLQvUnClzo7A3ULgnZFukWLHIjpHxdyJEU9xuLxg5jHC943i67Yg2fB1f\nZOLjNPesLNRwLUa9Sii0Bh84KXCOEmFNOLT8E0zZscuy3CGtIn4lXNH/PWYw\nDaCxVzixFgcElqe7M8Yq77ecMhISl9WQVDxz3OFGTu3dx+T7jKJle/QQIKIa\nKM1aieABKrGm7zeXy+y9xp59FArEe0oqa9LetPxcrYfPPOEC1D+pwWeRysxM\n01FyGEbNnjnuc4s/uwbxCU8SF/a4RKJ56eDwfZaUFgEd/J6uVj0f3Bd3slFF\ntAFzl5IvhsBLnmVFX6Co0ipvCmsl3RDY/YQnbKSP+BlNiC3Jxk0lsEMFFbb7\nhy5zf9pQGPje43uhRnA2hiU+v6YOp4kWeM6Iq7AdQ4QgfW6NZOFNwSJuKxKg\noFs03LOYC8ABI9U7lgD/F2snbMCPcxbI8ZRRJOFkfTXG0BD+Ng+69HGjAzai\nIbpH4HQVlZvPmcP37DgDAJCHKgxAwohT+/x+VY+M+0Em2aMv6/+B0vfaLvIs\n3frl3Etf4GIDD1kWgAplG9E7b7M6XCfuchYWF0iLJ2gPMxU+ggheGFv+t+2y\ntCRmVTeRJ7REfRXYCpOPRmXg/BxjH3QlUHZ/MBynAPqS4cTDHXoF7VNMyERd\nRy+D\r\n=3dl4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDmOhjhJuiXlKjxwjHfR5MYa1g89bda8Wy7nOlhVSSLrAiB9zCc3bO+jrsLp/2duV1MYp0+fvw1BQDycjY2ygkinFg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-deprecate-spawn-exec.20181119182424_1542652030889_0.923339845200772"},"_hasShrinkwrap":false},"1.1.0-master.20181119192146":{"name":"@atomist/automation-client","version":"1.1.0-master.20181119192146","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"795fa7184b643e8be1b318878defac465d60d023","_id":"@atomist/automation-client@1.1.0-master.20181119192146","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-FKKBHapuwvGsGB+S5S6SoF0/BENFOnq+EyvBBnNebDcnfRl4gNfj8Gwkwhc1e2KQMf/5DvNgrC+812h3G+dw+Q==","shasum":"6e0490158d07d0daa88032f3ffdfee55691322d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181119192146.tgz","fileCount":593,"unpackedSize":4887741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8w3sCRA9TVsSAnZWagAAgPgP/A8xiVObLopGkiA/lXGu\nBTjmZauE9cj9PlVeaM3t+HHBj6ZSNpVurAgR19nH4rU1bEwueUYMtMCjT7If\nz3X7IVqo6NzVF3KxmLhJRPHKNgkUK31kZKzydF1N9YB8uoH1+GtOCZYFsQOj\n6a0KLk/AFxmJxl8zLV3WBGP2ZaNoJEG/Ypp74KJnoFBk8zIAY+Ys48TcUdEV\n+Zc6yIxQBYlU5XK+5LktDzHKRb/SMvoKElQz8mERkf05kk71N4vI36fovM2d\nTSx6TUZ3l1OmU3wfMB58ViMBnPivlYKCh19DGm+pwZiP++HMeb99IfMjObCB\njz7TkL/RiN0YwpP7BFM8RX/38V0My5fO1Thi59lfKSs0Ftox30aQ/4Y2b9ix\nQR4O0LwySpj2O5J0WIO7oAZ0tNFs3BfUKkgeqIngFYu8TUvAYewCLy3m917j\ne8Ie/mmM2JJOBLDFLBzntj9VGybXD24DEmUJJm1tselxhptCjcgUcrrR1+PP\nAYKS2Jc/TWRXXMkHJyT+T2LbBEcI6Ezu7hhqW9t8DAI7GW6ZMzs9eiOrznYc\n7zW7k1wl4BPPyfZ58sBcE69xiOOip0NswUiKDKfo9E4bpZsfEvhwt73zfL+C\nZPSP7B/Z+USdONJD3fV2Gsv/rY2P2NOATpr+dmkwJkelrL5LHv20L8WDsG0v\nSqgc\r\n=iQ6T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ14hDoEbkE+TEuH8prftQqOtAdz+GdC2LlpUOJJjCZgIgEpAxah39q5pH0Yidv8DBUY4KKy7CftRmztRlmFdIfwk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181119192146_1542655467997_0.9914547936252789"},"_hasShrinkwrap":false},"1.1.0-master.20181119192354":{"name":"@atomist/automation-client","version":"1.1.0-master.20181119192354","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"485f03f62353a3ffae6cb79596ac0a041aefa981","_id":"@atomist/automation-client@1.1.0-master.20181119192354","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/+Zp8quJ+zPNuCDp7tTYtMpPOSExQrgfF1kB3XhSNqlhtE/IwpTdH7HNMSZLRVAi7IWUioDLH6aVInYaR2SwdQ==","shasum":"3eefa3bfe7936f3af483458ac0a526e8743164f2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181119192354.tgz","fileCount":593,"unpackedSize":4887891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8w6hCRA9TVsSAnZWagAADy4P/2NueAHb5KbMlFqom+AO\nVzC+e4iPfTZ708fbWQ33Cox0lo79NRJJZr18uX7pBJyrK5RNltoTK9Mq5a61\n3H1AmkGe+nt1Gwh3tBz4ZGHUIZET/jf9PU2OJsX//6HttJ433j9jMaxwV1fv\nWLL25mj+x5fyPoeQ8lFQr1rGgkY700eTIH8AqiexYG8eh3biKJzs2EjtOFd8\n/hn5OoXw0bBalD9G6vSCollEi0VDp+OyUX5W373pQdWM81oNnU1jUBRGM9cT\n2vtb+CbFKpyKkb7swIINm03CCkbUJewfljTuNWNSp+TGTPTfOkFS5ruE3wEN\nVRQIluaYtCHto+Asw9gZeTXOQ9G0Enpn00M0lhu9Qr79jmhTgg9e1Kgb2/Zo\nL9Xa/p9+APzuAz/EaJMrJBqre0I9hUuNcqybNA8K9ehtIvB+d5MKPtc9j5x7\nDJztKto7PEY5oSA8rgyYxuR6sJgXSEN44azhrANGmlFkiBtNfjpJIr0bdWiT\n4nNabay3OEmLdPRKiyAZfThnEUliW9K/bS8wKr77HIQdh0ieosyWk2Rth3/Q\n7xKcZ8HVhRoR1eYxhm+KvxVe6KVNbqA4tMxBf/TowT4CH6OLWCWxgyytTbYv\ndwXw89etbXy6QTK3bY8bvBocB6PwwCHej8FPrRSKiA7WEwZlmVeTIfT9hjol\ntO5C\r\n=JGdE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDh92JXXEEdRINAhe7e6yP1CLj3W23kW0jdJN6cGSXKqwIhANxGp3Phj6GRWy8fFd+taSqArVavAq35c/bzjIVm4Stx"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181119192354_1542655648502_0.9024583777650121"},"_hasShrinkwrap":false},"1.1.0-master.20181119192552":{"name":"@atomist/automation-client","version":"1.1.0-master.20181119192552","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"485f03f62353a3ffae6cb79596ac0a041aefa981","_id":"@atomist/automation-client@1.1.0-master.20181119192552","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fJALhiIVYGmmcj9+EoUB0rTbuO6h+G2mOFF5CPe2Imp6TkSYUI7zeTMLad2oCksKrfZ7VV+mecJdW6TFBBRd7A==","shasum":"79dfc4bd99022c9ef727632596b91554565488f2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181119192552.tgz","fileCount":593,"unpackedSize":4887891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8w79CRA9TVsSAnZWagAApNsP/0Wv7006KUPQo0PlT2jT\ncJp9EcfM9hiekPZSa+MO+DLO3fFY3tJnc61okeyKINywGl3d4i4uMK/xBsf8\nubsPDM7KzmOY0nTGzbqySuUuJvuSFVyIJeEQZK3o1lpdciUdg+pgBC2XH7kC\nGZg1AxeB9odMN6UutOEDID3R+7JMccQtILZl2JxZsvskdsh08Uk98cD21Ocy\np2ulLMtmx0YKzIkRyGAPrVjH4z0FL6ggIsuhqPSiKEl0YtVOHBmUxkdDClGv\nemBNAlWRe6T6Mk3ixEMKxlD/CGmdN7OvAqPu3NDBt+SBBwU/q5VkRWi56qlw\nxMr7cyFILvDbkU1ryEtP1xRxe4SioyGy+E5E6mpIdcg0i9ujd8useCErDn+8\nqvxpZuH4F5t5ZM4ZRRw6Ghp0XUXmREY9MNqe+2k6OjS4G8V8eiO+Tx7U8E2O\nvjWt9v3Z4kX5aUcX1J8vjlK7mfCaDGqlGyRmthvh4vhfb8hhBjHCHwsSQtke\nCfHXZZPGldjBJxO9ngBL9CyfkAvpNIxq0XtrgIxZWV54swk9/RRu8wLYZf7r\nfo62bwH5jpFjkeFhklA++wffE0S8En3IHxVs8rUh/yj0KdtJB3wjhJfnMaol\n1rE2SdyuCup2D/wQEGXTD/xkLGFF9ie3oBxySmC0BODPZImDyRX7BJwr0AS9\n8ogc\r\n=ExF/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGBkchU37V4YLVbH9EFf80kv+/7PGOf0HQr/K3YTPPv8AiADfoPvbTattPdKCHh0zv0kT1jvfxmKPvtpb8Xel+OIiw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181119192552_1542655741100_0.16193307390694067"},"_hasShrinkwrap":false},"1.1.0-master.20181119204931":{"name":"@atomist/automation-client","version":"1.1.0-master.20181119204931","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f980e77f7fac1f07756f502015f7b8228fda648a","_id":"@atomist/automation-client@1.1.0-master.20181119204931","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yQgLbCBxn4c257rykZlLa5GeoLJutESXsqAmw+eW6vsBGYR7LHkZwTiS6kKgXvURRltByelKEmBokYEiAHpGmQ==","shasum":"06400f3b8355898fce6078372380d91d01542690","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181119204931.tgz","fileCount":593,"unpackedSize":4887893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8yKBCRA9TVsSAnZWagAAZ8oP/iGPVCvE3ITXiAdveRa1\nHnZ3nVQu1sOpcNNPSczPW6TKDcWGZCZCSy3S9ZoO+Pbeb28KUiVWyv6HK61B\nRJt9v+o0nmu2vphie5SUha/mQDMleEJQ6kkiNawoNvl/HSEi/PTfucEYmyXd\nakWXnUzyOOK2l7HZj41PMhz9Z9lWQ0/nYWCYuiIs+CSw/44ZVUd9cF5sUbvs\noCtWewoHtg60dY8+pUESifRBrGijvCFvL54eybJHWUR25h/+1UjPO93lNW4q\n6fszAOnWY3D9Wweu3d2jAgMbhvdt7hk51z31ACKkwR8izrnutKmne0NoogHL\n2+5plh1SnKm3x2+jIXQfJSWOPvEmttJV+1C23pdwNt3I4z522WXCjDPFbTDa\nlomNg4zgDrM1kP6HAxF3EJizDim4oKX/31KkQDoxV4ymWN+kYioNybXONyXq\ns1d77hK4iJXHSNZa2SsIDBtbQuRDeGy7WMqDkf1rjtZM2bfvi8nqrINS29vc\nIaOaQECmst248zWDolnmUs2FMVAv3Jwl8PyNcT0LL052yxWaTCsNfjz/8qiI\nLtvPJjjr/fGCmf6l53MlU6vWXRSDVTI+NwtEG6SfykjpJGgPKgZMbVIOUGdt\nBZ+usd8XOfX3vFDVOQANCLPb2/DrnCARqM0kbuT2LNjF+Wlt4rlnbItVcSI4\nwKsr\r\n=AjE/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaIzkTCjvG52xlLwaNrFveJeHtPt7mbYFiaCjvJPYXMQIga4VMv++FJ7gQMLbMIYOtHU2uxi9aHaazY3SMCbsGpRc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181119204931_1542660737189_0.9997835729178379"},"_hasShrinkwrap":false},"1.1.0-master.20181120170905":{"name":"@atomist/automation-client","version":"1.1.0-master.20181120170905","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d8f0f5c60f01ee628154721cd9f06c62519427b","_id":"@atomist/automation-client@1.1.0-master.20181120170905","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3yMdRJGgVG3UF6MU1TTVggLNYrce8nDsu0gTxNjUQ1Um/74hs7dzz03RquWCct7f9O5DN8T75ikOYsg3QGUkVQ==","shasum":"685132d9827c10547d201ee6dc8499a072e3885f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181120170905.tgz","fileCount":593,"unpackedSize":4888045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9EBLCRA9TVsSAnZWagAAM44P/Awz+LSysbZKQp5QIe/c\n5j/UOYAGpASMCPxhTnSKSser61VjJ2fA0N4ZBNP5XJh4Ogj0JMoa18owx4+4\nNJbYNr4jCP89JSP/RTvOo7/AId0qRK0KFIqDWv2DGBbelGPZIMvH2SzQM+8z\ne1W1epkC9FjSe33TgzcwdieTr7g7X4R60qAM8bL1QSuN5GGQ1eJQ5UZQOz9F\nkD4xA+84Ia8aoNGPlUxZvZJh6TuLZGff0xJOPEFKAYa/6HElZ3r787u4E/py\nthkVgR63xwSBT+ArZgOi2zwzhM8NrXVFScKlF2fdl0uvGM+DONPl0jAIuOJI\ntMuOaLjgN5AR8MBOwHfBNYx+tfRdcAd7XCQ/+TV1XpwnBBjBHkzBgw983h+Z\npt7DW7inq0tpSZGlw/rhq99g7pPKFUERgp7Cy8ey0r+XSE1ZglDiF3qSr/2X\nhF27vBtVVy5izUdtvTknZEEKNHEQhTI1fWq3/mTGUCD6jOgsVTYVbQZCh/mA\npoIjkljiArFHsISPxS/c1BFEApQ8jsq0Mr8qJg9rO74r0jdBcsB1ecPJylwt\nFIKWe44x+AGSbH9Z/1q78nVVdfqdovbuP0bA2hWNwwL6/yikZIR2F53pcZZh\nxm6V2dD3gcDgtZ1DVNXg98P5T2z62gbCCXJsMm9s3M1n7ocPppkHa5ph/wV7\nYSac\r\n=22eT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1axuR7/+x6sK0qTZRYioNZMzDeaFTtBSKL0pgu+GACQIgIUkbnfn2C1E1z9VXPLK9gw/816Ll6YDZWg19SIEcu5M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181120170905_1542733898794_0.9372510841182344"},"_hasShrinkwrap":false},"1.1.0-master.20181121110042":{"name":"@atomist/automation-client","version":"1.1.0-master.20181121110042","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"22e183002c227800d306c1f799691b6527a2dc0e","_id":"@atomist/automation-client@1.1.0-master.20181121110042","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZLjglRdBk2zUXGQHbwmqn3ajPkiMtkUDVhQusBaZYDXb/qp/UCZ5oHbk+z2rUCDG4Jfy2QgIwlJIkoJSR8jqkQ==","shasum":"2840c11ff44fc6adf024a99c10abfd28be484b51","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181121110042.tgz","fileCount":593,"unpackedSize":4888839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TuHCRA9TVsSAnZWagAAzhgQAIGFFzUDDDlYvwbBDcTd\nWshElfnGFQ8yVT4ZNfpHEGr7Z0eBuB/wP82S7tfckoRygFgcjBt5Imd75Y+w\nsltIW0Zd6S6knQwhlXwmM5XZYeuCb6G4Zk1/6US+DWHVtv4nmRWwJe1HDUjl\nlNMAU4QcibMhqPo4WAzbeKX7uQ8xhD5sbhSae8HOhigsre8dL3nT6pIJrfm7\nwyot7o9Fm8x+DqDeXm9/TrTcm9vHso2oioauW+DblwQZLAW4aTwz94cBmJ3s\nUdrxJ8Dfp3KVtObx4U+ibMbTnQIPnVYWur/YHSTYU4du41VX/RfAHwmcVQ9P\nsquhlEvd63IGN/a3rfKVfd06bIf5aGyl7VYL/Sjqu4cm6YW0d4ABulbHzisq\nkVSGlA39271qWYyBunA+HuzsuotEq0wP0cexZgolHisjGcAFuIJn1YZCA63E\n5xEPMpfY7ki1JzVMDOC7hu2byYx4QwmGcDdBNB/oW/18H2Uw8cSb1EPG4CQR\nq2DODh66XX9gHH+L11aO79RI35TCDeLZfSFG3Xuz++Vud0bzGrVeiykv9bBx\n37AjfXgiSOQ9rvU0qg/ewAtWcMiNAUXmUAOsKR5vdnisyGokIn+6oH5asZ+y\nBvPWyp9vh56E74z8bgKeUWqBG3j7aXat5C5eHZ0gOpQEoBQOqctBZOlzmJ/L\n19ge\r\n=hdB6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQm3KaKm1DFqMZxe3k2hMTgFcIGc2cB22DYs/Blb0ufAiBCBbyWtZvLVZ20NZP3xwysjE3TZ7+8QHShjj25X/TZHQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181121110042_1542798214361_0.47693913386965403"},"_hasShrinkwrap":false},"1.1.0-master.20181121110216":{"name":"@atomist/automation-client","version":"1.1.0-master.20181121110216","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"22e183002c227800d306c1f799691b6527a2dc0e","_id":"@atomist/automation-client@1.1.0-master.20181121110216","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LJn3CVSjKsg9oTE+EW+BUKP6xYKtDTQKzZysBhNZsgrclN6Rwbv1m27dCIu0xsVNRBDuFK3Ieo7orhdMy14JlQ==","shasum":"909cb94192221639bd4b101aecb5328e47517e2a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181121110216.tgz","fileCount":593,"unpackedSize":4888839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9TvcCRA9TVsSAnZWagAAb0YP/jMv8/5I2mHk6pIf+I/k\n/imPccDkhm7Jq2id4LPESQrqM2nf2GjtD26PlPzWNezohtj1ynXl/CdH25Mo\n4uY+jPHUb0jW8GtS4Ju8KufcP3yAEAX4iHe767A2K2Ib7wZjyk3OnTHwKsm+\n76jFBO7NBDrA18lhjo0jlBiwjdFpxdgCIJGjwNczEMH7guJK5LCtxL0X/4jO\nCaygOEbbypk0Og6G5ywbECI9I1wh0igAaGnxY2Ze0ovb0ZIVHDd7cja+jups\nBOqNRVyfLc8ZYPWjGtId4BDpESrKrQxjyNGD7+AHc7u98Ge/zPq8ljePfGh7\nWHigOx9KUKX2uDTQttF0QNrjWjPuuDyYbb5idPNQVP2C3dWPkI9uK87Pqf4S\nPTFfIEDWKgLLqC4//w5dsViM0+xgaupeJfTiXmDnVHovGkW3JKCbg5BlbFDz\n7dPHceCy29eotcHYnyP7RgNQZD7a7Cu5Eq4hBoIHeqqHi8/pR+DfZ30h17sk\nd7METcqUagRYB3RXaqhenj0qCEPXb2OxPNVo4tWCWCDnr4dNnOaWk6Jxdpth\n0BYfVqc0Z2q1rN5FUuR/lo88qv6LoztqD/++kNxN+NUYsFLth/9obM/D2awE\nBpLlcudjrFdYUIcQXGr4E8XEFkMSIVwG8nrmyPOVOPuX/MRVw8n9ZJRvoUDY\n62eD\r\n=xp+N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbYwGPsPbLBRWHnodQk/MwBqC5H+xZxzGgfFdkDbMQgwIhALEh0Z+/5KyKGTYT05DbWKXXUtPG9IOeePfHb9jX4N/L"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181121110216_1542798299423_0.9541968378675698"},"_hasShrinkwrap":false},"1.1.0-master.20181121142425":{"name":"@atomist/automation-client","version":"1.1.0-master.20181121142425","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1202cc23f41c1089db7ffe55b06aeebbbad5a8e9","_id":"@atomist/automation-client@1.1.0-master.20181121142425","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hHchWyqoU2XV4+YlZe5OWnPAi1QJXAQrLk/u4JZpkqWO+cc4tv7xtbJHixl1DDi46HbSTeY2O2XVMPvPF2hr4Q==","shasum":"64b60d0fbb6f8a2698e48a7c2a7bc3ca7863c387","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181121142425.tgz","fileCount":593,"unpackedSize":4888889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9WtMCRA9TVsSAnZWagAAP9QP/Rxq1lZ7FKv65oQKMk/5\nhRuFFGQnWMKkwVPrz7dOjIw1ahoSdF406Sy9BKAscrmIvw8k9PEJvrc3SeZa\ntKlC8uZLjIvzKz6djMmtcsSlvuiYbBTWHisegmkSKnCstQr0tK7QVKD3Nzx+\n2qJAtvdhp6/Q+PIIEx1HUM4n05djlpZpE8EH4XCAvAACyrybB2/46riJScxL\nk89q96NrP0SxqGpw1z4Bujc/UjA9STxzjAZOqJsHJ+P5JsI7btEFa3nZ+6VF\ndW7WcCuV0L+UiTqrRZAir4qjPKTecfX0UzQ71xVv8QILncrS5tdiylyfpqcK\n80KzM1lsn5dfw1T2CgLIRoAtbDCDnjFgoqnwQOp4iCrAg0DmEg1cPuHleiDF\nV28jCZ7gkIkNZSRhOvbg75pCIb3iHza/GJKHmpuKoWzB7YX+imbmhcmnJjTX\nmGsBLpg669uMAi+YY++/yqrOsZqbYgLe/2yw6Did/C/UA+5psjq2THK9eeZ8\n1dzhTcojdfbUckL2/4J22HVTjV0M+JwTujktAyAkeKyrSbAgFAqS+QTLPcN4\nblprKseghWaTqpB3ojx79+jY32Wx2uj4yh6Lc0osiy0f3RJk+P2jkpymacvw\n6wKwwhJgNA3YE1K3LnLnAsekvXrW1iZqaMePFgaFSoRxBj12jPod6OUEy9rl\nLzwI\r\n=BhCi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARZdCqYAdBrHz7J721vJ+XvH6mFX+omD2/X+GNqX44dAiBbb9Gxr7v39LESS6gw3A335E0f3c7HE6+dvVLmp7uJCg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181121142425_1542810444119_0.7929043364678006"},"_hasShrinkwrap":false},"1.1.0-master.20181124170930":{"name":"@atomist/automation-client","version":"1.1.0-master.20181124170930","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"02f8c04335dcf78657bf57e0da41927a1b215299","_id":"@atomist/automation-client@1.1.0-master.20181124170930","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-k3frk0+Ynr2uU5Uzh/PEMFl7wiZejDhxz1ihcje3inlWs5HkyPVZ9+U5Ft6dFx5Hwxh4NbCFEhT4fh+hcy335w==","shasum":"d0ca5cc89df1ecf70dbb02f112b5d9557c673551","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181124170930.tgz","fileCount":593,"unpackedSize":4889315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+YZsCRA9TVsSAnZWagAA0ggP/iV5f5bpP2Gjf9TqOABz\n5U1dbTuu0lGe6nvOIva2M3UTKo+gs3WCULx7ZJ7pr5cRQ8dAEaNfDBVn11X1\nvvTM2/HPQN2rhSrzmSR99qc8WhA9eUD47RKeI1rBwOdkXKwjZJ6t6EPueEdg\na/lSubWe08wPysHRTjmzt0TAJg/2vg2CdNSaU4FkryNER1sS8WBwoAKExllT\n/3ARCH+u01uoergXdMILOn5rUF4uYiN+YT8QBCWnAqgr+yds1QON6Y/N0fBZ\nWLe6x9Uz0PSc8CpyS7j5nWU0/p1nkUGj2IEEvLu4a5Ivote1Uqr4NBjpoJ62\nxygHxXI99u2R17EmDudla/v0ql9mvIQgIYVZI2bKIaPIS3e16PZLRFp4evUM\nvHVj4BqR5Q8PkKw6WB4VXKcWQEN9D+1Gj3fZHcv9v3zh0eqS+DN/YMXNH1by\nnlNg4dM/3QUJrTPQNOwv3LCH29ghkulqQbi1GA3yVCHHeZ/FDCMBbDdYy7nK\nqZfGbgGqOQczlpDp4hcqI2c2NR23oEn3I8ccXPc45CnoM05cPUD0YAgB4ifQ\n5n7aZ29bPTTVV7/LNZKvyAu5s9hM9rQAei84N32cKNgXjxqJIIzywHHVF8MU\nOYBPbvZUl4h8J1vgCpw8FD1etVwZO/l2JCrYHRT1YIY6A1CD9F2rzMQ/I1Ip\nMPTT\r\n=wnCJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmOkC6IQ4cmNOJaqbQ59k/LXagd7ObGs0kpi5MoI7qGQIhAJlr21kQTsUSA99A7gGRQWUZZMxVNV58vHllppKgNqQh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181124170930_1543079531371_0.5604511033613762"},"_hasShrinkwrap":false},"1.1.0-master.20181124171043":{"name":"@atomist/automation-client","version":"1.1.0-master.20181124171043","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.3","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"02f8c04335dcf78657bf57e0da41927a1b215299","_id":"@atomist/automation-client@1.1.0-master.20181124171043","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-M2iTcro1A8bQHLOtZPyng/8cqzs6wAkne+GBEO5VDN7XyqhAs4QNIV0HWMoOzYu/9eqQhTBL45VbQEcQ13n/uw==","shasum":"1260716da652d8461c30eee289f2d0cf1b794a52","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181124171043.tgz","fileCount":593,"unpackedSize":4889315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+YaoCRA9TVsSAnZWagAAX7sQAKKnd9PmZLs9x9vNzJY/\nUUd1XyYybEnaetl6lkIPapC6+noKgw3bGotGrn4NgIexNBUi9nG6ldqELNLA\nLyo+mOCq9T5l+D7+Bl7qXWX7pPpMsy9o9M6n4NL/deoK6JwTGCprSr4iV95+\nYfpTmDe+WoMkyuVdcZ6tpam4iVfh/hY3xPwNzXFbIxZb4BVcFl1PGURLRhJp\nARPO9dMHng6zDx4LpMzEg0MQuMZkbMFrAaxQILF13ikdyyrLaER/d5fpfJhd\nBKOZHNGVV7ReAQL53A5jgt2Cf9G0awUrKXn6Gz69SCihIZr8WQXCXrc8oRKg\nztZKUtBTZtM+7UFY0NARASCbzzuPUXTbyOAf0wgeOrQhDKhG1izNQqKTBQOF\nYq3YTD8fK/KqKobC6Kx45tm1xY/Z5+6t0ysSyvJQLiYVy+IeMAe3x7AIQEW+\nB6OAjp8WB7PrORqtiMUJyxKxmHpvFMlz2u44Bgp/ck1sUUUcvy20Sz3Y/FSG\nje36IEDK4r+2nk1Zkn5U4iUyTy+8DNbxcMdOvxNHVeTjrRlGkFPGcgWDepjK\neCy3sa0cK4iOCOk6qqWicMdMZ0Gf2JUFs/S/scox4uBK0ovqRLuXEgxH8vAV\nA2kuZUzGHc8PsX8c7esr8LO9zOIDj/dTetYiEo8goP/2UQ7VuwxZJ3tuQcJk\nuySF\r\n=vhK3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj/n4Wzczc4C1L3TTk/0wUkYg7GOipqmBCM90DfLT1RAIgVx3dR6HnoqPpuR6/q+aDDyRvt2Ds/L3O1BAo5SH1Q5Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181124171043_1543079592055_0.06206581306346548"},"_hasShrinkwrap":false},"1.1.0-master.20181127074649":{"name":"@atomist/automation-client","version":"1.1.0-master.20181127074649","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e096a832ecb5aab3d29ae797803a9c1cde12e0e5","_id":"@atomist/automation-client@1.1.0-master.20181127074649","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9Kh0p3aZhzsqOMboSdopFOUDKfLmOJ4etg/ZcOgQbRQXJqDnRlk25HamXbGCvkfv1m05RVMITR0rIBqUOnsp0A==","shasum":"042063f20f733a7168bc904d66cceaa4f6de5b47","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181127074649.tgz","fileCount":593,"unpackedSize":4889315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/PcECRA9TVsSAnZWagAAXiMP/jGcFHqkS3RZ+hIlA+0U\n84b/XA1G457Qptb7Ck3qAY5WU+VYWTXfpRj9rkTsXND2QTZSSwL34/hyfg7z\n8D2KeYWuBqGnj6S7QUyicugJywPcS4WFh90FT/CMJuPRHELNh0anmRY2vGOr\nLjzDcPUSrDCq1ZpNwWyV34H54i+bwD/wAYRc1wUYS21OqBXduf+MNQHP37FI\nbH+1kL0Oc0oEUN9t8ZHx1palmW1tc+UpPRTVJzZeQik0CDRK1Kzn071EV1jv\nOdWc1CDADMjrouc9Dsfxk59ayu8l3TnqbB42IDG75Pw3za4uC3960uQ2eHhU\nRf7cPbeP+onlzHbLlbKye+MmNFRJNXCIbUTkhGrieROfex7XfF/WLDSiTZ55\nwCo8NNmDhdAzLnhecrZ5fThmz8zgOwXNAOek2VpyYe6XP32xaOgEctyapV5v\nntQs5LGAOIYK3ajrbS6yvRMpBC2Lw5cJO0icLK9OyjWN7Bp9PIctlr4B9gK2\nrDtOFd2m4nC3FsW8nCZpwiqm5Pe4pUIe0QX7yVH0bD/BaB53MN8+7/ksq8zT\niTYlggbC7v7VWYJMlclsTlxVflX6n256YIgla1jWJWmYkHiiKPGG+Uz1KVWb\nSwld0JfquBmEy1hy1vZmknxsTyl0tDrXlWzUowJzhT5q86RgCsv8FwQPoyh4\nHWTE\r\n=D3JI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnVWo1nWdsFnoIZlq499H5trPz/WpkViP/QGVIBpuDsAiEA/6PfHu8epB+aLsDzAam/lE8oSUqSo3PoRrPrUOgd5tE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181127074649_1543304964207_0.7634386023116297"},"_hasShrinkwrap":false},"1.1.0-master.20181127133630":{"name":"@atomist/automation-client","version":"1.1.0-master.20181127133630","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0e9160bba36250a31bb4ce8df20e30564ab8895e","_id":"@atomist/automation-client@1.1.0-master.20181127133630","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-11dSpKKWuVg5sTlvaDf6modzXv8nxaGJGxLAWjrwSPox6rXHJldOa1K75jQUrAS3P0jBm/YD0VyMeAse8vV73w==","shasum":"e5b4249c94d778d358bd6be09a37f48fe80d9481","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181127133630.tgz","fileCount":593,"unpackedSize":4889406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/Uk4CRA9TVsSAnZWagAATfsQAISHG6VWxZuaf52UBigU\nycdP5a9IoIR17aV98uqVjrzvWjrHygp4xz5tVmrYseV6RURHseb51XLQvTSZ\n6F3vqxRjF4ZRW1G5Q4T0wbP6dgp8YSSrmZwj9suyWqe61IsLMJ50wxD2wVPE\n1vSlAPz2VVsWW9BFTineI1hPvpx9sUb6mqlOhCvzRxnEmWKTBNh/2RsD4B1k\nFfRASS0ugMFyZ7Badn+U7m19MSY65cdZruHHVRaANmVa1vov+8pv8YAP34oW\nXTuIk96fxCL8ly+b7ka7H2ylHhmvJLbTJqqZu6j49sszRSOoZuN5im7pR2eA\nDDEWM5HgbYCWsZ7uOfE/JDsN05QV104Rq/2DBpEidxeKHrbxt8EqCfw4R/uk\nYX2R7bcTIvFdFgEdddAygPAqyWg6mdebtocltrm6O/eyveZ/ratPuMi1mOsI\nkND3NK77xdVNL/2zPE5GKHriWKDkzj1cgZ8YUVZqi/8/3JXVB6NiPN8MYP24\n7uw9174aL1/P3tIYc21aJaK5o2hc7j1Bbhv7uOBS0mdMuXax1wI39qop4ZnK\n/JDP3XevT1uD1qQ9lhtaRE8A5j1eqeBK1mnCwH+Jx1v1hQ02JPFtG+8/I8+9\n5qMjN4jID0vFX51IbHQEcjagqNbhJ1JOzh4n/05Jt4zzA6eEsLV+Zl5+Vyp4\npJqC\r\n=qJuF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe1Xw7PGnFf+lZVnZ7zjUYy1IddBuBekmdtrhB0GVhAgIgX0LayGw+FVCk6MSfR8qm57uL5mt631l52ax7qGaOS+A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181127133630_1543326008188_0.7504511391324673"},"_hasShrinkwrap":false},"1.1.0-http-client-config.20181128102630":{"name":"@atomist/automation-client","version":"1.1.0-http-client-config.20181128102630","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b7b4b7e55fe3ed28a4b1e276d9256d83b19881af","_id":"@atomist/automation-client@1.1.0-http-client-config.20181128102630","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vL2WWsLnplBmDv8FV9fC8IsBP4a1Qhrwoy7umajxUytOUlQ15VR0UBrYZZslLjdX6bN44uCetvEFIQExNhmBhA==","shasum":"d2b38e337879d8a137607f24e8f23fd024384271","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-http-client-config.20181128102630.tgz","fileCount":593,"unpackedSize":4890289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/m39CRA9TVsSAnZWagAA9esP/1vC32vr5ym3qmQldOlR\nVzC3dgPxX7wA0Kja5r1Lw9+uyMXLWCDegMEk+/VUKNGYB+7sZY2UF5kyS/aG\nsWvW56NUlW5acDa6Sck7Owf5dZoTVPuZFRyh+OsEOqMEE+BYlG4HHdaPk0Py\nSpA6YHv2NOTdUShXir0seGOgKAJHDHDAnwbl3/JoS1sG12UnyUh8TXN2UnI2\n5swL4QxZ+NeClr3rUgJztDh7Ggxu+yyvQmPfgoK/wNndU7Dq8cIpSwiOjr4e\nShMYjEab1n3nwKf6U4TgjXszdkJrjMAX0U5L8CxGymzAXtSfgaLrRHckYlKC\ngnI4VnQSilUSm9KOm1T5VFVEQyydOIoNVwthHjRIPRthqQ5jGv8cJT7x9YTs\nQnG8THlA6xG7jpSwa9yojNmELVp62J+z/LoiyPM/ryYboafK4g5nDXAkMJET\nuZ8tNZtDKnHpCCsLsW+VF0rTf3hv4R2dlWgzg9AcDWnsCIcfn+IwNr4ceEx4\n6RSyLYgIZQdmFa7T7lIwtXkVFttWzbOxB7mXzUMm+bmjHwFz8qGP5Vf98WCP\nfYl31vEK85YFG2ZaWqpvB1TJlDFi5wh6O+9msjv0obveN4UTJ1C1IxdrdkZX\nvRZAl7puQl5Zi+eVLxwFL3vjpic5ps3DTnhjvir6GL32UeGdW0KwWVPIGnx/\nQZv7\r\n=2mt8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDf0LwAy9661KK9UU715YClg+EyQFU48lBzywfzr+BE2gIgArcs/PKf0IDW5+vqDi83hXthSPSOIxtYuKoF03n+u1w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-http-client-config.20181128102630_1543400956193_0.017560729416333798"},"_hasShrinkwrap":false},"1.1.0-http-client-config.20181128123248":{"name":"@atomist/automation-client","version":"1.1.0-http-client-config.20181128123248","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cbe83f5abad8d7744a93a4b8f85fdaad496949c1","_id":"@atomist/automation-client@1.1.0-http-client-config.20181128123248","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-scP2aNBq/L20BYYU252vX3c5sjZHdVF8NRQ9Umk1ey+u3iYVxwZFO8iSTaYK0Ua0TO07XE9lyWdPD4hS/V+Jsw==","shasum":"8af552fd807d21df4b39ec883bc7e0d848ecf7f9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-http-client-config.20181128123248.tgz","fileCount":596,"unpackedSize":4892105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/ouVCRA9TVsSAnZWagAA5K8P+QFmk26n4jAaQolNqp78\n44d+srAs6UBycs99R+P8IgB8gQfXKgyZYf+9/H6AxCCtL3PULDODPu/SC+de\n5SMe3ZlVr1gW7TcTc0p4T/8r/N8Mdm+64DzFfg/4Ptc6iGoLefwtuFZi8hx7\nY1PPusS5yFFIteofoK+uY7gXhaYqpV3EooP0ktFDstJBSFwRjgrglPgLkDqq\n5amKxBGMhu9BSqYIqsINkdRcfsbLZVxNK6ffrtRWlWImLM1oFgrHyAhEEKpN\nzZ4RjOeg3ghuNNqyyb8FgoHP8+Em/h/uvRACFmzgO/1jk3u05xslCe7yaQDs\n2773R38ArthQLQxMXQhxW0pPeskZmjMkozcU/K4OIC1eKHVgbwuHWS0Y4x6+\nfmEDxWKAjgQn3ltIHAObu/HZ+UK6u0dPTvoZ9cXBSI4+BYkQ0yrnqs5fDgCC\nTNEHuaK3Gk9DsgvdtOZCpV4ycVdqARPZ4unAmsPeUAbj4mqxDrqk8HIhfZZT\nsZBU8fKels4AD/eBuuzt/RvDpaWSwrAX6ualG60m2uyAMYxOKx3xSkmL9LUz\nCezWvMac7VkF1dGavCza26VyhbzZl8N1qs8MfuZNlsGyzbMG5y9zt7C/JiZx\ngB1J9aKTh37OfDMNP5vd/S15/qFCRnNEfgFP8JI8Kxu+8CWi3GLXF5/Q3MMZ\n8Rie\r\n=fuqw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN+HpE6SHrem0RJG7Ayp0d3/+mfvLNJ6kAoiJZ6tMGSAIgDalFrYjBpx4XVmzF/pQz9UafQ73kwvW90rIbmDzaSJU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-http-client-config.20181128123248_1543408533263_0.03267861845542663"},"_hasShrinkwrap":false},"1.1.0-http-client-config.20181128173247":{"name":"@atomist/automation-client","version":"1.1.0-http-client-config.20181128173247","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"488c526fce2a6e1f70d0c1d5e673739ad0c0ee4f","_id":"@atomist/automation-client@1.1.0-http-client-config.20181128173247","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mZS7QT7B9sEt6Qtr8iszhm9lTpgf8rr1Ua91MIWVrai9yZo/WJn0eJZRmkPQgsWhu4oBPkfgYBJ/fBR+LKTjrA==","shasum":"03d21dc438e3d55c180b1acbcbe9a332ea18ccf2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-http-client-config.20181128173247.tgz","fileCount":596,"unpackedSize":4892404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/tHqCRA9TVsSAnZWagAA9CQP/A7xC0+PWLVM+2+/3QiD\neIHiNoe1PobaZnu8rTEvc+RTklDjWJmNlSGKTAAJKyDz9o+EShXEHtRXGqhn\nIPwQ7ayytrBjSXFAk7y4FcpsJcm0U7z8Tv+EJbv9LGA0Kgy2dPvkDm5yWkrY\nXebokLXAZ+aVjhxrQDc180Src512GEqLzsT7SV67vjsuEZalvqxqVWLX3I/D\nIKs20aMfrneQURv0BlxexizpftQ6DBf8KscJwTI8etuaoW+IgAVn6sYU3vzv\nc+wl77YVmOIr2L1+Pm1VVNZT5LxiQTk1BMfnMnMy6EISpdeQmm/EHOcnxfuN\nGjXS8iPfc3M3iDNRoANiLxW1M72AajC6cJdfOzJeHfSIDVZOABTJTDf9M5qv\nrt2gaWZXrhQg1vG5yFPUUaWrZxCdSXGt216TJVfMxGDZgJET8hhVCuYZCGpL\nXIv8GoSCJLf70eLOZGIcMLodd/yi7HYw0grmW5k3IJfccjBOu3fE4f1RS4Kn\nZPITjfmAqaf4lg1dwF5xzz2vI2T0IxjbQwm4U6A9PchbgocObphhTAU2RsXn\n14XhPAYETgG8M2sCmwToqmr6y5SUDzIDlx53cfY16meM8oQwed64/8d4kwOG\nrG5sgvfbmvRcHzGHKVfOZFaz83k/x5fpU+GPb/icXH5vNG9gtTY2LujrEsG1\n4JBD\r\n=DSW8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjRnmCyv4fT2GS5gS6BW8eQQK7NYdXKajFqy1/7c+z5AiBbmpMuZn15P3W/9ZLZ1d2vyRlAlITjPzOkRfmC7nhHkw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-http-client-config.20181128173247_1543426537884_0.7619719137706744"},"_hasShrinkwrap":false},"1.1.0-master.20181129132207":{"name":"@atomist/automation-client","version":"1.1.0-master.20181129132207","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3a3270a2834a174df41c95ae98298e2571bfd916","_id":"@atomist/automation-client@1.1.0-master.20181129132207","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-F5PPMy99VUIR7nBiU0qq2hDgoKe47dH7jQBbY59kLfJH/Gbnhr8wi8dRvekq8v6KvMJAFNObCDsywAk9eZScgQ==","shasum":"5f97e47373e749d3f0a7564ee1763182090e2a0c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181129132207.tgz","fileCount":593,"unpackedSize":4889367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/+iUCRA9TVsSAnZWagAADrAP/3PZvGLtKgBZvLP2ulcR\n832ccl6m1GBk2t6xmUF34O73ZRUPjzbhbkudt+7SunznmiHa1ea9DqfD7Nyd\n2dGy0xUa0YhoAsN3B27DJPH3sveS4QsIoOX/9zfzt0uWOM310S1XSWbdCzvQ\nhvYkT/hDwYlhUdnU8G+tP12TTtXIRGiYE2Uh/lpRDCyJkvnhwE0A6hKGaUb2\n0gFKKjwrPIvXM6/IrqvWh+mSU25j8wg+DiOIoHUucfh4JnLwbqYtbIwpManm\nnosuZiMkz14eXMRIR2mn/HGVcg6yvWjxrDm5Mr8UIz6cCxbaGRiDjibry9DN\nspdakMGx+qUgfJLmyFSHDKqLKCH64ZkrIo4ATqHpBb4Ff9MC6jFr8xge+8dS\n8BgTGZ9OBsL0sLsOZwhuns+0Smrqs/RQUI1O7DATBg04BPqIIumaAH/SmFEZ\njezZDBCislsCaw/ixdbgH4lmqGMhEC19x0t918lw9oVc3jwzbb6pJ1geZJ5f\n375xg4eWo92DrONpsuqIiOuZEFbRI7HmHD6WN5kHEH3FxThOFJBWE91kaa+Q\npcKV4q3+xQkGp5PUP4xj/q96rWXtnSp/9eZkKOpE+2EpuBefdvOWbCHI5XuT\nwINvDRZES/O6oWBa8/z9K6jEljmVH2GKiQBb4vWxSWKo7nyHHMyShwnaqql4\n7f2i\r\n=7OfT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDA/+83QDRgOcodHieuQna5GhBjB1SRYMPZQ/lIu++FYAIhAP9tQ5buUuwBD3jfGe+OSVFysuZEhjkOlKo0phXUGYOA"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181129132207_1543497875650_0.878040917893486"},"_hasShrinkwrap":false},"1.1.0-master.20181129143544":{"name":"@atomist/automation-client","version":"1.1.0-master.20181129143544","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"11ab8043495b650a68978632f4ac79e97fa9f62f","_id":"@atomist/automation-client@1.1.0-master.20181129143544","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dVZu+BiCo5jtWarBDAyhQh7w+sk+b+RgqoPUq/XNH/t0+wK3Iccw2CnSoH74adPmIiqhqQVBjckLrbnn9CKvqg==","shasum":"36514a42e6fd4f35bebe54e48904e9d3307955a2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181129143544.tgz","fileCount":593,"unpackedSize":4920065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb//oLCRA9TVsSAnZWagAAGWIP/iHOUXS2HA/4+x//Iph6\nQ3WDoUZDACzOG+Z/Dewd3naIDqQ+PCpML9wdc1rUHnc3U3qVzfHOAxpbtn1y\n/OQ7f1ykiQbj5wbhCP98k7nrJ3LJLB1TYjnyvOUFrW2mUcZ3J8CDXfQTaLSM\nFP45aufoIWwdjgfdJJhL9si7gerWptOcP5IGlIA73cNFBo4LOK+O/XuGC6lC\nJAx8ikYnCj1nZo4myH+ftVtBcVUoaV3y7oPCygzLBZxCxHAz8TCqlsPziDYW\n+HTMRBPy6leE8LRs0m0Zc+WVFGqzZgwGbKJ3KjVyDwEXb77XZRp6ObQHDyib\nYgIGR1PlcaJb4epv4aV2TApfmbU5GqdMxMpJ9QdTmcxRvQjbIoMgGuKnpdrE\nCRShAfNTjcQGZJyQVYiRa+HfX1lZaLB5VWh1g8imbHNFKfEFm7fmvs3b2oZH\noRg9oRJr9lcK+t4r3huNwgzBpq5OMfoGDhvSsTDcKxT1K+tATygL3I1w72hc\nF0ewe0TTM8AtlwoLjM1H095atarJgQnzIddlyrg4bPpgGnoWE6sj0TNgf083\nigv2EgurFuug4RXGeKE1Va3aTqAvnEyYR5XNJ4QuR+Ot0BKSUr2LTiT8zOVY\nPnaL59hvPusxh5+aTSIPMUcLVTxjDAux6ImAl/iV8qWMOy5dwvIzPpT4iNdO\nVFe4\r\n=+sCY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx+JpMC8AvSYIKkzcjwPugxxgY1j7BN3jGpsdZcIrN7AIhANZuQAZD6k52ibOXY6j50AGNrtKmUj82qiQ/V6pwdGNO"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181129143544_1543502346644_0.5922246443575765"},"_hasShrinkwrap":false},"1.1.0-http-client-config.20181129144034":{"name":"@atomist/automation-client","version":"1.1.0-http-client-config.20181129144034","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c0479f994a305dbb21afdad31e530a70e5472d5d","_id":"@atomist/automation-client@1.1.0-http-client-config.20181129144034","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XK8YH2jzkplooEgzodYgZsjvFQoPCPMtkLNpAUE6XRoSPQqycArad4Kf8eQ2n5EcA4Au2ePyHrbgpXvVk/R2DA==","shasum":"62871e65df670e4186bc91632469fce28c1b5708","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-http-client-config.20181129144034.tgz","fileCount":596,"unpackedSize":4923063,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb//sMCRA9TVsSAnZWagAAfsMP/Rxpn8kUQi9L9sr7Yt59\nkmA4O5d0Nz18MAdmD/o5g5MM+YNN37aJBMrDcp1N17tFYjmfk2v015wPkRMC\nzgMq2BIh6wYVZJju+YBBFr6Wfrry7FabEv5WUWLb9+1VDpBDyJ37DohgdC7N\nBEPjIi5yYhwIgcB7m5zT2px/vK09r8JiiKfTRIp8ym5KUc8UHIvM8ZJAknV5\nLuYVjyAlhM1eTM3pjiGGxuYFAWcKbE/p71XtpjnBI9KYMMJFjVIIfCTuAFez\nQpFBie9S/1uHlEihp1NkXDXaOAWJkNUBy8W4iJUd3ZYSG2+sNmTwCF3Vp0E3\n7Bi/tQtHOoeKhfI7PFDh26J5v9pzIxlcsA0ptgVvmmC0rSSUn7qGC25zZ+ow\nHkayYxtovj8uuXTZgImYyFHYH2lWaBFDSnYx5aaolp2/5TgoWGaEj0EB+ck+\nXR8pXvSrknM9cSS+j9PlWWl5Rg6kaU57QKD5b6uaEGMJDm0sfEJmnTLnaib2\nz18rfZgyxAqANOtZ433+wVZPYFBgH3tsVvufpj7Xs75r4MYX55qZTkc1SNcY\nLfdmY5JJqywKtVMufJizvHK/wBdJY58j94vc+cOGR/tCk2OF/1uJkbpQE6tL\nvfbVgu+Fxit7GfLb3/kY7Imh1p7XPa6hLq/uva9GfoRtajFrEwOtYoxUyFKt\ncAcu\r\n=suNW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZf4ROJWHjDbeIvEovdFN4sYQk4ykJeSrddkvDw8B51AiAx10Zn2enLQfX7rsyenMWYWbfghRkvXqbyWNy12gNHPg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-http-client-config.20181129144034_1543502603776_0.6677610991151464"},"_hasShrinkwrap":false},"1.1.0-http-client-config.20181129174906":{"name":"@atomist/automation-client","version":"1.1.0-http-client-config.20181129174906","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"76498b1b0f088bb9bb079b328b19ecfeeb0aa3d8","_id":"@atomist/automation-client@1.1.0-http-client-config.20181129174906","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WdlAIzPQXrU9NKJG80HDanWGtGo0HsGP5VjZ5PwZ6UrjNHc4Sh+9tVLqkTqd6FphSJBD/+XXgRD0AtjoXkpc6w==","shasum":"5c9d821f7a9215534f45a1f1fea33153d8539ff5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-http-client-config.20181129174906.tgz","fileCount":596,"unpackedSize":4923109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcACczCRA9TVsSAnZWagAA5LMP/3Uty/ODUqFgrniXxxeX\nCEd5X0vuFQl5eE2MbTD3mQVUs/26HwudYx6qTqxd0F89wSiIFOuz3FLi4z7E\n0ip5G/3OJz11+roISTSHZjPMBXtb6jFgLN3B1dBEBUBeKjJjBHUAvkk4IBhz\nKMp7BJeaDg8xfc5jybfVXKitOaAhSOQwTjYqM38n5UrhS0TgxAhtC5LWJXbd\nYLncg65WDTmD88M4aU05riw9sUStX2TkNGwr/wizgb3PgsUTmyaA3duBERk8\n1UmEnH8yLBDCV+RdGmI0y9IWuWeC8pRlQRcvk47z0ycwgi56hwXJ3rEqQgH0\nrjwAkc9rg550kUMRK8C+AIFu54/wlnxXModHllug3caTKqhtAuAX8gPIlQ50\n3AStThRGSJNDScYrDzhCGTakK1uPQrDH2Mx+/8qY88iN7Lm08t4P4fJSOv0j\nc5qeu2J1LwY24ua4aYTHzMUgGJn6YG7FFByemrGmMmL+58vcXJOmXGNNoalY\nq6QXnzLyrthooH3iMgRyTjgvRRxYjNnmkzzbCq9hyFGwMd7/YJoM4edocEXn\nkU9LPCegG5O5NyNvmKk3VrrNCIGccGxLVPamZJ16PHMwUU7RxEEmosNBJqG3\nrcQEXXQijckRW+vBZJ7T3hA3d/6d4TmPaAF++EkU/4Q2jxvP4cw4jyLRCAUb\ni9Pw\r\n=1cyC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfw80dL0hCNe/qEjOLZC8DYifOMO8Oti9peKYU8QwHwAiEAhOl78sva1nguks1Lp2xbvZtrwDzCuOUVpS5CB5snI1k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-http-client-config.20181129174906_1543513906403_0.3474277269292634"},"_hasShrinkwrap":false},"1.1.0-master.20181129175302":{"name":"@atomist/automation-client","version":"1.1.0-master.20181129175302","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8d6b31b3c1fe09903defaae1dfb353a9cd506e34","_id":"@atomist/automation-client@1.1.0-master.20181129175302","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AHfg1Mjs5Rv2RqkNzuGcagnCP/MiG6MVPCMeOZak7C27oK+umLxWUIYJSE1UJHGRJEpkPaADYHhqsrCQ78AD5w==","shasum":"2422d27047bbacc68c8d9735d2a23ca832922761","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181129175302.tgz","fileCount":596,"unpackedSize":4923243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcACghCRA9TVsSAnZWagAAshkP/2rBcsJgQZsWdumxTJg4\nucwWghLZUsMJz52lx8c5H1CKVa2BUNa1zv/EATDSApg6iy1ohZCzpY96Z8KG\ndGwe0Ubo+TOGdSH3U4Quh05vrDK2FAkx5th/OJ+1FpVeA8scb+U+w9EEJjIu\nJ/wYj5SV2dYfApIWG9d7KVTCWZhHW634T0Byt/TgkAdCd07x/DsBA5f0gbZ8\nMv9k9W8OiZ6sfGIgiSrBRw9Bc8EMVgwzhHbsx/ZsSfpciWWlDE9z/ZZdAt31\n3wYn0Ujdqp09VPqrw33wSGnhuhmhEnyKbOJtdkRMA+UySL8hJ1YFKOfzgwye\nMmXiAMlf8C0hQXolvQ8f74Jb1Z0EPY+1RRUbOeaVKikBNzz6yB9euQDLuE47\nIAEbUT/C+/DsAdh2w8Xqk5GL04mdZmb+z9wVH7lLId9Yi/KdNK5ZFOVTsgny\nrkM98eLh4/Dm+WqOu1lylncgxtUt3pZoscB6oWFh83L8dkRa8IqscULPPT/r\nN0rIrss8g2XmLITmG4IntIR5xqYb7g2WCHhrjz3nMdfEABz7nv0sHbrcYKA3\n3wWmb1SXmIfGf2Z7Nv3OEXKw3Of+qgyBTSl9iDpSn4CERhvyE8tP8Qmsn4Av\nkVe/Ca7h9VtzQw/EHCNNBs2BRHVsSsxfa1VYfmwpIMr0D01z7iIPnKn+STzt\njpq5\r\n=WhEv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqCLzvGWAyoO5fiMzsnYdc60hDM8WRC9vqBM1c6joTVwIgE8TFSkrQWVJcBbe86j/nWxrY8FfcxPVJq9J6VfCxzMU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181129175302_1543514144683_0.3053039483113211"},"_hasShrinkwrap":false},"1.1.0-master.20181130221533":{"name":"@atomist/automation-client","version":"1.1.0-master.20181130221533","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"812801aea5ecc81d7a4dbd6466a44aa286278430","_id":"@atomist/automation-client@1.1.0-master.20181130221533","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nXdtPd4FDdeigqckn9DLGotS/i9R2dtQsoOdn75YWGYQa9JsQj+XnQ09EqivfsQiYkBOOb0vEso5A9j3O0Ophw==","shasum":"14de5b8a138e33810c62d6c2b941dfe5f41defb2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181130221533.tgz","fileCount":596,"unpackedSize":4923483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAbcpCRA9TVsSAnZWagAAA6IP/3nQ/gN1PW49lKXNCaPy\nFeyP9SKoyb9fYqVkP4Mfm71lNURfzPWlzCTwsDfM8FSt05Ag8ZF/67w0Ao6R\nKVji2HiSgoRKMyJ7HudCoVsjiVTbz6k4kqoWO2TAhQyqZ9M3iIM/H/+LHBH3\n/tKDuWPokLwSaVtwION6sr3w3rzrUTuD249Oh2xP5O0MM+AcUXrBtFu9rrzB\nZKNjHvoB7i2zgch136MgviNDPceSQCP4yGuob2mtaLUTK9Gbs2dxJDnnjrV+\nJJtHj3RyUMT+EXJfW4opD0ol1V+Je1Ae5kojtKoIAYlvHC1jkL6o92NncdPt\nVKqSCIe9KVHdxPXCAWRLUxpd1IEJGHRXCiTkmNQPCzkg3SWmL9XPjC+zqCtw\n8gxyme0aWBXusidlfZOT41SvetyI345XasfhXR2cu4KylqXjZ+HjqnZHYoBy\n+MiTWbwe2pRMhdPFDix/6KkvZiRdG2vZmR6Lag+jS4NciLLGOuSYYMGgmfpw\nfNgDbNCIs3uynSP0/QTo5h07frKm3/Z8gk7IQgqkf2+fNTeP8kQiFX8nRfXE\nUVvPTCkgoW/vlgJwtXTeOhIdyL400OIDcHIDtXH9C/XpNmOkX4FDCmpXip/W\nqkDM8zU+j0HeHhMBJMYoXljQqYCzCd+R6kGIiKtSkqP5Jp5quFekolC6EjtW\nYVYm\r\n=tJVP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBKTGAsO3r0rkx0Z8T7kEcKp8xe12e1iQxlS49qDrrcyAiEA4fzgNvxvTzYTnD9CxsT/l5BBkiQO8YgXqlSjaFQCNrk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181130221533_1543616296563_0.9101998200466055"},"_hasShrinkwrap":false},"1.1.0-master.20181203230746":{"name":"@atomist/automation-client","version":"1.1.0-master.20181203230746","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86d44f02e4631ec48e182d4ded8ec0ee1b083d46","_id":"@atomist/automation-client@1.1.0-master.20181203230746","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-TftY92CBG6mkAMtp1vbGIg8PeEElmi/kwwOWhv7yyl0c/yXCwo11z43o0yl6Klxm1Npyo5ooNxJAyFKP4kZx3A==","shasum":"90736b5dceae978a563ddbc440a7555fcf6fc1f0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181203230746.tgz","fileCount":596,"unpackedSize":4924038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBbfYCRA9TVsSAnZWagAAGr8P/jE3EcT0zq8tPijsXuag\nM8c8ux0M37Rt+x8KQu+rAvF2Ivo4EzeF6N8+LCFZFWvwyTIjZN+mQ0MglWi9\nK1JufAqMb+21rwuiyToitA6i/7rNIlN+bpdFKsOIMJNayWYMnLEErjM9zSql\n9vRJvaWEIVa7Guu6cgmVezhlW0e1cBQkc7PlwMJGSF+sapobOXbphO+PQK9N\nQBWLcQ4CUdLNo0xU6wZlMJdvJOtkJs1pjgBdfzQZA6gsTh/E7b2YdYDkN2o9\nmsmjV11kNOc6CZvET3Pfeu4ZBNKXmvBlF4lFBdDs91zgAVEmoYrQL0jNL/0E\nyWRiEXHNcLbvYMopRX7YMG6lARrl2XjgecNzODLj6jASGA5yzqaJ06kQc0bu\nY2LZUU1TefVgaOAW32CmwY+EzZYUQmi97ExkvJqV9LAyVt12NuRYunZdqLcN\nXWa8o43FTSm/Mdqn8e6hgdz99OPaIqwZ4kvDw/3oLNI7j5C/N7MdOKacXmhg\nNElHG0gJYcfEdKUlSQek+Gi5Ip/oGz7Gij5L1xxx8OaxBFak6uNPLFQby0Nj\nz1FiRWlCqmG3iFg1HyB5k2Md6yoHtiHW+S9espUyosMYL4uyh+vHKuC6g6gp\nkMBvV6zdJ7PZC4RFtwvqueUYB8RVs1m6jAeR6aiGIiEjZGRInPQKSFnOCMIc\nAS7X\r\n=PTyf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCntefQx9AzqFdR2HhbJYVxfN7XJ7MaY8aek/7gUXs1dgIgYkn447/2+gLllCcn6yboDD4kd4nUzHd9C7Xtnu+7bT8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181203230746_1543878615543_0.6063871324203509"},"_hasShrinkwrap":false},"1.1.0-master.20181204083556":{"name":"@atomist/automation-client","version":"1.1.0-master.20181204083556","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86d44f02e4631ec48e182d4ded8ec0ee1b083d46","_id":"@atomist/automation-client@1.1.0-master.20181204083556","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8l8IYpF7uJODQukpkXq/5uWiNy/OcLDretWXkrPUG4cDGlI7SGaWTgctxV3lAlu64tbowQkAr+DZ7XfoB8CgdQ==","shasum":"6f9e5378b2eec6faf146a4ec8c75919e43dca908","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181204083556.tgz","fileCount":596,"unpackedSize":4924038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBj0ACRA9TVsSAnZWagAABBMP/304EAWh0b6uPpsRbY8H\nwB1G6ehFHlCvcr4zVWwU9k1mk95FGWR5DNNhB46qAmuaFtWGGSuAAgfp0m+K\nPFXIVGzqx9GzGC8MANCu0V1CiEKMU6aKMYZsiZO07pEyJstoRBxjddKpB+Lj\nQOdHO0mAxi2mzTg/uloAQ9KIOcbGw7G45IMWTLEhcYclqXQxK4G04p6ggwx6\ngKrcbSit4lyotDIjvndjQWT2zspRd6j4CUF5x/ouOcsAwF4jK+TyAvGa3yv3\n7LG3K1YJMHKAJymQsgMse3ukIuY8i+DwOIz7e49mbOsm+Oi89N057kRvcvja\nXgLxU9rIF2w/ztSYtD1Dgun0un2mkcBPS9isP5d247jFFxiZx95K3EID7CqW\niWOBlixnutYv0JCmiF9+Z5Wcn41IsbgyVcFp0AoV2i6CadvXZ0qlMhbbK4iV\n4zKZR1pxEJY9YaHmpsnmY364pcups+uGaWEPDve65zA9WxNr0vO1LMZ0TU2V\nQ1U6+FfGe4C/dF9yuUHQcyF8xpQFPNTry/oLeDsu7J2RMwmpauPWSLj/EItI\nY8ZMmp08XvL4FI/s+kirwy6hN6XlEk0GDD4RJa1xQnx+bq+q8SXb+vhq6cqn\nmwK7zvtBeHq7BKUXaZXip74tPC9Ngp7HFzQgWaHcrnOxiW8AWGoEv6658RYt\nIGfC\r\n=31kb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7GACNjKXtqMgo9dVbzhNI9/h5XsJx9uyAdbbAcmfGGAiEAmGqaSfVWQzyEOAA0Pago9UBoKGAVlv/wD0J7VstTjbY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181204083556_1543912703284_0.6293675696049226"},"_hasShrinkwrap":false},"1.1.0-master.20181204113628":{"name":"@atomist/automation-client","version":"1.1.0-master.20181204113628","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86d44f02e4631ec48e182d4ded8ec0ee1b083d46","_id":"@atomist/automation-client@1.1.0-master.20181204113628","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ykI5Cl/gSJpP2L7A1b9O0APi79+ceSjvE1EQ1tFLwsD/XI0bqi7Iz4E4G/q/RNDGu8E96ivWJX8tWMOPIwKBKw==","shasum":"0c6ea5e2b55353848750d35cb8f2e47c61ac1b6c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181204113628.tgz","fileCount":596,"unpackedSize":4924038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBmd2CRA9TVsSAnZWagAA+xYP/07KELCBqGtdnPI5JqRO\nrcpLjNggwC5BBPVmOEp9470qrvgPIdLuh/rvmeL4GR4k6EA/+F5Ln5TrQpuZ\ndaHCy9aZTbl93uMJTx6HeVIYbhtlqnhpxUetNT28jdPaKU3q3AuvgJ59+SUf\n2zkk6yE9ilwKqppHvJ8XXmGTeUViNHCh9PIjlDTzm4l4wir1pkYFiB1kJJq+\nh6L4JNj3ihLShSfZQG7Bz1yYBJh9aIZWdoSf7aM5Vew3cwzba0PUJEC5XAlE\n21cV8j/rhax4ednFJJLgEMcGBL1DvELLhpyCCsFcgUoPZzkJ2bl7URfei0zE\nA30X6KRIKakmm/T2mzRxr+PRCuEI7I/8f/pHigb99BGtFJSkbqHAJ23DJeg4\nCg06+4vTyoFK5XUd2DyEjM8P0WGGdfZhWYOZqCUIuJpexX9l0KfKC11Mf1OU\nW6gUX9nzPKx5j6WVg5rpq/lNvfQIzVa+vM4a6kTMhKBddxsm+wvNGXZ7NQki\nPOtxE/NtPlM6nuIGF9ICuul6uliviPNKhxhasO553OTA9Z4XrMJ5NF1x2v3Z\nFnD0djwXod+uqU83qMtrN4STcgf+RfDHgOQEnsoQkzLEuxt9GL+5RQUsyuSw\nCb7GQMAWPs4EDfh1ChZgaj30uiHvMNgwpomuCH71zeFuWFr08jYEe5oES08k\nv7Nv\r\n=DTNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKp4wVeCFqy+qmDzJGDnvUjkOkATfjPoFsnE92jj87zAiAjm/yCLr99yC1dVfkTfnnh0fbuZhCL7r76rXbBhtiz3A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181204113628_1543923573683_0.24089685646487036"},"_hasShrinkwrap":false},"1.1.0-master.20181205110517":{"name":"@atomist/automation-client","version":"1.1.0-master.20181205110517","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e73ae6026c769da96a259d7f9f0915973f9208a9","_id":"@atomist/automation-client@1.1.0-master.20181205110517","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3n/cDJ+tegrvuh6gJjz5alagtSU73SRRdjj69H9U87fPWVXub4YmKQUkTI0/jc6EKD0+4PjG2vyAZL1hC1W8hg==","shasum":"faf02e0b15283137cf70501f901ad87f7a2a44d9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181205110517.tgz","fileCount":596,"unpackedSize":4924038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcB7GRCRA9TVsSAnZWagAA4XsP/iktRwU2hEWOk2kQmr84\n4HbxLg/DY0AEdxg4KjsZLGHEHkIaH3MdTrM/6hG9vXIMN6ZHZajE6sz/hStT\n4WFNv+88a73c/EfxaOnWu0dll8vsmiXJjALlpoPMsN4RepEvxXLd78cyjR5z\nLt5HnlsOuqwD9POk8z1HT1H73OJEhsdF9Mjqy/uTBl1YVl7nGP80JKMD11JA\n+/lTvYqeDBtEhtnnP65FPWRrE43vCXdVR16z0JKnivGMPU7BHKI7MPJRsrcZ\nUXESvrqLV+lZ7wMzC0WvJHiuLhY3hUrA/tdON+nrP1EgHc0P9pPG8u8RUi1K\ngxnvlwnPSYhfWP+IRduqdue7k9MTHmqHfPXesmmRheDIclzBzEX/8hjmCkw7\nZ6xcELv2c1Xdv24X6tIpR1WOxeqzCy3zW/tZIt1xzCFrjArmHWstdpbJpxsN\nc2gM30nPFX9oht0Gz9IXgPJNY9E8ZJjOCoepEFk1jn9iVlHPKhPEDIBJuYGK\nAzUU8liBV3qoamlsL3QoQ3/D6R08yn8XFardQHYa8PL0u1sLMszPpLfBsRyR\nKqnvU6iVB9wiGsa8Hb0P7R6h2SgORNWnr3NduMR4MDlluTVMpLj05MYhvMgx\nQwcwUGgb/9Bpo5jBsad2/8HLFM8nIJ14S3WHScgWxmmIWhKTs3cS/EeeG9Ex\nY8nh\r\n=Mps3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdTvCZg3pt25osQASJ5QD27qd0XwQg7Pe/50+Ott1pugIgHwjQ+HdoWnQPC0DFZguvVF78IKJfo4D7eybDAmyFqA0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181205110517_1544008080342_0.3875241689079354"},"_hasShrinkwrap":false},"1.1.0-graph-client-factory.20181206173236":{"name":"@atomist/automation-client","version":"1.1.0-graph-client-factory.20181206173236","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a1d649083c20059ea66b5c63aa72bbdea8c891eb","_id":"@atomist/automation-client@1.1.0-graph-client-factory.20181206173236","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-u2l/hoHM8mhVsRMWyWpHkc47w8BJN7wYyfG6Yv4P2/imexitc7N8XEKPy5EjTFS86KYgGXON5eq2bytZtOn6fQ==","shasum":"e9b142b08861a99482bfb0fb56834d9e94304f16","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-graph-client-factory.20181206173236.tgz","fileCount":599,"unpackedSize":4927118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCV3MCRA9TVsSAnZWagAAL+sP/insCUMNho0EZywojaSo\nXl4lFO/0v5guyY8xrCyD5R1qsFYLPdVVzw0rMaHCwu1M26lfMbM+RfyRXs/r\n6EzeQUmX9gMvrCJdJue3+AmdT8P4hp/Y1+QKBCz0lOe+p6Oz53aGIpo13Ib7\nKSzwhERiTvJM8BBVpGiDVd2EbqqGdjvhKXqTOdr3vdyGl1GFAPPa/JwsC98h\nxcJZpX3ld2U+CzQNgVufF0qMQ/Eqsm/Q0MLx+vULBITYrceDbPo3mULn75Xp\nCEl8fcxURoEmz7Mog2KJhhXfqtASMg8f/gPbQKPW9YTP4tnnoCcWP9bpS342\neddzjg2M75NEyXsE9CsFEWlyi34q3Y9jTCMxtwkXf11jmGkP69TArs2KhpX1\nZ3uPVERhClm2Zvp+i+66NTHX6f+acQJI4ExF94x5a0suPiaQIyMI/VAa0yqd\nXDiaE3uqSPpTVMeCH40s8zA5GmCrpSguTavyLKjww9HGwDEXYf69gRnj+Auw\n9PQLH276f0BJ8tBqihwZzGQ9GWebA+KovaJhlxwmfFEWGQkrDDZpEsO9P1p0\naQDa4SUIcfVKhXCl/01Pstz/k2uHJVTWOtqriQ1IcprkyPiK/bUQvy7pUEAL\nzsVkxhsxpYOSnYKK9bK6mpPtAQEVaDpNF13iTEfcz4YAe4Cjf75DuV5WfBlJ\n1nC7\r\n=oA1b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXmI0tHUs6XesCW0orhhpmkmlsejlP1MqwJHz1c+6ncgIhALk0knmQwAjXgq41fgSU3P85rCgymUQtjaX5mD4ajpKb"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-graph-client-factory.20181206173236_1544117707964_0.24342470459100962"},"_hasShrinkwrap":false},"1.1.0-graph-client-factory.20181206201017":{"name":"@atomist/automation-client","version":"1.1.0-graph-client-factory.20181206201017","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"60516a2b6ff7ef8b2860157e6f1db0d2e1d564a7","_id":"@atomist/automation-client@1.1.0-graph-client-factory.20181206201017","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-etMsyQUUKgG6p29uSW3m0ZiECaAcAHXyxDyzRMto06/W0tq3Uy6jjvqoGUKnN3/j4YhfZK+pYYMhwIiLMIv47g==","shasum":"a1276ae9f6bd572e937b82ec0165e32180ec18fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-graph-client-factory.20181206201017.tgz","fileCount":599,"unpackedSize":4926660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCYLPCRA9TVsSAnZWagAA7tYQAJmNAne58nNDCYLMCb0M\n4HNty6EnVXaNaKFN1MYtYoViwmI64SgUTBbHYIWHXlDVCcdJqLS9hck6f2Dj\nApCGIWXbtjoVBUFsNCaHX4jMJsemuHjKCvbUYyG8uzysNZjGD9he7Q9dNtYm\nfZBvwaQVd7dMCptGFYmNCRMEajh1MCN8yQXFyzxzybz1XHDJHSKbX+hY0lKm\nW+8ozfzIQsnRHW95TlHf7w+a8+FC9imprxsxg60ePMTi+snZrMzNhslgHNoc\norqm02Ja3gUO2WYnOv+9Tei/TNNjo+VhTeCpkySTl+5ZwF3Mz7yNLdWql4bz\n6kyuOF8y386oZ3LcMlrNASfCIK58PRdQmWMhsaazGt7XoX24CZW156fmCQmS\nDxvo0oqh4LLD2RFmb9EMyYs9hxH5z0HG4qo1OIQ3fpHq2OVNqSrd5cWSsEzh\nVVQrutU7WA+4dtxoIhtoLBflBzLTlFxJXyPureVzuhndoiZG05IbrKlBcaJc\nuihQXTd1PQcG8D2gj2/h22bP5r1XlnYYHtJJSEQqg1BBsyBsqpJ2tBgYh/BC\nFdO9lcspMuwvVyx3sSDSuMmCvm/5IeGzuUOZwLwWXlkWIuBmu8AfWo3hbOEy\nwx5AZlq+YFXOF7sm2/2vGsqoeIAaV0XvWUsQUijaiS2O214C6Nmosw4bRIDA\neqLZ\r\n=ZYa2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA0HmXwi1AXcMPWr8owfjbW3PGD5DhgLELjQkn7LB/6jAiEAszPVRYhD1baf7IzvVh+Zv4upIuAQc9sWPhEBQzetVwM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-graph-client-factory.20181206201017_1544127182971_0.7259566357405036"},"_hasShrinkwrap":false},"1.1.0-graph-client-factory.20181207082237":{"name":"@atomist/automation-client","version":"1.1.0-graph-client-factory.20181207082237","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9e8d005d21124725b2191d117bbf2bf0f25e3696","_id":"@atomist/automation-client@1.1.0-graph-client-factory.20181207082237","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VGHGdimX6dcgvG0XVi/SlRtFdkd6Ky2cvuN7AIqOnmtc0gFTiYFuoFXydrC2wzQKwLoybTBQtQt6yAjz53z2PQ==","shasum":"bb5e7c4b0a88907b4918648d2d8ed544f15fecef","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-graph-client-factory.20181207082237.tgz","fileCount":599,"unpackedSize":4926301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCi5tCRA9TVsSAnZWagAA3eIP/Apc+cUfEylFAeGgmqFV\n/4fZ5JjePPnPIqhPAlwrYW1cYL+QW0aYhtGNArSCbUqfKKiyVUZfjN5QBG4X\nwOmB7mdCOGOEiR3f8g/G9UaMoD0ctocwpGtpagFEa/BIXtqk+pI0XLSMTn2Z\nLHMIZkcA3YkUr7/rcIliDLBbP9nJwXxHRlYZ5njCxTcAIHSFes10/cI4tWpE\nSqacjzWW47cPXSBcbz5+4OV8MhiEgPp5jGF0E3Rt27atDrHjjfcQCWf57PhX\nqTgOqh9zDcSi7eGlLqDjpxI1QSyNRBgx5nOMEiIp3fPwSaduBYDoTTu7Nz9f\n+TcWXi4KG0Tag6XmhBoMWwowCIT/PTb9JiZzZVG6e5yEryo25MmWBIuPZLLj\nLIALnQ1ehSTcjXR1O1+ju7Oorx8HhIim1WdeNowXhUFUof/fHr359BwMyaCZ\nnJzzjTpDu9Lkc6Br5DfnAODywu60eBXRDxqZR8eZt4PVkq0+AUMXt0dCKaaO\n9EvA++GvjsjR8pXKqA+4m0uikzsVBg4ebcX4vaAbHRTYHb9RsVr2UU5MSlhJ\nUCSuSKcpMZttbk3Ji5Hu8IbBAvN1Au5vUTUFx7fhiFPmB9dHkMClPk3KdHTO\nqWwhMlqOQmyCsifrXT+YDgg9p5R2E03yHrAvajOhxoDhEhxHxH2nRZ4yULUE\n8FJp\r\n=vqeg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgVtN9mes6joLJ7TqwMycPSrBWmQWyI2ZtzmElRQuXMAiEAjIDNBud0tWyGZ1K/LUavBcEFq63YCzPGBjXWmLhqX20="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-graph-client-factory.20181207082237_1544171116759_0.8414205043042879"},"_hasShrinkwrap":false},"1.1.0-editModes-cleanup.20181207090921":{"name":"@atomist/automation-client","version":"1.1.0-editModes-cleanup.20181207090921","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6f90ecc96a31e48fc9d5391424a770f33ee61c15","_id":"@atomist/automation-client@1.1.0-editModes-cleanup.20181207090921","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JHG6fZAxIAW4sCacXd6lzWAhYaX4+QS19KealBkERClB4KA+5E7QL94XsOWW4w3b34Tnh0He/bUREUFpF5w1ig==","shasum":"9b24fde379108aa4c2c1da5ddbf844aa63cd53be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-editModes-cleanup.20181207090921.tgz","fileCount":596,"unpackedSize":4925419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCjlmCRA9TVsSAnZWagAA91UP/i0izjcACzEPKVQ45iS2\neT2+HM6e6bNfAWF+NDAHyQnFz+guDy9iWsxn0C9vkh6SnuDpNV79j2wWaYfG\nJluDw2yQ4N15wKVw+1E5I47AL1TQMUCjnO8KtQzZBtk9vge8ugmPKBgfc0IG\njOoU3tIUatCfwGcQo1dzqSwGst2315pLzlRUTM9Gew1oNZHJvZnCFGUCm0NZ\nA07QFFefpUvhp9pEAA8WButOUbu0E8wWjvcRSWebEmEILDaBmU4+Qj07fPfe\nHrz20rd8LXsWBNlTbf9Wf3zpXEJWOPXMd3ZkpB2mCkXwam+gCELrxwu6tbHh\n8QeRrEpkADWu2oiEW0TkLxffJEFtKVlEt9jcXRYakkj6rlmhd3u+GmjjMz9Z\nvbPHdA+KV7xKdpl6FQb9c3F+0PVfxDpO3g2FRbIrAJyXvdfB5Afr8n36PO+O\nuCqdfdZ8e+gcgAhdub8xlJxIPFCchy0ysZ1VwT3mZIsxP/8WlLQJofxsA1ap\nRwm5fbauzReZWYK6UIPUdgThEgDA40zISMFeGuPLNggxDMw0Q+r7nuY+Ut5T\n8ZdvJHPmizIWYMEdUgNUXg4F04vZcLVXIgUkajNz0/WS81YR0Jnc2L6kgYp5\nEw2FppqUyFykw31VQVohcIDxv1XpOI80xmRxak8UcryfJaHl5OkCfrakarBf\ntv1P\r\n=vm6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDA5X+dYu16ZQrjSpx5d/pk4eN5vdL0vBf34QRitjjWGAiBbF1tXx79G8ipKOpLHs/FER5VBfhrhU4y5CvOC0dDbvQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-editModes-cleanup.20181207090921_1544173925925_0.4758581435573701"},"_hasShrinkwrap":false},"1.1.0-edit-all-chunks.20181207113840":{"name":"@atomist/automation-client","version":"1.1.0-edit-all-chunks.20181207113840","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e1770382aec54c191490f9a45268666bdb25a4e6","_id":"@atomist/automation-client@1.1.0-edit-all-chunks.20181207113840","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZQKAiPImQkyVj7Qz9h4edPai7sH4uS/BqlKNN3TxFAe2IVzBxuqOZ7EmpD3KaMylt7dm9GIEL/PYHWsd8V2Gjw==","shasum":"0361eb47afda05d02464ce6d2946d9b548b963e1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-edit-all-chunks.20181207113840.tgz","fileCount":596,"unpackedSize":4925433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcClxXCRA9TVsSAnZWagAAuCkQAInuw3RXbGevD2VbLy+M\n2Cw5+NVOgWMFO0VhFt1Q03J26u104mmqsbcO7NtxIH2yled9zN1fLU2+D5fK\nDyh+3uL5uHsyDW2lzRzdVS6T5mqte5oddy/34ZHA7u4JBRTeDDuZaitKKzVn\ndb93jrajzpHoVrM/LDvD7sA5dUqvsFVgW+DqFNNHvtEqU2eEEV7MoFWh8jJ2\n3cFji2WKxP5P5UfRYzKvaTofQ0cGIN3tfShBA28iRUbbZssSj1cQz6pG3to3\nqQnJ7fJC3DLIptFNuXnOU1p9F++qxruD4FKhqcdWsaZw/FgGfEB8NKqdAIz+\nOtwUc7aWHg82zojQZ4HPuA0XiK05IQBBTwKw9GhAvc9izN1mnFSlu9pelQpc\n90ZiLUgMYIDaiAMvFBXFEV2YQH3YBcTDGQWR1RJ3kK+IIx9s/UrXNDy6MYYF\nWpABm5fQrENQvAocZZCzLPii+kDNv4MHriRyxMmEtRpYyOn6/r7u82ixGE4I\nGYyEAaPLi73/FDJt4DHoqkTi7UnG7akiDFRS0/LAUFUe/xwMiznX/uKmAEK2\nlGAJjd7BAkMvmMEROk/G+sb+RCaDPHwebRQps0gLGsT9k3p4ALP98ZwhVZMi\nX0RfHN4GuqvIcV4JSYJmjHwBCLuDe/9ahxJY9D/Mz1fWWvSmDgfLBMGcOA3w\nmfk/\r\n=1ul6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwWEOLefnWGAfVGlkXkbtv5usG66crVzNVQxDsXuyTcAIgFtoA5Lex7RDoroU6cOJPPdqssF+1mUla2N8wKCEJBIw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-edit-all-chunks.20181207113840_1544182871301_0.098398057720126"},"_hasShrinkwrap":false},"1.1.0-master.20181207123814":{"name":"@atomist/automation-client","version":"1.1.0-master.20181207123814","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d84b1b4444c94be7068fce7787d5ea41d526660e","_id":"@atomist/automation-client@1.1.0-master.20181207123814","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OTlU4GDLDMA6AHN03feeYjbmmN2pWFbzI6+QFVa6NAK6+2O/opgJMX2yUmcTRUjrWQ4LlgPY46JnTPm8/mel9w==","shasum":"2110a478994929e0d271b8334ab9cd7a86da9526","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181207123814.tgz","fileCount":599,"unpackedSize":4929479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCmpjCRA9TVsSAnZWagAAsI8QAKSScbWdLO7sAiJzblel\nmAExF53ZHtRZDKvWei8SbXKBFMuTT0MN7P/btJT78Iq0RS+WepG9tVT9kCn7\n1rtGVUH1DCS+J/oXOPwPzw3QCqp+kA503+QOAIMan+NNMhEnLY4v/ypZAMBG\nDvms4ZiGZNZOL/0ATG/tBka9LaEdNX5xcHgVMTvjs28hxrb0BTHHL9RNjUiV\nkIdMR2Lwi5OKaKH85wyykSx61dRhsMH2g6PAGgi10mDN6yEZGta8iYSXn5hv\n5vHt6nAiZqCG7Fu8Enc/0yDgT5+Uq/LOWxaGx4zoSjghIsxwjfeIDN+b2bPo\nUZD8zWdp0ZekrXX2qTK3LGutoq5bSmhEJkjcsQS0S1paEN1x2Vd5/3/R81yZ\nuoDhmpVSqcrMhFOGjBq4TRyn77R5Y1EAX71xb5lz8XJU4f40jzyQM792Xf4G\n9iZCxrW9+5I3ZoGhUZ/KMkcCpxCYPB8RXMzczZurMs2sp76W0bQDrZZiXrAj\noRIV36rXXAHZzlDdooLt5u5D8CVq47fP4XuLFmuEuKuZecvkCSQmSmfM+jmJ\ncccpRHqnQ+RFp0iQnoXnp76E7R9VrLlq6p5JZd6LnP0+Vla7w+xi8eXVrjiF\nf1U5gyirTiQ/v2EbL10gZ0BqlQdQS0X9wuDhGsiuIlQYKriu8LUmkhrXuBgy\nSWi+\r\n=dPJW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJdBBFGjmntXBNNRBmIJy8C723VG6wxCY9yd/ak3gf/AiEAhg0U97kIbuAuCMaeldz1zO1JNN1EuixN6tY+Ov9ToOY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181207123814_1544186466612_0.5123413774857486"},"_hasShrinkwrap":false},"1.1.0-master.20181207123931":{"name":"@atomist/automation-client","version":"1.1.0-master.20181207123931","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d84b1b4444c94be7068fce7787d5ea41d526660e","_id":"@atomist/automation-client@1.1.0-master.20181207123931","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9TPQge1qaqBpLa/vvThGvfZH6LSel749nI7+TFoTSOtY3xS9ew+i4Vg7vmd5lUf9Mm4SwHusyqa05ii41Jc5TQ==","shasum":"8e686acaa5a2faa983fe77b74ece8ccb31c34309","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181207123931.tgz","fileCount":599,"unpackedSize":4929479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCmq2CRA9TVsSAnZWagAADbsP/jA7gZlbZKn+d/X8scq0\ntZdExKOLWXKyx0EZc0wxO0NwH3S6ntHBOEhvsPYunMz5zNAQxA9Af3meIUnm\nLwit/qwNb+AG29TmEWdgchiApX8KA4Q9Po972e7GgPqjaLsHqrxr8EoqclD8\nH+atwrkTO/tnCO1iuXmEYV0EUnL2eP3xE7c8fz2pKyeOIdWX1pEi4iLBFoEB\nB65wzwfmYtZWA4uyu971VE85ja40Tvpn+LxNEVpj6iovjLd1lc7990tqJEhQ\nKtaqoCVkoASVl69KLk8O7Kn7w0nTRuu04rP9QuxkIldm66RJhzDmpJFDBtKQ\nc0oJtheMNZReOLmBBRdMhP7XJuq8gzxZP2hiaPTWDGj8SELUgWrtDEJjRlaF\no+Clq4NfTLiGdw4yumXO6bV2yPjXOfzicsSpyGjLmy08QxpYgk/XrJdWIEaJ\nly/URUfVCN/vnd0SweCj6QSjv6ToP6V/HJEttvkFQoJ0Q0STRhfl3Jw+zDRH\nBq6NjQnNIKweveeyxwW/4kKkJvcnadc+/OvJ8B7qXEZwyB1fJuhdEHsxiz69\nNXOkldhha9Uqm3KBjMyj29J6biW+0SofECFwAK/onK34yhuCYgLw68QPI8u9\nv/ZuyHuEXE2T8yrGRmrBT+v/RFqYDCqb2I+4zdPCoGL7FB/5j+hKiCvo4r2k\nCAen\r\n=4UFd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgo7QiEOLiOw0++f+7WO6NIF9ML04i7B0uv+oQJPn24gIhAOorZBQep4t1kk4gZvD0S1DBjD+xTcwjVN6Uh1zqse6g"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181207123931_1544186549767_0.5494970057458013"},"_hasShrinkwrap":false},"1.1.0-master.20181207124108":{"name":"@atomist/automation-client","version":"1.1.0-master.20181207124108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d84b1b4444c94be7068fce7787d5ea41d526660e","_id":"@atomist/automation-client@1.1.0-master.20181207124108","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Vv7hyK0rFxyrA08i+QwExPEisR1QQHU82fxOEc8GEdixmxh5J26sT0qzPUCsGscVTTKQhaY5n76dhWpf3Lg8zQ==","shasum":"7f4d4f9a5ed642208e42558f029d5465fba14adf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181207124108.tgz","fileCount":599,"unpackedSize":4929479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCmsrCRA9TVsSAnZWagAA4HEP/R/BPlEftCYO2Xt8fRGu\niLum8th/WmdL/Dzvs8lUiozcaxsjY88QYEG/RIj/XHtK88haVwhj4XkZgV0Q\njz0PXmRtqoMY2xHLxavM4RJ+llz/Woz9DWhhJcXKFAiaIfeNDqluAqEgW4ls\nLRH3qlHkeXcJoivrv1vrs+FraOomHAAdqCy/8gseVaQA0uuPQlsnCpM8Z/HC\nD9qpJ1D2D8YGghct393wiuQ9iV1Bkfa3rqRRAnyqIu94xml6sPHlXbvId5kJ\nb+hw4jIbZRolpemCnp5xvw/s8kv51a0w1TZZuZYVGEBzYLGhIhbIUq+dAy37\nWUEn+5o+Yk+iibPgJylSbQ7OjBQ8Czy3kx4lstXbCnnqGdMifXmzi7wwzHNi\nRQx4kQBbMC5xytqT92t5t3Nb35biTFhrhR7GMTMoO0IXPuLb6ow6sS1IWG41\nwdiRDONP3tOtT7O+g/VP1lXvON8Z+K7lCk4XMX5ekOFoHxrD9WAVHlpBk4Jd\n9N+zaGHT/plZj91mx6f9vdb4WgxKJqHICufkO0AEwht0DC+DLBd0wKA8U1lG\nMeAf2GvcZNh174cTR2lMFDlimSMt8PybV/uxe0e/siHuFON00tWIUNhBlb14\nEFfvumwaEsDuS8s+oe6/ZPt8SWK6Rj9rUn5kZn3qPAf3dYv0V9/Ju8UxRAvo\ndeWT\r\n=/DnY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2P6EJct7U/7F7U2QccIR03dmkHdNt6BHhc+gMJRXr8AiBUXa+ZaWsaI/58q3iHUD8p5/uPwpODChQYojBqpYKUkA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181207124108_1544186666735_0.17549261625792667"},"_hasShrinkwrap":false},"1.1.0-promise-pool.20181207192108":{"name":"@atomist/automation-client","version":"1.1.0-promise-pool.20181207192108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"280417d3452071547e27cc7adafa6c5b745a767c","_id":"@atomist/automation-client@1.1.0-promise-pool.20181207192108","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+Acfv6gvJajfyUPU9boq30jRfECsmPqKEs6ZTdx99iSrIOEEuvDf4NaO3StATSqxOjwDEpjBnn0inLmguDLTww==","shasum":"42d0a922dcc1d43eaa87f5d1a92bfecc190f03a4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-promise-pool.20181207192108.tgz","fileCount":602,"unpackedSize":4931953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCsjXCRA9TVsSAnZWagAAef8P/361NtTBNUXomsCHxPbR\n75wYYKQ9sglOGODJXUxBYbVAisk7nMjLo2DveEBE6DKHWIHehtS1TaaK52+a\nhhRz3Eu/u75XIWUPuAOeXdvK/RXMFEMfZKa8Ro2OHBtVWBtCrZHuoctZXC86\nZThwwGyXM2DbcFv24f9Fr4jI054mmDe2qjBGmjI0VIDnFdvXtrZlYpDkdMen\nO4sz5js7UPlqT1g2AGGWZnwGacO51iKDZdxB8UdaqwVw4qlj7oMEVvrViUTk\npkIZVeQ4CedZIgc9Teo2+z5T7q0uSXpaxnBwTDD54MBOUJhcT8D5dH5stxxB\nDIMcWVJrNeyc/ZIPeHnwFRSU2HmeDsusghRPBJe5iOtICXmlQNegn4b+l3Zr\ncBL8uWWOsFimcORYFKzEwCXNFmHmMjJ6PPn9W/cshsdLdOJcaRp7mcAE50h4\nUk/WSaj1xfHCPg7XK02ENoioCerFS63kIxIKW+KV94ccEcYdOpzGuS94KbfV\nwOoiP7LcwaSHVOjOr1lgTwZ/bSh8zmkFh1M8C1+CnHtF3KsDtlGp4+TGkzQe\n//0auRbBQTe0MEidrNs8UP/t/9MeYD/60oFK7hecm4ySSV0k24Qfn8uGcAX/\nA0sA9ttLM82i66UUhvY3/VK3/hsTDLkPVsFmNymZ80Wy0B7cLVhSHpEedyn7\nKNI3\r\n=pS3o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRM96TovWVd/UrtxCgvyiuKyjfO20DtZVFoCCvwTAJyQIhAOWeS1u8lfvm2RnkHFK4k4spcV1oxt0CTOxoPFY7YhZ7"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-promise-pool.20181207192108_1544210646789_0.4503508291902154"},"_hasShrinkwrap":false},"1.1.0-promise-pool.20181207194051":{"name":"@atomist/automation-client","version":"1.1.0-promise-pool.20181207194051","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7056d53a3e0698344a38803378952b38ea10a929","_id":"@atomist/automation-client@1.1.0-promise-pool.20181207194051","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Jrhy3Ut6RIdTZBho/Kbz5jxvwdF/TtbaOqT5MBepKiEVlxNHhYT0H9cOmu3VkuVNIvlcmHRQyWWF9nCfP5lNLA==","shasum":"763a53e0ad0a44f302539df25d30c014bc9920a0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-promise-pool.20181207194051.tgz","fileCount":602,"unpackedSize":4932689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCs1uCRA9TVsSAnZWagAACn0QAJmI8m6QcTNaDes5jDHH\nutI1sCvwwtSnOdCQGkIawLbo7GXuWOXfrKEv1LbMlrEJqqcuMBe5zo4qIQ8U\npjevug7mXhX8SZLzdvS2DjmK9V8AvXteoWcG/dNWcwIJzzMil9REUGBtXj4M\niUvn1X0miO7RkAThG1DjyvJqpX9stYAfMq7Ghxb2LYnNTBFhWwlxfY5yvWzt\nmiF0WGUPTpvooyCskI14bd1UTP43Tept6Yl9ZGdt0tVB8wnn5l7KonlyEjeC\nAeVsyMZsuMVy+QCU2xK+Gtni74JLnkjvzmU6+pthD/QZhbOTXlNe6kVlNnTp\nyb83TMfDk2sqrruCDOWZkQezj494sCEqN9G9Zivty/+k8MQhvuu50FvOW1Sq\ngmFfnQE2+kH2xeQWW0dMr40gh8rcyRBTkdVuNnxcyoy3hDt5Jui2UNaz3E4Y\nKfELj8erHQ25QbNpQcC1yJbrJA6tBIG7PMXm8lT4EEI4UiKQEhU9gDSoW82k\nytMusuTe4umeRo8Xfzdnh71f4A575cECgByeCjcw3GWXdA0ad5nBStdBOuY2\n/2IxVpmPlSlF/9tQSG3Aa6LZL2Kymd0YbZcAe56HNEqJo10mN6K5oKElFrB7\npktqNJ53stZ7dXxVtUnF1SLuI24FSmoWaEoyavA277QNqmAMD8reL3aIFzZ7\na5Dr\r\n=6sjU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFqjtcFXXh8QOx5KjH/W/WRTTY8689jP36xE34996+5AiEA5bmTTuPJUQ1IDGtZ+9jb7zOQ9bp55HD3uG6laE6+8oI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-promise-pool.20181207194051_1544211822200_0.18796653534925012"},"_hasShrinkwrap":false},"1.1.0-promise-pool.20181207195837":{"name":"@atomist/automation-client","version":"1.1.0-promise-pool.20181207195837","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"18eba5e484c8e51dc3de4ff021d8634c89881b35","_id":"@atomist/automation-client@1.1.0-promise-pool.20181207195837","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-8Iyh1IhHrtv3Eo9q8b5OaVjKwP7AbOTUgxpIBKj/3Nz+GHCxyi6fK4nPRKI0ITHxeh16jr44jCokyMGmBhrRfQ==","shasum":"ed24c5ebc3f6a949e7eb29e4c56d61e35468b00b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-promise-pool.20181207195837.tgz","fileCount":602,"unpackedSize":4932805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCtGXCRA9TVsSAnZWagAAOKsP+gO5b53M8JUauuFymhV1\nLkpNndcgAuY3vRBC5wMzqXdr8trdtitbhCsBO2G+y/WxEU+J82WHXGqucpIw\nnbJIcpkVex7mwekTQv+pO41a1wl+RPRWpIzgha75EQjmfMu61WwdI2/onDRV\ndVe1s7UyPBMbhErfCy4q0TWE3a84QmsxOsvUxcgtRoiD1WYDeC7x+QZoNp1r\nt5zVD3xkDZfTslfRuYVlCDwF4J03bB2fjOxYKeAcji+OQJP6Pr42/eP/aWDR\nzZR+FGvcXWOOm9d9qCmlRKASKNryxdLkr0JAZD3VQ7GMrM0G/bg7DPJRa7Ge\nfpFNg+kb4c9fd+iOGwh16WyMgweazusY144qyiGcax3VqQDUpQ1IP6xeCgEF\nUMB6zdVf1sAfZSNdz0AWt9gFDtL2Os3C0wH3H4G56eUyzfuz5YinfWmu/VVL\na6U3zVXuBLhRdZZiqINcwzODTN8zUfN/sg10z2Tk8LmIhEiVA8RFduPbmuRr\nMG6SGDAxkpcg7y+quJ2XxzlMxv/ecM0AHxqn/CuAYjg3KMS3+cjcnotq4xM7\nBKW8Pfp/8F9KPagBzSEx7WRly7gjwTEXFpd48tsoAVoInza+170X2jwPzLwK\n6h8A+8yl5pRdurx6oWStsLe12xCBGP9A9XsLuii7xDu59UNZb6vJZ7l0+i+y\n5942\r\n=xYpk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBMfKLDU2NA5mZtr4TA2nSswIWWkcr3tJvU/bbZHekzAIhANiieg5JugkmRP7SuhVXy92FrTRUfl5xZmo7Q3QtylpQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-promise-pool.20181207195837_1544212887027_0.3981732579306283"},"_hasShrinkwrap":false},"1.1.0-promise-pool.20181208174316":{"name":"@atomist/automation-client","version":"1.1.0-promise-pool.20181208174316","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a0cb4d285967a407cefc2542e11390feaea12a05","_id":"@atomist/automation-client@1.1.0-promise-pool.20181208174316","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-i1T9EHm6soVOBrUkRSLJ+qOijGVM4SJ5pu6huGpC/Ym0/CZ4N0B+r/WC6vfsbVQiOGG3BkSjpyzSa7K7eFi4Hg==","shasum":"2c6622bf40b79d370bd5f7cd63010ba6f0b9e76a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-promise-pool.20181208174316.tgz","fileCount":602,"unpackedSize":4932532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDANjCRA9TVsSAnZWagAAQlYP/jKBs/KHBjSDWXWkB48C\nB8nK7UrUj9/yYRYrEFhaA9ArGf+nfqX/kVpF/AyN4qNSAwmBiu6cLgRFquI7\nCqzhG9HxRlEgsDXzldF2atd1tA76cXumOT4YNw4KGyCHT4ZkehtVHaloj/R3\nq9+kvArDPIPMqrVmwAKVLxmPejfBwZy0UhdfPal4NXX3lfVREOmzWkbeHDo6\nfIAPmaSgw5bipG0Fkyhy6bMtpXgqkqsJl3kpL4CLZAkZvqG5Nz/I8JJacIKG\ndvc3aq4FQzh2EG6Bm9TuBuL3jTZj+EB8unNNMZl3GDGZAJCIZZK92CA1Tu3Y\n0fQ7d8BeEtOEkcfzdPEgmD4Whwuwz+QfVbcnJ5Ujp5S8Wj6bKapyAdpzwLs4\nUY1BkVAy58UScCx/1n/SrCPIrecHitzyyEAK5g2OzBfj7RLDsavlj1eOowXU\nUk53Dp8FJDl0YfoR2iqGOuoTwDFbMfx9Yi/Nh8WpPLvU/94D0500hK/7ZMdT\nkhIa2W0U6aWWBSerSbvzU5lvyaKKx8h+eaixHouOLqsJWAfGhcZsv4f/WvfP\nHvPGB/DiVL77weH3YHhgQA8zrlkyZ44odJWA2AwlOZzTvgpRanAMz6XJ8f66\n2QQ/QHOjgV19gEN081M6aSnUD5hRXJNm1Sd+6a5EqDTRGOoKVlRBCHviFizG\nvtGw\r\n=qtHP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGSf0BMbdSpkrlS1GdbgzN5wgmIGopoLzsmdflizOHr9AiBUCj1vNyTMn6xDagfyvRVKYQeCqor1i7n7kQN6C9AmrQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-promise-pool.20181208174316_1544291170766_0.2132655381228974"},"_hasShrinkwrap":false},"1.1.0-master.20181208203712":{"name":"@atomist/automation-client","version":"1.1.0-master.20181208203712","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2ef15e843027c79c39748af4be60cd1ca7bbc1f1","_id":"@atomist/automation-client@1.1.0-master.20181208203712","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/Xy5YLZj3IGzXZup4SSGxCFWYGvB6MvXijJ07BVD80iAYx7s6cerGoARmrLZcm327r9UhZyhqOsXzFrf0vvtrQ==","shasum":"209b079f86fb10410adaf22c809f929d84635749","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181208203712.tgz","fileCount":599,"unpackedSize":4931324,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDCxMCRA9TVsSAnZWagAAILAP/3+6ztNDr0OdFqYXl5gE\npkSgDy++pyNS+3Uun1UpSXwmHypFREIFeUE7lKKyl08/W154pABRiXITWmRr\no7v14k9vovdmW8dZCRzm1lnQzJ+6SlxI9hxU8LGVMiveti7GjaUy1EN2pvJK\n5EVI8+MXErtn6yBqzeGzrAImJKw2nJArgGinva03620ewnqK29m+yXx1hO6m\nPiEc1b1mKq+x4avw2VITlEURbHbwT+FHToFZfrMkcevIugQfBUHYsnGCjvcK\nxNogAMNsZaiWy4CokWL/dhxGQynUK37Fz2FAZ0n1LOokBvG5+qxAUHIV4u1A\nnWIueejeBTowAEBZ3nAggA+rfM2qsMod8TcQNPmYqTvq1eEm4pvYN81VAUGx\nJOraAkXOAbEvr/Ap/01ZX74vONTMYs7b14g8CmJc7ZgO6b+2PJVJsZ6KxUPu\nNNwNNdJjLRcOp+2sbJcYCsgkInMAOxMJKDBNp8h9pUWtOS1ntdOt+Zj8VJBF\n9kD47bJm3J7OTGGlaR4YqIwSIamtC5KfwBvKQ4efP+2PdTNjdy2ml3j7yMiZ\npr5AR04Sb0yNKo+c16enAVgZAC/+sFR5IaVcJXeL5AJnrDLKfFuHXA/cvOpY\nYcxmhyWZvFHUZ820KgkMdsJrUnI/6Bxp8ajO0Y364u/vvkzi12+utqa/A+IO\nin2D\r\n=FQpd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxSUtvNn8cgmEBKn/YRytdrbZj/58uRNqaPpMv0FkaFAIgTDsRzcSBIvOsiFkKupM7/EKMsuYIPBbCBv5M+PSytuQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181208203712_1544301643272_0.18569393184251193"},"_hasShrinkwrap":false},"1.1.0-master.20181208204657":{"name":"@atomist/automation-client","version":"1.1.0-master.20181208204657","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16cdafe30d2ffd6b6c961cb71eb390e2088a9500","_id":"@atomist/automation-client@1.1.0-master.20181208204657","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qV/YjNI/5hjdF9LTpQzTWUp93FPPURFsi7UFyD8uIlMv0rl3mRQYdke/f9CrMZXSLOwl2b7B9se/yL5G4PlPAw==","shasum":"d1cb037b1377c6558dcfd8dbf7f23c09a95fcaf0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181208204657.tgz","fileCount":602,"unpackedSize":4935161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDC56CRA9TVsSAnZWagAAytsP/iSsbN14d7C4rV9ggRxU\nSwF+7ciKTaVSiqmKDSYEwQiOLME4CT08ueU+9lVXCrbaNvAVT42SY72n752w\nwxDXWjBETjXuGkGmQ+R5HKZorB/Wmqw7+r66ZNY3lDEUOKxCJPNTdvMPVW5N\nhTG0ALKKUnRQHGo8iHRZ8lH/rQ0tJJ857oOgW585yaStnjOBfs7M6gd8H36H\nA+8a0EI3+ETV9IOCrB1A4hW8s0Qv1iHEiSmdOHdGr3vW90JQsiUFTkXOoMPh\n/jnWX2ESa4Jk7m0EkkoVXvSyPlwo6TsEC7A8+bY63IPe6h0VzEzlrjoBoBi/\ncN/gTLQ2M35g+azy+sEbCOt04L1pwWv4Y8udkwYqPgSqvH1hgO4m9PLfCikF\nfVIKq/d+CBCKlttqm4t8d67n6AqeyeQkmOqBJgNlwZZyzd5CXvV1wFcgkOJF\nyuUaXcaxpGhxxIL5dv8+2PNYzFlC6tU8phCOIvKrnb0/x5cLTIi8m4S2NE2d\n8HH6tb8P/shL3Aa7jB6xGeYMlVBsYDpPXXQ3f0kYP0AsTHa+f0O5It6ZUmqU\nuDtOBi8aRM1DF6w2jkz6YV16OBr9y5pjtU0KzWUoYtEWQYktzVeWfEkQYDTG\nf1p9I682GbGVB/Cj++xyBV/Xw2PsePeWUMvkIsBbor2fgIA3n7l0buXL0zl/\nFwbF\r\n=S6lX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8AzXaBis5jAUb9h8ZP4ZMjxFHkCxrGxcdiNqu5WseJAiEAoI1Ux7F5Gu9Dvg4YlTCR9MGZMSmouHBwmvXW3Rp2t7w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181208204657_1544302201231_0.18834467178617964"},"_hasShrinkwrap":false},"1.1.0-master.20181208204659":{"name":"@atomist/automation-client","version":"1.1.0-master.20181208204659","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16cdafe30d2ffd6b6c961cb71eb390e2088a9500","_id":"@atomist/automation-client@1.1.0-master.20181208204659","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-c9Y/89EBZqqlE6e6gk9ECPyjAptuouig4wcbDHnfR2tYdwgMIBTV58KkXWBRFZ12e742ZDKhe4t2odTD0jbQZg==","shasum":"4ad85976e08756a7bc016d2212da0f712dc08bc7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181208204659.tgz","fileCount":602,"unpackedSize":4935161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDC6GCRA9TVsSAnZWagAAiUwP/0o3/JHfD0hwLnn+4ZDX\nKw/MQA3nXfWRk1M4Ifg7auUj3Nki/ANXzJe49JR8hujZtsU1iLBs263tlEZ4\nTo/35YujIyBkaDM8Gwd7+t22Qu1Q0FibsVHE7BD52pLwVn0WkhvO1mIzvXbg\ndoAxh6QnTPJXKcLNDybBooOkTMUxYXthLCkE/oHBtgbP26fU3laluGZF+jzP\nTVlz/Yk/CS3ho57TjqFGhgRwFkwYxv9HoxhvaImL84B6VMclSEf2cicp4Xtq\n4+2WMv7wd+8O2cJ417eeAlNT/za99Ad5ZUiyhTDYBxN+GxJh37fle0pvdNcS\nBDu196p3yTg4UuP/oE8pCj3VfrCQuRbp8DG/VUrR4zZ3WBRS7/V+K3AgOtys\nVPqLo2EVfngjIuOfL0YKB/ScWC8iyI3mndrsLF1Rhpzn9Pfe4J4lHVj/BuEM\nCBf54OkY4HGj59lmacMABiuGwV9ZN7OyfM58L5xe6shRrmtdRHmGInkhcmkU\nZH5Eq34vdC8zIeTzRnGFhH0ArZTBx5NdGhRj/RnnA3xTmYpH2f3jnQWgy19S\n0kO9ounv6JwcuSH8QPE0dQskjgaLiiUaSRhJaFqa1A3PLOnWuDjoyaN23tzl\n6IYMyvHdPh2AMnERqmIjv8d2C7G8RPpTAZNbC4VdQAycIJPG1CtXDJPC97px\n3a4q\r\n=ToAc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnYARjDm2OLTHId5CWySh294bS6iRrtedIahTCMZQc6AiEA9tT73LrUMOlzIuVoEqN0uiyDdZS6uob0Q3gwlhJnZoM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181208204659_1544302213786_0.9038168479496"},"_hasShrinkwrap":false},"1.1.0-master.20181208204856":{"name":"@atomist/automation-client","version":"1.1.0-master.20181208204856","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16cdafe30d2ffd6b6c961cb71eb390e2088a9500","_id":"@atomist/automation-client@1.1.0-master.20181208204856","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+rfq2j1BRO6zpMBxvj1Iq5cSdF/iTH6pZ8bBQ20a8nJ+Og5bfGO9h5EgvLu70KrCnkdJxiWDtZ4WHSrUALRCdA==","shasum":"e05e8c413e51b794482378378d0dc05252596a2f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0-master.20181208204856.tgz","fileCount":602,"unpackedSize":4935161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDC8MCRA9TVsSAnZWagAAiTAP/iMVf9i/3Xlr9wB7blx/\n8jyN2OMJPEeD5qm+ApGXRegb2oEFrexYbi/K1LAel6xAJoG+r2zfUV8Xe1Vo\nwTGCijuHOOhW5fzfAQUnU9wYlSdSwFQtLBnDdTbCRcHHYpiQBXsmmylon4FC\njx8GNcmZNty+fCk4FKADQu4/UFjMG5xZYPpR7Lmbp1ELwuI+UTHQDNrI80Kl\nAW+x+jVQqsdPh1p+2TGMmFnkAKw6xYwsDu0VmVN+jKroluq5+UbmWTKLPkyx\no15mrS+90NHi72Io16R0Qug0tAXxl3oCX2cf/ePdvZ0twtSZ2GPY5/rAVWV1\n3+45cQAFA2E8wGJlycLF862ybc1g8M0pg7c40NVJmt4jjg1mPkG2+rTG1qEm\nGhHGTHWnRI5BoeZ2JX+uwoNe9BPM8npk+NRdEq1EkSbtksb7aN8IhXJ7iTXg\njBiiM42bteM6UjKlT7zvdn3itAz5shL7eFI+SYzxjRIQ15z1EqsjlhZ3FOac\nrf6tRP/iytXAzB1+BjE1T7i7qAKyqjZyj5j/ABfGZ9eVhum3x1OCt8lRplTj\naWZ2y+7QzkDZhSBAqqh9K+Q6DIVpYKLRGK/Vp5I6mvS51JSWCZZr32xNRo7A\n+jqzPCUwdPKqKHH1zw5tBR8sEHSky/ZiTHST/Jh/m19iyym8HXc49MARVezc\n6qbg\r\n=ftHd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+5AwIWoL1eVicKCbM+XFoXuxIxjriNT7Jb9hounDh6AiEAq1DDgoVNeX9rP2jYUYYlhHqyCg15HLVT4hUqc90qP7M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0-master.20181208204856_1544302347794_0.6936181167693769"},"_hasShrinkwrap":false},"1.1.0":{"name":"@atomist/automation-client","version":"1.1.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"6bace00301f1f9b68f825ab525ecfca2aca5206f","_id":"@atomist/automation-client@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5XYH+3pt0z6pcMh3q+t1+Y7OvMNpnPK8Q5r600bVeQyWmzQeyVyzz/GxSd4JWhjogo9pbJsD/79xn+o5BLYaWg==","shasum":"25172760cd27c325a656395f9fdb55b05bb9c759","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.0.tgz","fileCount":602,"unpackedSize":4935139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDD38CRA9TVsSAnZWagAAtiYQAIvjls3O7hJ6Mq8k/bXw\nhc0XXUFIqVw6tou6Gz9XzFgeVcCmr2UQApAuzPNvB+Fj3d68HVmxUOHry6x+\nC3IeqEZZPvRBSrwf6tREYTATRGOxI8K3EZmwRiyGrkAFHndc9Md0/hmTm16v\nsSfwD8yfaXiHlmkC8KBKiZc+SnMVlBVLRMvAWtwx8ZomtYMadsbIxYqgnBee\nhQSykgOos4LU/oB09ylF7UKw+3D6DXd4m69Zh6hxmR1anSnOgFvm/Q1OR63E\nlPSieUCPxkIBlAbqYspX0Q7UIeWfsDuI6/exQaorJeqCb8fI4mETSIlYffsT\n2JtxuZAl7uLbfWnmdMbewz0BQ9OxO7+1nqZpHHsmnpE54s6PrWt4SwmW4Upb\nN/w/Cx2fbnMwCwowxm0yDmQzbSvK6fgEVDfGXyIxz11+A3OvS1EVrBP4vloA\neHTi7dLNTmBR6unWn9S+IRfI45jbQcpOGVeSDTqXLTKab0bkfLNwkji+ePx2\nxiBwxaVHPZ4VXUGEUruJYWp5UF3u8NDEvPJ+NOdI8+Cyi4iGImtLwtmUKndv\n2Ot8MYLZE4AjwGcp4Jt/xQzKt3JHrucwc2MHHOkRfpZKun1QymFM4zyE16HY\nVaP1EaOBUO0ojvdG3U/X2KplrAP+IVp7GRQR/l2yv5A4QUKaKJrGUaOVmvPS\n973M\r\n=Y+rq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBguSNYTEQcspz8CrZUo+WrkbqAz+h/bZ2r6KeKlZwb+AiEA2Q/gpmX/tuUKp7FvlhKUImsCEhaOZWTrFglg9hwE7Ag="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.0_1544306171276_0.8933589317192838"},"_hasShrinkwrap":false},"1.1.1-master.20181210222605":{"name":"@atomist/automation-client","version":"1.1.1-master.20181210222605","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"23083653e80a2520c1b228651b8ee533af063aed","_id":"@atomist/automation-client@1.1.1-master.20181210222605","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yeKgv5slIIWIurfoI2jLLMQbJdYnsppREORpigJ8+Cv+nb9iQigV9QWc2WyUI1owJqq7G4pVyj/lcwmg7oJnqw==","shasum":"06fd5a7be8f438a6238c219f0532649f2e79ecca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.1-master.20181210222605.tgz","fileCount":602,"unpackedSize":4935763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDuipCRA9TVsSAnZWagAAgRYP/2sKTC+8Yrs+jD1tFkgd\n3vvEfyAZhdLQ5AMvOOON2/HnfSVY96SyZgN3yPAYfRaa3R+PiK8R54yAps8Z\nqesdOjUGb5clgxNZo8pxhr32dh/BSBrTOSwWq/Kw/DYSQl/XzyEnqr+qrzzy\nahwvcJQkU98Roi7E7A7VW+T8yQth7xjpPT2teELJGU2/bw6Wrsn+nz3kklDp\ndi3ziAxy+882scrTIhiuMeW76+LvwGG8USjzYA04vTCcQ+JNtk+5I/1ImRls\naHS9CF8IGsnZ85Brzg0DK2YqaZ6aAZS/KVTQFxfE2WfWbLx9xqYHxX5wYcRL\n2+IyhJ5JUZgCg6QTT/ZofWkU2YHLq+VyDtF4Y5k3PMxt+LehAdZdZAUfrmua\ndSVMI92gHP35mJT0Uea5gwi/FzT1uFqWzUlNyHvAiwzXJ/8RG5edVF8WZEaF\nSRuI5CpGBLBtc6WAZHUuQsWsq8u1lavhKX4kOk5BBG8vMaKOdrt17aDs0wPY\n2iyeG6+X3y4ttOjSrjlMqtNVgiL0atfRRP2vvoZnjSNoVlFoxpprXBGgriOv\nDim6Ml00XLKPEyI4iYKdgvxSpzirqMkQBA2wZjBedeHHmxLYtxdNUGTkKqOT\nn97zQKsSpB94wmex+VIsAVqwp6haHTbY1ZIQNjHFGmEqLY0+kmAJ39nx6FgF\ngTeO\r\n=10jT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2S4UfOzQdcg+b3sEyGexbuSaXiHPrRGDfQZ2iYZ/duAiEAiyA/frFDRZBH0KuaP8zpuXqRsC8wXecd+KGLdjl80ic="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.1-master.20181210222605_1544480936324_0.2534600119452073"},"_hasShrinkwrap":false},"1.1.1-disable-fragment-warning.20181211142157":{"name":"@atomist/automation-client","version":"1.1.1-disable-fragment-warning.20181211142157","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d30242ea85a92c0bbd4a996f3d22e95a652e8d11","_id":"@atomist/automation-client@1.1.1-disable-fragment-warning.20181211142157","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-70bbkR7snthTcBS0ieExM/p3nIZs8UyaHSM9CEvOwxCP59y/dudwBKN085EIJNJSyauSbHPEo32joGLanUeyPg==","shasum":"eacb6932d84856682e3c63618286ce26c5b0ea63","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.1-disable-fragment-warning.20181211142157.tgz","fileCount":602,"unpackedSize":4935737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD8ixCRA9TVsSAnZWagAAcpkP/R+H+VyjonKBLnf7PklS\nxMAdKU3C3m3Fxre1dhh8FqgKnxMsJomiaeFK70GxW1PCLvo2+gC0GkuZ5N/y\np+/xs2zYpMg4m71fl3A3mOZ/EsMKnyRirkpJ51bk99YgCv3xO3iYL1IWMWMh\nKpvz8HFMyuBxSKmGoXiRrNyAtSrTSqAhtOZpeiqtN54yga+Z+7hJDny6gQRo\n76WRK9KZ+FDzRLgv10DJcCzTRpWTIkSk0BFEgILYdw8TKNZ4W37T1OlsGziP\nY43V7ZclrWHryNPwEI7TwrbWzmGloV4JXfn+B2QUgbTlY1Pd2Nr/9EIwiJ4Z\nuSjcuAgG7yEn5xNMP5oc8g0OSTbiQDw5q1JjshFY4JWrCc0SW5OVnzRDgYfl\nMzXjskicVMoyNkS2oH2X8MJ1aFtRiGwHiWLRbtbpAV88NRr2H/MDl6OrhEVT\niQF11gBy4PuHE5XuqaH209YVNKw6pw17zbh2sKFQZbDpcQkukWk52w9ADt1z\nHHup0CO1c9tRz9AORbYsGlaYZPVgAzFtXKhk1boF/nJ7Nm1JqBqE6lo+Om0s\nM2Dul6E+vmWmg4QK5GiWqLlso+7o5/SVbsXojN/1AFTSL4lIkg/0AYb/C2JB\nocBAF011rdry1VObfkZv+7K8KP6nvhN1YCx54NwQSl9ebYuE28aG+O3pRKwy\nqVV8\r\n=7jq2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDND/he9UKQQcnZW2GJMjJ+wEBJszCeH7D7XxVPZIIh5AiB2TtUyg5sKFKs8TcoOTnmw1k/FjoY/YF1u6AmEqsB0+w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.1-disable-fragment-warning.20181211142157_1544538289040_0.3836034966078963"},"_hasShrinkwrap":false},"1.1.1-master.20181211142711":{"name":"@atomist/automation-client","version":"1.1.1-master.20181211142711","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8d284113c98a75a7e347c83e9dd9ce09706a4be6","_id":"@atomist/automation-client@1.1.1-master.20181211142711","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-R7dj0TP4qRjR6S4Ho9KFQqcUN5rPqXLVBtHykm+VHOAhPZ4ZHi9IglHovGtwEC5rCqd1gatSDuT95PNXDyqgAg==","shasum":"78b70e488e7027da6cd776a6c5e4094ddebeec0b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.1-master.20181211142711.tgz","fileCount":602,"unpackedSize":4935997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD8nxCRA9TVsSAnZWagAAvdwP/iNENFOVJ3Qj0F6LCxHK\nb26R83Y5jcKUzJJWlx9MccVidDIWbKnZ06lcJhORKV0hTrVnbJ83D3Eqs4Rk\nhKgFu4hJmQypzEmYEw3n9H0BDZJDvJqE23XQArVRCcmSW7qPTo8jFsWrm1zn\nfMCifkKjgp1+DRR+Mgwa7eT1xmS2DxRNp8hzyKBHqIFCOUxo1kGwURo1VbKm\nrx9rjh6MHECaQrmEaZrNW0c9MbDcbQRk+ptx28AlsuswDDVoFyTJta2QCGtm\nqRFha0GT9zyyXcozFJrXpraaDV2hxX4Uv5nlKxvP3IRjh49eVj4kKuFJGt24\nWt9K8QAIorq7paeNRfSo9nt+4TJllDQvYMDt1G4j7lQYNBjxyJLOyC2e99l3\ngAg9S+Atm12xt/R8TAtQMMdg8tL3DgjXs3PVAa8GS5FBsFPYj2fnNayDQBW2\nIpkYlXwEEtqtl8JoUuaNfI/OePcGoDrH8f10cl6680+PhN17KQI1Hv+bNHVT\nksgcYqTBeqmXEOi0kXatnsf2Fpm00MPW/Bow72mq8a/4PXkJh9foolT5iNIL\nNUbmv3huvWUr82rFKTpsKia5WtD6ASqhjd5u3USXVjQ3G8whmn97wJQHWAhM\ny/hY5sb9p9w2Lk8lTXPpOhoHb9/QtvgjPiYHr4Q9QA9hQfTl+a37IpYq2g3u\nSGUd\r\n=FGRD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC844lDP+oE30eL8M5bt1bSjGzwzG9PuKObQ4/9PGQsswIgHk0AMzslHsIlthz3ReXDNQNDtjI9mQjuk1mLQVfq6wE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.1-master.20181211142711_1544538608773_0.5207221304728571"},"_hasShrinkwrap":false},"1.1.1-master.20181211154014":{"name":"@atomist/automation-client","version":"1.1.1-master.20181211154014","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b850116b647f9677f28ff84df5bb8baeb14015fe","_id":"@atomist/automation-client@1.1.1-master.20181211154014","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sAGIlnW/Bopup9kxCOvgEMi/DKg/aSI+ruJbOkNOZasXEg21ImNuZSbMRnhagIxktx7n5sGVPY0kDwYANQYgpA==","shasum":"ab88abca5de438b4d0bfeff82a4d945e9f8c5697","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.1.1-master.20181211154014.tgz","fileCount":602,"unpackedSize":4936462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD9sWCRA9TVsSAnZWagAAdJoQAJCOuXY8M1jKJTXN9iwk\niTxoUlUhXJ7Ml73ThZbEACt+7TgW7CMJzHTlgLrBtR8T8y4wIlWE6p1YkSyH\naX5PsMsK0nnKhBP4e//hkczs3F8f0EacaeKaCm92lWgtWTMdOEnzpoxIorNY\nB6v8+Y47J5ri3kJ2dVeTrlcl7AdDC0SuIgcXfVbe5D4fLTovl3bXEIqxuK0r\nXDfjN3Xs1Nlh0vVSSI0TJMDSCWgAzUXVrzmy48J6uG0YJBHvP+0nebt30Muv\nq9S5PWBYSZoOVxmRqOdLzjKSrUt41F4PJF2Diasz2kDMzFjH1nMZAlmiGBO3\npgwAboSF5MATMqvlXKkovapSe4ThkFg78K8EuByQmZvM0WO59qgsw+kbRNu8\nlv7AsyD8AiT7V823oI52ANIjGYvQVs00snDMuoGW23BP5qK/f0YHPBHNcS2Y\nrb1j6/PZhdG0aukFuoNeX2UR1yCFQSjdPKKqTh9K9Q+zO5UZctQnpLgVZiID\nA4GlCBfOTU1ApBbg0clRWYKpAWgmSLbsT3mx+tADru3vCo45Uu6mjYikaGMN\nYd+yP9BYFe61CLDvbd2A0HfSNxECfsHwyhqeFThChAIKx9/wSV5WrK+TV6pW\n0KtDUCf6HpBGwXeFlhcshnVOjDw5yxN/yZG1R3m+sCtqld/I4VtLQjeJBmNM\nwhfK\r\n=T8Q9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBL0mZYPcekWXk5ajdm06NA6xSO9mPGC+Glof8tAgBDeAiBMk0NhZ71TOttUeZeE5KXhGSBC2GgJRM9w+/+GNclonA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.1.1-master.20181211154014_1544542998259_0.4062025885150191"},"_hasShrinkwrap":false},"1.2.0-master.20181212094239":{"name":"@atomist/automation-client","version":"1.2.0-master.20181212094239","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"281e37e6b8111274bdaf70699b5a793cef85ef49","_id":"@atomist/automation-client@1.2.0-master.20181212094239","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wSxORxvPGLPee8xLiA6Vlufp1y/nLToTgqz7M/dOBjIBlSILMObXFf7mN5QfNITgu2mkdamiecWw+iQW3D2/zA==","shasum":"77ce90d1f64393ad6531b3c01d2f18c091ce7d5a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181212094239.tgz","fileCount":602,"unpackedSize":4936669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcENjACRA9TVsSAnZWagAAZrgP/i3zKnu1ThuAYy+UMwEq\nRY00LlDYMkrZOqxLvIVbZbtx44ZdKxgsw5HjrJd9llp11yTKrKc+Z7BoX6fP\n5H/OQI2lrpmYEZ06SpFHiSn9sL/3APNf6cVYl/O9qwG8D7JWnwYg7Ca5+l8W\n6hHu+rEmjWhxdJV7f5cBRJ6VKpZQ+95GaN1pIGVlS41cS4nOVATJqQTlnzjg\nDw9+tBCJICSkfogUjgOaWq1DL4nbw60hTa+c4vPA/HbVm2gdC7V98NTB9eVk\ncdCznQ6e/O120jig82re//3B5mYzeNfeVq2l23jHEC0BgDgiIGagyJrLZ/M6\nt+IeBWTETrnxKK4on63OykCtxwxpShN4OwFfUIfuY3C92c01BtQqCdRCJ9ft\nGTfGxuD8RhKT52pzdYKFqMBl55tyunwJFsrKrFtOhnMDpmF+/Fg4/Aigz3tG\n5Ek+3dqzzCXsP1CwbyyqkOdNI2tXSuQKy7c6q4UV23qSBOdx1EqAGwoki0Pm\n1+GHVRuYxUNp2Y40P+AV34rUKAnhKmy3yVMjLfWnw6oIYTmhj0V8piPLDFCy\noVZW0/IFfkp5lqe2Km3LbKCFrVVqUgiy/G/S/8XWjOflcWQLDUUo+9MsgcBE\n+hdS2A8Tnuesp/QttljzaXLsl8EVQbTlzwMcRNlkHliwuwm85DXMUFEUOft6\nTcpO\r\n=8eSr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf96A0loPprYrgjzrqjc4EybXQTeTTALCkHnAFvzC7HQIhAKiywxdE8gAQpyWkFj09J9jE2YOP4zFnPZkMm8qmvp7I"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181212094239_1544607935196_0.3220157820178138"},"_hasShrinkwrap":false},"1.2.0-nortissej.export-execpromise.20181212212436":{"name":"@atomist/automation-client","version":"1.2.0-nortissej.export-execpromise.20181212212436","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4005a539c0fccb04d8be73cec89b9d8778c159dd","_id":"@atomist/automation-client@1.2.0-nortissej.export-execpromise.20181212212436","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QEenF7kgyDrIorS6xwObt2fhnPvZqBUIxSCbuOWthqzX6Em9cWZff5Q8tuIwM60F72SZf8ze1sRE5zqn4db1zA==","shasum":"3b0f92bc1522e088782090967e374e8bf6dbc968","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-nortissej.export-execpromise.20181212212436.tgz","fileCount":602,"unpackedSize":4936848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEX0wCRA9TVsSAnZWagAAh/kP/RWU71mm6UEAbycndSWG\nBN30mxwskv7g5YThyR0nttOn1pNsnJWOUttfUAsb9/xRxvG331nSS0g6ioA+\n1g4i4RTHoxSNul/VJVM0CAWz9ulo45W7Hs5RyogA9lNRLfV33vSGLYVIOTuo\nKP63Y3SU2Oya/NAjJ6WzaZEraQ9M0+VsKthnT5pfpXykLJIC7p4sq4y3+5Ed\n6ClOs8+XturnrYd4K6hof0dHg1sGRv2sTx6PxAFuw6NdZPqdDVl+P3hca4dm\nnuPmbcH6h9V8JzHJGE23SIBunkyf7OoU7CmeNLbnvT7BVqDUCMJTDsB6cEoR\neOq0yz9cTaYfmTFJjjJjn2MDURH5OijI6NzeOWlAxKIiwclJyjwr0wU+tLLq\nRSBG+Y5jP/NrRd+dLV52VLPsIlc/BmjfPcdKSpsry1mkstbm91J56tV8RglM\njZQevGxivyO+iGeQ5ku3mLArnk5XKsyPZbN958Smhme2AfMJULrJuenQ9p1/\nC2KA79cFbpd7d6n2NO0BUA5Xk7X81woDxuHexB9L0DeWLgQaQLgG3Iu7WogQ\nMzZxxVqntDCXTbPNkHhpskkNbqezUURxfbzjaJV1RSrETnV6cdq57fUQs8Qq\nxYdufg90lZK9xN4d3VlSEDD/cSE+OKBm3iuigSttRxBKhBrjl0yKpKlkcOs5\nJQYu\r\n=j9Kz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERSJjI4kWZQZN0lVVSAkg8PMiAzAhYloqtndqmPQSopAiEA3W8VVbmhKCH701lC42s5wBll9prBk0TfAiL7d5IFXTs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-nortissej.export-execpromise.20181212212436_1544650031233_0.10088523936209359"},"_hasShrinkwrap":false},"1.2.0-master.20181217141728":{"name":"@atomist/automation-client","version":"1.2.0-master.20181217141728","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8619dd07efc4be06bc3d966cedd0ca0e33107081","_id":"@atomist/automation-client@1.2.0-master.20181217141728","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Gt/aG/mOV+++SsOetZa6a2OpyhxLuWGecN1/qqpqYgh0ekBdBVJJr6poMbWE4gtONfs5vr8RZJK/URdbeM69Qg==","shasum":"48d040d7926fb82531324b802d74462720fd27dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181217141728.tgz","fileCount":602,"unpackedSize":4936976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcF7CMCRA9TVsSAnZWagAA1rwP+wbVdKvINly1UxWFJWXW\n5DB6+mPyyAag4C0aHpecm11244Tq8S2xuXGAtGpR2W9v8F3bBLzojyt8/N5n\nKMioBSG9gRENj+GPn+iEGyNHjW5oTegy352mJFUG99am+XMsgVnemIQWqhl0\nktB914vG6c23XiWecO6DPj1UEjB1sZFOIADyli/7N9KXNrHYUFrWqe0qfmXF\nZxGup9YTlegBWWgJ6iU+cblhNMI1quJ6K70C0iAFuGn4pdXnyiNkFEMnxZvA\nxzgSCZqY4OYw4Qnju/dXp5Yn0M/vVzePCuK9F8PS1T1P/3BO8f/Pc5+fyT83\nTITcuuIwfBFOY9cuvU9lzxXFYufVDu411AMQJrZgKih6iO3ujP27WfSZ0OAv\nfggT3Wf65H9pWzbhqJJYmJ3BUPPvlH7/k/DIkaJrs71l+wvGdschQ4F6zHUv\n2TVez1kYDmb0Gi31nLx06z4NogJWv9q3WA0LiPSMTxUuiPROsfN6TrDl+3Yc\nN8GbYGKLA7vJ0kgWfcSkY5oq6n7dSfvDVwM0JXUgnoc/9Cualmt/SuL9HN4y\nEr+M/MghbCaa4G/OwKSUjPB9HZa5vVgOLtPgc3Vy14uUwagoHNJNt4poCGfX\nPs0GacSfRSKRx2KdYX7DOkpHXCsVEXMVqyWtDYY7GTohDC1cV7Oyu8gIYSCe\n4hfv\r\n=AL2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnl2UEb0tiiB0D/R8MobEzDfJ2EEmdFSJzt1lq619yewIhAPx98OpcM0Ch5AUjlyhGHMFMvBvG7o4Gesux9trbgrFW"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181217141728_1545056395440_0.3469015114658953"},"_hasShrinkwrap":false},"1.2.0-issue-423.20181217202405":{"name":"@atomist/automation-client","version":"1.2.0-issue-423.20181217202405","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"83e70ac857fe32cb141dbf53e6b017f3cce67527","_id":"@atomist/automation-client@1.2.0-issue-423.20181217202405","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-5zFB9RDtGc5fBzKIStOeIjm0KWDCMR5IfF2RpVIfyVzHW40rgk+fbNNuhE32okgGT/Go2S2FypMBR/3IE3YBsQ==","shasum":"671ac211f24ae1026614f1d8cce5d75f8da2d600","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-issue-423.20181217202405.tgz","fileCount":602,"unpackedSize":4937048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGAaBCRA9TVsSAnZWagAARtAP/i57eA7Tjy3XsoTaTROT\nh8hSw6m8rjWvglfYQJSL5SnW66AHI+wFyHWI23HySILICIyCK6A20631e1Nu\nD/BFSoG+YG2JjzpNbdgrYW1mylc+oKoGIsz6u6l0gF3BzuVnE3T2Azvi6lIh\nTwTHQB7tbfgF65+87IE6nfTeFge3qTC4jUd1PeianQV0II8R/A1eO+cnIXgy\n4S7IIESulzIk6yvbrlSsIQyOy5sGPEXaOpA6t4X5eq4VIDHq0SdUebFJ9pkk\nFDxSypGSOW42VH2kaJo2V1BbIkWvVvA21GoXtAm9t3qC7eQlfpPTcBRlRciK\nXUDbkjJehgVFNrhThLT4j0Tjs7tzPDLaN6KjvmmhgG9Mcj7/Kkz/sRhKgsGp\nhVOHXv+iYrz31Tl3WPyRRHoKiWbIKXtSyM5IjdC4o2P7WrxxZcGqxL6GHxcq\ntn2XgcEFdm5eRizbw5EQGH1WuccL51DxPdVshmWnrQcNfBGw1nOAqsRhD/22\nI7epM6xdpinQn5siWjZ+/TxdXRVntXHJQyjVPqycPNS2+pS89jVTterLUMAQ\nn1lpSlmXbYY/+UvqX1UnnzQVUOkc7meUQMV8J3lj7NLFN6qw65ygPgeIi0pQ\nHAfRIFDSSYi+Knon/sLuBkVdTfbrQHUcxfoYFMVuTAPdu8k2X4WvNz8hJgg+\nc+na\r\n=1FVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMxdUFphwgbBbHc/yurSYffkGUJ+EfQ7nooLXZYVXNHAIgEF+87b6ftVdIi6blKtRyP9diihROoFGrt6M0ZPb8nGY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-issue-423.20181217202405_1545078400716_0.9455128064657761"},"_hasShrinkwrap":false},"1.2.0-master.20181217203653":{"name":"@atomist/automation-client","version":"1.2.0-master.20181217203653","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ccae1e29d42aa3a04342d32914b7e32e95aac9fc","_id":"@atomist/automation-client@1.2.0-master.20181217203653","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-izORCxne2OKhuCXYP4vMIw/+mn1XT+suf1cITiJlwrzhoVij8N9BQxxLZvLwM5vCrEc7507bWjKvnJYaWr1qcw==","shasum":"f53a86829d7ef84e9c2d0577d432f21e2f9d1d54","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181217203653.tgz","fileCount":602,"unpackedSize":4937173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGAmCCRA9TVsSAnZWagAAi1AP/jhA9A2EC7ATnLsyWM63\nDL2ZbJDAZcFRbMEdFcyVdw2Jnx32IWjBGrvuPr4ca+8+Y1ApfA2wHuiELQN1\nx+r8ocSJNTal0X7FW2kOguBha+dP52L/8eLlxPTj10C7/BsI5wmxdRli20pp\nUUjEjVG++0RJBmXnS3AL/BbYOANIHJnw91cEhJvCKkmrahMiAO0bqkkj1Hzi\nqMBgcFuGuVnsnNF9SRhrxq3e/x4dNrdAdqsgXLwY8mabS5NKmoksiPLGdvov\n1P1y6jTg3Va2gbYtWuCGm1KP/Ml+DZ8cJWuWZ16mg3V0R+68tGz5wY3Sssel\n5sBNcwSg7+cXqbg3SnvZApn7h8MjMub5xz6yN85wmpBjsakkcggGrOhRJODk\nCgGbolYfgwdzBWxTJV1Wceh8sV4oKDPhezpBOO8moZG4062SSDXZVQuAKxPN\nGRSFLgQm4iebEAOxzJZDB5nQAG4FP1vFFtts6+VXcDqArWrd1llMs/c3cNH8\ngX7VYFHDQuNKHQYPDlFwpPlx7buixoNrV+SC3cMllN82wEu/jDi0EuZsssEs\nthx+qyzUVGKHsY0HkUsulKIceQHsBfzWiRyXqkaByXzYTmlLJIFLWrlDVLRf\nhvuAKGg/Uri6BxsAbfPNlF1M9c9CB9MugjK2v1zhaWeYqJIPu2kMTgO6jFpq\nJNQL\r\n=3VQk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsC6M/qTBgP38qjqPJlasvrbnOAR35FhuqGOP+y4ydvAiA71MtXO3wCmRe8nV+VXAY5fs2sWy7VNAmhKpu1SQCXiQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181217203653_1545079170072_0.563401135327573"},"_hasShrinkwrap":false},"1.2.0-master.20181219081649":{"name":"@atomist/automation-client","version":"1.2.0-master.20181219081649","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"670c70f139b15f305dab02b123b3585722a84f9d","_id":"@atomist/automation-client@1.2.0-master.20181219081649","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KoG+3WBM5MOIqwrmSgDqwv5MmQSfmUXr5tDX1nDTK2X5uiBj29HWOcxy17nhObIco64UxNhmtcC+6/xpOY4xYQ==","shasum":"ff7725e7421ba1b23961bd4eeca4e1ce083b06ff","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181219081649.tgz","fileCount":602,"unpackedSize":4937722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGf8RCRA9TVsSAnZWagAAVXYP/2Q+948PfaQIQeVzeR5K\nY1FKrgYxjVwVFf3NQLgpj2qEemCSeN75S8DNxkupA/pVccBREM1Vs2fL388d\nLXhWfi7XYIGepwHTlyxYYzHkJS0otgh9pywjFWm3q1b41U10mInUR9xtBbAo\nf92qAfmADETP33N2/dBkxuOquWV93mXO8AOTch1aZcSx7B/MYjZRt33jeW/W\nf17xJJRh2+TmUtPmo06hwlNrl+BkElJJKh1zXP/f4dd8XC4ZuuBqkbRgKVou\nkwjXB+SLbtQJ8km18RJpKIsjl/xuvJgJ7pDWCZ42tHc9zR8CMcQjWr4cwU5H\neulezEnT0BvbP76II0Oy3+8VBaFUlvd+lJaQyVOj0+SCKG8Rg9Wxaz5HoBEE\nyV0aSFgE/hFej53cKOYAcyfALlBspLJz0nHY29ixPhG3wJBxPt79MTdiWmFN\nXZooN+yZ5KWg4cHKIDJ/Fao/06MYVCIEyl3aTYU0V922ck3emv8OAfEqFRsL\nJd6eJ4xbgNBxZqZKZzaHOG+PFLMIS0kWV4Gv1VXPb+9UWXnaV52lyrGiEyVI\nf2KIXJYcCOOGopCAQmbQ2xg0p58imqBbh4xh8XJR1IQ6Rz19V+Yu9KEGDGFL\nvlQIEAzurAPAZKNBxnIUBXAkQ1Ruo0ZrETOup8a9vKT5RGz7MDbIbAID9UMR\nUYQd\r\n=iyRI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrxLtV0b+jMlbbg/rDOnv1of9uVdvjd1gdTScBVr4jeAiEAiJq2RcNnTjeozfw3BGQYbcVu3cEYxpc4gMOkiIerJR4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181219081649_1545207568538_0.8851530049035108"},"_hasShrinkwrap":false},"1.2.0-master.20181219170817":{"name":"@atomist/automation-client","version":"1.2.0-master.20181219170817","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4300bf47907e5f9bdd4ab76f986dc12b1ca42b01","_id":"@atomist/automation-client@1.2.0-master.20181219170817","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Uav8Ck3C4h95sCIWAcOKUd8lfk8JThJPPFqLXwoRt+GwYPO8yhwaY/AT40csTB3xwd7FGjUT/iw9vLGknMwnPg==","shasum":"28333594d299477d015f4564cb5901714bda2b14","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181219170817.tgz","fileCount":605,"unpackedSize":4943275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGnu1CRA9TVsSAnZWagAACSoP/RjVSTOL+UlnnCEbUOVz\nMcc92oZ3z+VORQiE2SC3XaHNf2y6BXo8rE5y2apVNecgvdAljZuT92h5O0Yq\nE44FdJZshmsCaCZpfTwxJBq3JPnobg6TG+h0bIPWRDBABOJrJznV2HTydg0s\nYwCVWLpFs8jxUxxStibMItmE/K4F72zJYRRPYoUAvrocNw/BRYIwo8dNeLnH\n2y7om+i5mHV5RltiAxQYAKd8G0JFit67NtCqA7j4Pv2IDQmR8MsuA523y1yV\nO7VXZyhITOvKYG4f33hRV72jie4JYsCRgZ6JeS8j0A+7AH/xBBKqN+ICGTUQ\nYsfgIcC3+1nBvBWNrMNJ6N3Bt+tTWZ8GoJZ70C5lNrFs9hEwADxFTNI1Spy+\nsemb3vQ1JAc7e5WFuXSvElvmFEA/gcL7Lted4eiXpTovRixSwrY1Eiv5ZTQP\nsTex/OdCotKlIAJTM9zy0ASVQUQV6XNAqPlFfcDhOFNzeJWKKiyUgJ5YS/zz\nRb12/1rcqV9fgBRVjIs4FCvmsbc5cnrgEYInXAGa/46WJcF8dk0Hd6p9Ymiz\nrwFmsPyNcM6b1Un9trNhV9EYSc6rUe614t6YS6+h7WBgBHO6Cp7RCgG9u/CF\n9kLOFREeX5cwgQrPwEyqtTEU09LUvNYz7YChKVqPj04U+/XIT3BUoNeA8gLS\nsDef\r\n=kDeG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBImCr5aDJLME7UpGkS0tRc0Mgx7nsNDj0POgv4ZAqNgAiEAmS+XDl6iUY3q+a3IZp2mpOxwluVg009l3MYLsJCUUQU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181219170817_1545239476400_0.22583767962665924"},"_hasShrinkwrap":false},"1.2.0-master.20181219171021":{"name":"@atomist/automation-client","version":"1.2.0-master.20181219171021","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4300bf47907e5f9bdd4ab76f986dc12b1ca42b01","_id":"@atomist/automation-client@1.2.0-master.20181219171021","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2Majjz9N6mVBSgTdjCKPIpcxG0LkjDYECRbRnymJSP2nEVjMH4PEwRIdCOStF3Ean41qaVkatZ9AGodphYIm4A==","shasum":"78093a998a82968dee9505460b9382009c43d434","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181219171021.tgz","fileCount":605,"unpackedSize":4943275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGnwmCRA9TVsSAnZWagAAxJMQAJfNALc/U/oQHYdh1n14\nR12sR6szsfWa7Z5mCF5DSX90fvSesq8GIzt9DO/mDB4Hsi4EXeY9dY2gtMZ8\nUl9nt9Ru59z4RF5Qhcgo6tkIb9v5gjWZIgDWCyEkiol46dxzBZRRLolKE+mo\nwJzJjNxIY7iMmrCOgh0TzOQOsaq15EdGZ0gC+44wVtycpiU7AyprKDeQoV1e\neqBMkfD/u1h8qWqnrJ6jKKVpdwoUnyOiLGUoP8C5LyTnYUdnTGR/QX//Rh/d\nPwhgTaHsT1FxYieY7iCfeV1VPje6hgsPH7cafR3Ioumzy3wOiZFLGOaG8AA2\nJArOfzsrtTtU7miGrhnQ8ECyR0EhwHjBl1RSVweniJMaaqwFRZuZjzxHQGGg\npPsTlMbN/j+2RGAU+F5hzswLenoO2MzSoW9g7ljCoPnxQyUyF6Mbk1C8bBb4\n6gEm2AWBAiRK9hviusvYCeEn+fcvNzh7pZ4qg9IPkKqxTTUTcMUI6v3TSbz9\nqFlXy66gy2aAZv5BNodr/lytM0Lcz3EaU8em9iK3MKXXD1EzGotxh6/SVN4b\nEnEW/ThWAMtPFvaJ9TZl3jTUt29ZioQOnDcQMSz3kFifAd4UE2QMdHpB8ekT\np5BZyOSeognAbD7pJwbZr0Dhuft1W8338MjBNFrzWm1VC1FAYRDM5J24N9as\nT5MS\r\n=gJdH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+iokk4su+4D4nEXSPdfeamZi7NZJsAQb9+aHmnZRqNgIgOfkckVM4JTsnCsA8vsTyNRgL+TkCIERUeIBLtL6RwUU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181219171021_1545239589233_0.49546932885745787"},"_hasShrinkwrap":false},"1.2.0-master.20181219175043":{"name":"@atomist/automation-client","version":"1.2.0-master.20181219175043","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4300bf47907e5f9bdd4ab76f986dc12b1ca42b01","_id":"@atomist/automation-client@1.2.0-master.20181219175043","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hFOfJT3DJvfUzSSxmn/PhUh9RM9GowdEQmfvQ4M72ycd/XTbz7z9Hzoz6Mlj7Sjy4uHT8c6odwvqlyspyW5R6Q==","shasum":"de41c05c775f144c178ac7ec39b6333b002cf0a2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181219175043.tgz","fileCount":605,"unpackedSize":4943275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGoWiCRA9TVsSAnZWagAA0UYP/0gha9WFQhTYZzcK30a0\nezaXCUYy1kYev5CCVwpGF5dpcRd4G6fmy6HNrtDJUEVVbOfhOSkJnrG3OSQ1\nbi5dF1Ua93cpi/ZTDN1xzhaa/7m4YGVo6d89DF8oKEhe9g1ITEqdM5MXVl6P\nMHTuc97PlJsr4cHAZEvH9AnloG5jxg3FmE8c2rceQyh1iyiPsPNr/sUUOUNh\nj7s+e4+CzMGPIsBOM3lbBT/B5tv4kwUf/lcWjNzA1lEnj/xghqypHNDSZnaZ\nM9iVnTQ32n4hZUo12FYZaDgMhuzhX5D1GQS+9SN8SYifhboB1fIn1NVvJRWK\nxw/hCRkI/FtEtZsn/9Bfk03zAdz/XnY3FVDOD9SjAYXaBLLMh8/XESv1tALD\nBh0J8PORKPOFrNE31plLEsW5tEla2ePb2NNc30acu1Z/Mr8/McWyDzMod6Lt\nVsCCT2WebQclJjX38sSUBPUJSNpb8K6a2AfDU8QeYExG3f94InSKzUpQ5VSC\nQaEWtp9Od0c3UW+RervFQ08xNeRfkDFu8y1rsDH+f7MGk1K6kkFrB6pEsrRU\n2Iwm9BR9vCQ6DcYqgw1XMSidrXTForWfKr1e/o7FPX0vlGxzS4dsu5fNQz/T\nPnRpEsQYyQ091H6zL5Tv9wHc9mhKI9SkqqiLpkQ2SnVK2rlMF+fuFC0N2IRK\nLnae\r\n=GIHD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWJZWTOM3RAPb0wDgQtuKfeH6mQMUVV2TjLgltjv9AFAIgYvp2PRor4c+8ToRWfZDyCHnL2RtK5aidFeZNT4WP/bo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181219175043_1545242017724_0.5188163039003897"},"_hasShrinkwrap":false},"1.2.0-master.20181219185909":{"name":"@atomist/automation-client","version":"1.2.0-master.20181219185909","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d17bf4d0f1398213855ac998e737aeb6b7d38e81","_id":"@atomist/automation-client@1.2.0-master.20181219185909","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mUfr/tKFFOGkQIX812mVRMuIing5RTlq4J2H0Z4EEhgru4RdCIBoQD22gXHKzXdMp9Ail0Q/UQPwM6lLeuctNg==","shasum":"d78a33ec1295559064a89fc9a8998cfd0221cfda","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181219185909.tgz","fileCount":605,"unpackedSize":4943419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGpWaCRA9TVsSAnZWagAA11gP/3KGSfQ7JpbZt/M0HWGV\nZ0TUt3AAg2CrJx+lX2iojSiZU/zfNsLYR5LvFg1cE7j9MtidH7bS1/fuxzio\nxAAuzQvk9U//DKamB108d8V2oEdv+6BNFsfeFTPBGHu73qxEoPbdRYmvv7qT\np/d1zb6UiX499MAOb3KG5LAnGb7sGTI3bbKuNIq1iaokc4OCXbmr2eGy2YMy\nnaiSZw8ezJAOSEaktAZvUv/HodLR6Rx/Qs9csXyEBwMnDA/g9UUuKiQuyjR6\n7ySvltnz5gEXGNJghIaKQF+uRBfX/gpsD/Fjjt201oZdvwJp9X0jRAP+lfWu\nXvzs+48pFkaCyggZ+z2ywUbAB/jZfryOgIGResWl5xxgOgMIZQQ1nEmGm8Bt\nTwyx78sA0EEuvPfw+3dKdY4Uq3fFoCPkUgMdEqCT66Fefmsa6tzIyEsC5IUZ\n6UyOov3FIdwF8P0LViCw0g0rRJBwVvBwOtdC3FuXAxcBVIDWypqf2ihy+aXx\n4ju3kYaM1OQlM8FXl8R3NPcj8OGD7OOQZ9ua2aABEW5/xnftPOK/V3EilBK1\n1pXUME4hpvoTZ14EQIyjDNjsKi4Fooc+BvDBw+pRSDiEdqoZKXUNTaU1nY8L\na4cIBIWWVufBjSPJLmdyLI6vqZwaziv1CRbidDdp6W1ogXPy385su9pDvmTM\n9OmC\r\n=JfkK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUj5W3xHA4a2w9ll6jZdTLYQQsFw8gV2Utxp5nWGgr3QIhAIfUBtezbIM0Q4ZO+ulzhEc1LLL9c3qK0VGxmB6x+q+Z"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181219185909_1545246105223_0.9758797249161608"},"_hasShrinkwrap":false},"1.2.0-parse-opt.20181220005906":{"name":"@atomist/automation-client","version":"1.2.0-parse-opt.20181220005906","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"28ad6226122e7f6e3c18af04601bc36e5c82b80f","_id":"@atomist/automation-client@1.2.0-parse-opt.20181220005906","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XJWARwo82PSkdLoxooanZXEICOMOtRVRTr6Q7uvdNb1XBq3RUZqu1xwuy3qINjeSw3hK3pexhmpsUFotIWSPeQ==","shasum":"042b99816e71938a4979854ee58436f97d4d4a46","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-parse-opt.20181220005906.tgz","fileCount":605,"unpackedSize":4944191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGun4CRA9TVsSAnZWagAAdMcQAIaFeRlyz1hkTXX7pjpN\nGZjCWuLuc7zkMYCOBi1WyiTeiXAUtZWpnhq6BkcyLYv8PNCdjNg4b5iiLkwY\nnJiuw1/361su2uy3w3F3zaQuRHIvOKeC2UgqfIikX2LkTsMpG1IlE+bbMIy7\nnJxjIUmkkEfBsQmsip68gwo6ZipIpY0WXPDVK6RgtBe6jcyGwVDz6a/5r1Lj\n5NBo/+bBwbVLoZSRM8KpHN3eW+zlS3dL2Is5iDYZAMkh511TRoSfqK47RNMK\nJRJBFD3j4lavG46ALdxioua+CzODH/plLj3d8vAaYxDq3NdB1nxKVqO8hRIE\nKDEPzbFlUrjH6z7qbvljMU38nPX+lYLoUfpBN2zen8LWsSNmcea7829G2kWm\nBMCX7xlzJO58PAHpc72C7WDpUtriIwB07O9NMLsekTMtJRcTDWMeXVl/uzk7\nDsdgfz+8BoBLO9tgjY/KVN6I+IlVUlb+UxmAdrmjaORmP2aF2e2Ul1s0X/Fx\n4ByFF1JJGsTd2d7AhaCS9UYxhBNNFkwh2KvcKWk+wMUyCcSqxVeGk/2dy63B\nnLI2kto4TvWKLhnInk1+NrT3G3ki8Af2o6lS981Kmf16Wh6EYJBx+SypNg8G\nzkNOEs08+sdqLhXkbDn4Wo0Hed1mBYBE9qFD/2YzM+Uh2lcRHRfvrY0+it8I\nHmjz\r\n=m4fg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1nRpvWi6KNd2lKkrPXh2jW0BrtVu5BZJ0D9Wj5ysbogIhAOLXlIVDbUM0P7hWr8pTSHRhfdeTYGsfEoxn0EIAzYRQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-parse-opt.20181220005906_1545267703318_0.059914671246680706"},"_hasShrinkwrap":false},"1.2.0-parse-opt2.20181220020604":{"name":"@atomist/automation-client","version":"1.2.0-parse-opt2.20181220020604","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ad7e46e3bf44403a4b5f54096304022eaaf3b597","_id":"@atomist/automation-client@1.2.0-parse-opt2.20181220020604","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-0pGDYx+Rr6VlCN76n0XBHV4eIDTOlFTPZDLcAdLXyIzH/kjnSZJGHqwDOujk+tNbRwJ+/ZeBVj/CzvCVdqh33g==","shasum":"58716a766da374fdd0d75bfbf95822c18e299410","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-parse-opt2.20181220020604.tgz","fileCount":605,"unpackedSize":4947251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGvmpCRA9TVsSAnZWagAA9HMP/3h3hov2GLuXQMxNugfB\nb+lHyhE5+MzSD1DpPMzwHrFF4uFyTQ/uytGJKLQGL5CnFswKPEUc45LV181J\negRwyNr94ON+iQ27siQLuaf5FabaPGM9rtrJJ1edjiATqGRo+KP+0gcIj5AP\nAo9a0Vp5GEvFDhiPiuigWplQwT0XO2XuQ1wZjNXG3xgY2wRN3issvjYQwx9I\nQvVDpWk2vjCyzqUrf8l6d/mdLtzoSi0ZDY5vMXDVxaHLPTFXKkz8LC6s5FWM\n7htRg85Lj8+Vmb21gm2xc+jM8d/PM6BFjoit9lGOYyVHkTMGhuM8Mid5MJwM\ngPWDBzXgVl8SwGFd179xBCUqT3xDssSD/HV9aII+8ZcUKqTe7AalWKHbnya1\n9DFjdwhm8ZA5rVqqZ8W+g78/FOU3w1GANPi88Dsr6ElMlXf4TD3CvCqw9pYn\n+EGJzCaCETlIQBO59Aq808wFOpui9o3GoT/u11+n573x6cCnvYdzg6oxjJor\n0rwjl1MB/O4+HIPXU21JdxrHS+sJuyTd6G86JWhET+bymQZmaNtxPZ3elPeW\nXwcX+trmpuWxu8ANx7daBgbbBIQMG7puNHV0JbaUhiw6+axv1DGgWHEQXg+B\nUIoEGCa/lC+4mFWaAZDSu5bNHOKOKPiV6cSBS9QhYrBu1Rn0Z+MKPXbPhpH3\nqJ9I\r\n=HPJs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCzPEaNutFiMceBvio2yKRLvH0Obc1aZR5nM2qtlWwxgIgfPrdFOvYhckI8iT78hu5QXGxRSJjx4jUlh5RNMnjIdg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-parse-opt2.20181220020604_1545271720462_0.6981522238149913"},"_hasShrinkwrap":false},"1.2.0-parse-opt2.20181220025943":{"name":"@atomist/automation-client","version":"1.2.0-parse-opt2.20181220025943","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e4772e2cd6f7f7171719c42b64f6e53d66ce10f0","_id":"@atomist/automation-client@1.2.0-parse-opt2.20181220025943","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Vn57Q09rOwOHTmq51t9y5I73gXhQdPBfP3XOeky8OwW5eS4x4D2SMqhwXphSiB45Vl1Pzrqtf7pQ2rXGk2XYvQ==","shasum":"0137f6c0e55e73b0c082348c1564a962a23d2a98","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-parse-opt2.20181220025943.tgz","fileCount":605,"unpackedSize":4947314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGwZCCRA9TVsSAnZWagAA36MP/3ihgVBtXNiO/cK31wSL\n1w4y9XgdK3vB/mtb7Iyo+buWA++KMvcOHmRAilO+jeu78zgKOO4gA/0pbyXs\ntRcvsjTaASAR2Qp3AFaLp+jn7/IMd2AoHJJKALSybfUQXAO0r/+jwwaPCWwR\njhgu4XSe5idXW48rYglVqS4s/4ZxumDKBS7DTPh/VRwrrUZpEhqiu+W+GO0I\n/kYcO49Oqk0FHe1INJXvXlO8f4T3U+Bl5jvLa+x3liyCRXAvWAqduLU/a1Vl\niRc2COtgzddhn7a2Ytm0aGrvO+y3vz1eoS8CFfDxz63Vg95jXIWbPv8fO0j/\nrc89HuQnGmN23nLO0xQE7PKyGbtjZxEXA65oux4jFybN89hYuM/5LhFzeCC3\nyZbE5JpRR4ZNbwSB4SMDTRBi05jF3Xr+YQEeO8zmVBHVnWs0cLvTbioGay+H\nMARTNmurBoccD6sO/fOQSJFtdsJUaaNhCQPQmQfOvl8fLu9cSLoIqvDndV5P\nB17zv5+kinM6oT4LUXzdv5GIJrrlF4siGDb3hul69G1oPKQEVRDZ06OYvQGk\nd6BpsPZQoAvFx0oC4ZoIExwmK4iYa8WXCCHk5YaAuBcfs620H4iGt+QJY8N6\n22cBd55GiAptelOG8WG4zm6PzoQGDCkJ7WEcR3PM6k8qxubE1ne11oatqOXG\naAV6\r\n=1LHE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqH8u7wPxwk9ZFa2TdCNCkdvoFoJJFKWe81O25ILw8iAiB0gpAOGDet6oLMP7340GUuaJECHOexvidl2fjjKS2pdg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-parse-opt2.20181220025943_1545274945510_0.06642851531992933"},"_hasShrinkwrap":false},"1.2.0-parse-opt4.20181220085459":{"name":"@atomist/automation-client","version":"1.2.0-parse-opt4.20181220085459","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"23f425c508f8592a9528734e427b484949247e81","_id":"@atomist/automation-client@1.2.0-parse-opt4.20181220085459","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xaiMLWrv0y0olIkRAF4ov6kmIrEy9mnd5K8J/NBUF4IJZ2mPa2g8feLVt78dclWMA7Z+p3vAvDX09Yd1i6ptDA==","shasum":"f52ccb7b5b5fb6e704722ceb0bc2eeab5c19fa05","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-parse-opt4.20181220085459.tgz","fileCount":605,"unpackedSize":4957213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG1l9CRA9TVsSAnZWagAAaG0P/0zntuxKk6l4jxCtOpgk\nnWTpqJesL6LRNZqy82o3MGcVckanqjF3Oci4etP36171n41C40ExTTuwyxs6\nEJ5C6fZepTvEh0lPsrX4p3Z0Scf+PzSuscheqhSowhx/nmaKgYXM/HIADE/p\nolaXHmtbOKEoR2h4v+kzXcSKex237IQQIWt7L37nuOAUP4G4lLJUk6nHjnfH\nsJ1m1VCXuvGwJAXifmFPeq2BdMwpLVX5QDEp+UW+sYsDCenHiKeyVT6yvwQ/\nFYkGAksgl4hMcbjpAWHe9ASzHstfY72h8pAqgEZPdBrueSZxnbw0ljrwol1H\nvJXjJUTcSLbAt4sNZom11DAc6d7cEYDZgq6sOKj0vYCt/MYfABFpzxqLr4ku\nb7ioiCqUHx4n8wgQffYWbgvJ8wF0LexkTUYZ3BcGr9EblmCwj4QykN9eAx1m\ncCNduKZcvUy2QnN/2FMO6NLJ0WOuXTAdWGKJYKIpCJGw3cYacd+9DrxNyfUv\nVqcQK1ko14qB3o2kgHsqTgfPySWu5rNJD3wTIn9jF94L5A1/MTFOjponpIzc\n+lepzLyUtFePUDqDMo6rm8bOi4521QMFyw4EveTDYhcUkjpTWO0v0J4xPYsC\nVd6fuwiL3s52+hZ47wOjIekAXpLWWG/GdYvyVVpZnYQtrd9zsq1nPSDd+HyB\nqenO\r\n=HSaP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD57QuR3OJt9TOaSFxwxWuuCa7tZ0vbFpG/orXl4fg0QAIgFH22YaquPrsm2uEGtnp6f/16pfKx6HhSYGL4vtzRNRY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-parse-opt4.20181220085459_1545296252728_0.20964622570296676"},"_hasShrinkwrap":false},"1.2.0-generate-repo-id.20181220110458":{"name":"@atomist/automation-client","version":"1.2.0-generate-repo-id.20181220110458","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1968c80e8972bf95dd9c433592f61d1eacdc6b12","_id":"@atomist/automation-client@1.2.0-generate-repo-id.20181220110458","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-2e9HDhFam0E1zzbyZuQdbIhZu23bDXKPt/Z779KWTDsECaalvnGbpPdP0YqqtKGGY7gVVdLSdlBNyUa6H10Vng==","shasum":"2f5dc01b227813e9e8030dcfbd29bf566d149e7f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-generate-repo-id.20181220110458.tgz","fileCount":605,"unpackedSize":4943313,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG3f6CRA9TVsSAnZWagAAmVMP/1HgjMP4CnlwCUjdUHvS\nWbEFCwL+wJuKT52SV1HcpkT5IyFrww6E+jfg6dlZhIaojBZquRXNqrzDib4Y\nFbtXMKiNvAYCwNOhqYtTrQ/uhc/14ciFHXlsr2vMqbL30bacyKbJuq+TVLDj\ncWk+XSmeTInAkk8WAwrhYigUx+Cfbl5okkJTfeSG7tXVezZ6yVYoEEcKWD3M\nsUsfniuT8DV4Qg9OJTKrZEPZ6L0ZCcoMV/JhNRsbYSVMr1cOpf9C9hmkXwLr\n2c1FKAstZIFpuKM1CxFTFg0CcOju381s0mkVYUZRQIrWxVPSK80ijvVlvkNp\nphxBj/EAw3WS3MaaeH87KNiBiAo6uXgq6gerS6gzUM5l6+Sl3jxV9w/LmbLF\nyLrQBCbwS3DvqE57OaA39P3MphCtklYCvTNGHd0ZbDHhCp6kX0wLOqzZQrSD\nCT5zg9cQTJ576N/pHnUrQlqu5y9GZwZKalV2/GCp3PD3IVypIXC/02tW0Z8K\nZ+3pOpJSBy12p2o/oD7KbL/yQkYiIfC7jbUbvlGSBRjhfySkWRkHUcQHfDaU\nsuA+sjq5u7vOZTvKidn+/BuGt5SZWWlKaToZVBdjz5mrrMJHltwK0glHcgYh\nUW1YC9nelcbeBibmI5SLGhHPQFFxveGGhTVdTKzuazseEWkEr+czFeVZAwGg\nOJKY\r\n=6aeH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkpUeb0uv27RrcBVg+QmJtw9WlqROOWg8lnDyLGjkmfAiAna/ImZnOhjBOYbmNMRqr+fdmE0tnx/er7k6SOQ8cHIQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-generate-repo-id.20181220110458_1545304057438_0.9698516345169375"},"_hasShrinkwrap":false},"1.2.0-generate-repo-id.20181220113107":{"name":"@atomist/automation-client","version":"1.2.0-generate-repo-id.20181220113107","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6a4f6bb1fa3c73210b6222a3c2951c020bf2872a","_id":"@atomist/automation-client@1.2.0-generate-repo-id.20181220113107","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-W+jXEJgwkBKLH/OeYAzDzh3pooXRKVkWs1NHwM3M/mTz2envk3GUHn3MR7XRwajI07KarXPQ/1OinuSLkWcK9g==","shasum":"4fa8bdc31fbe8f40e6f8ebb58d499010eb0ff393","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-generate-repo-id.20181220113107.tgz","fileCount":605,"unpackedSize":4944590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG34PCRA9TVsSAnZWagAAKgUP/1YWv6XUiDiZnwOH6cvb\nEd2Q4kJA5mNYH8jcoT56QPMo9VD2rAeJN6AFkXnSGZ5H/aTyaotj1dY5eQAo\nGIM9DsJvCCCwgdtLgfcoGJh8hxiyOxFBb7nmNAumMS4mlBFsHNMOC7xVJWRI\nj/Ljph588S6s8g+OZXhgw/UubzQk392QRma5iwsl38IEbDrGZkf27Ge5YkAs\nRvE48FXd61e+mrWvYY/DmcsmDFvjXVhmw/U7thwdavIUmm32So4xyn8iIeeA\nwvlL+3NkQXMVzLHpLqk+oEe/x9kUFS24RyQ+0Z0bhNMsADo2ej6mEtdpkJnO\nRDgr7bYv9Qu8+D2DFTW5jRDjcKOCbIpmvU1nYkqSDukVi9/4ZA4+WRPblwZU\np7M5iixJYurGx15lYt9SIod//HzsPisu1SqSaDlE0yie03+A6+0yNtWFqqhO\nK8xxXxQyt6Gw+/jg9xvZk7mVBUFV53s3Bu574i9k8R6+RJgy/N1xbXMgkkvh\nfU6wYRrSiqbfkKvXTvYVTeLKppnY0TZC1ZDJdIQUjwST3LM8BVUqMhO7a0st\nWo9ZkiwvxCHDIeg4jfj6ILMF4r8CdNEy3do5w9mlKTe4qbGlQKTneKkDuPE9\nYuE8xnl3Pir9sG1ivisZUNw7Wu8bwXGJol6YhdlyqzZ9n9p9jxRpMyOgu7+F\nTwiw\r\n=gPUv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdrcEg4/S42xYSpfCswOrIaNjucwynszsYC9FRthAIeAiBM6Botu8lMfo37PoF9D6xIEPbzmWQ6O8layxr0X2oNeQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-generate-repo-id.20181220113107_1545305615247_0.37358469453658216"},"_hasShrinkwrap":false},"1.2.0-generate-repo-id.20181220155148":{"name":"@atomist/automation-client","version":"1.2.0-generate-repo-id.20181220155148","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6b0705b38e999fe17ca19450e23af4b4c813e89a","_id":"@atomist/automation-client@1.2.0-generate-repo-id.20181220155148","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fMu3xTxWOoy4sVm3nZWDSgFCLND6Z+aPd52A68WEvy6ioPkmh1AL5anNNuBmynESbgeqkXtzYQPBGDXmyl3VaA==","shasum":"8ea2a6c980ff9db80a2520b1ed5753395dc9d8c2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-generate-repo-id.20181220155148.tgz","fileCount":605,"unpackedSize":4944383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG7tDCRA9TVsSAnZWagAAo0wP/jXYDZC0AJiCWsXgIl1N\nxYlyT5yWjNvDWYoBeJ3AuTTdjlBJGiyz+x2vgq5UueeVaxI5JrYm1jSbEWaC\nCnzNSxVkRdBQNSnd5rb6KhatAhhFmaUAcuwXOlyZnHicAREyKhyqKEuWk62Y\nmDb75mSNevK8mjs9/PZlR4H1ReE7SENrSwOutC8sdZXrb3urbG0ObDg3pGth\nv80ipLqpN60VT2qxoqTObBHMGRJX9faQWIUVVV2TrbOQpxDDcK3aqg2m3ykA\n/4oeaOd56/0cUxG/OwurGu2zWS8DyLe1LvFbWL0CI9VAAx+deNvZZZvum/JH\nfYPLwBfD/mHvtLLFD+j+Tj/NNmp31z0K/lqG11tbChM9BcM7Ip+Y6NmOVw+J\nkFOD7c0QaXIMas8ATCjB6iJiHBraeEReFRKLn94rjCryFYD+zHQgd28hUpWt\n2dv2S9XyjyiLa5lBvF1uX/u+b+1ONgPC+YxYNrKDiwsIRvVUNpXUZ2kSc7Tl\nykrvJ50vETIQPDWtOjfb0AjkQhx7cKNbVHxudM4O09E0u6VPvGRhoO/EllR1\nIdeiHst7EQlS0g0JG+BOD4bJTwp2yMFZFmDDJfe80cK33p5NW1xEFz0uW4+Q\nVllPkaRIaTWlENw4wFnRQen/gxobHRFEIbQvlAI6mF1IfgRCH6hHnwoWeCzA\nINC/\r\n=3fex\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoGLt/UlvTsYSb89QRRzU19tEZ3/lyNu8AzbLI/HMyVAiADdkucVn/3tAmh8bAmOClz9giLkS+2gK0ds/MiBrzDLw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-generate-repo-id.20181220155148_1545321282481_0.4667260082201796"},"_hasShrinkwrap":false},"1.2.0-master.20181220162531":{"name":"@atomist/automation-client","version":"1.2.0-master.20181220162531","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"81b05d6015e7ab2393acba1ee20e561bc163ea42","_id":"@atomist/automation-client@1.2.0-master.20181220162531","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-81iJeoPiiJlKmI8f0GGqLWr5r1K+rZncG3uK0x+obx7VvwiJlts/5hE5VYYF7UTFFv6HlLzq5joHMT3Fxmo/eg==","shasum":"92d4a5fa2ca506b0f67cfedfa7e22820644a770e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181220162531.tgz","fileCount":605,"unpackedSize":4945024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG8MnCRA9TVsSAnZWagAA/8kP/0WK2o2Hy23kQXsRASKJ\n7qXJllu880AAb2+NMCHSfIvnDTcu79jXk+N1zRIQTzri/S38wAO5fLzop7q6\nFI7RFeGo5nMIC6Tlumus0MfaVlW9APezFlrvH+r+vCsPxE8VFHKy2ABcm1zL\nB8KYtO5Sc694RgTmJvdzenp7s/NwApLSbUFjUzbWxxQkB4B1dacmEgkbTn1o\nmRPAmuFxhmgTv6RI7Y5ts++HcFDqvLl5mQlpzKHxrOi6Hy+00ZrEeGZ8woXa\nMj3kzFHfBsaYjF4ofLfmAFoBjFb5oTA09vkkYkn44pERjRI376lsPzyVt/Wl\nOHfyS9QY6qM7QYlY0ksRf7wOLrcbusvaS4v9g5BuqoUrJxylRYDc3tV9/qvI\nTfXCb7a/GNVUZPkHe5oLBzKnuoVtUB3rTUXhv2AQxKEPsnSfVAdFVz5zKOvb\nlgDxdIxRLHCbuURTMTa64uwSb/1mSrnRwZAoWD8+vLqqR1nlqojfLTGknhNr\nE3yCJS6ghSSEtTJ8YHY6JJfSt4FW/5ETPt2LJHddgWQag1kWemIkcyS51L+i\nqlpYANvj/LhTMgS+78/VVCKT/N8O4mrIE9j/RTfX1IcVU0zr7NccaIHW4Tes\ndaKxXXRM7bhQmhWdSXt6DZ7Rmx4mHQM+DPJE6s2kNoUo5EDXiCQpShig+4U3\naUJF\r\n=xtPY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBD+RKMTEoeYqzzvl8z8H0PJPZBnGO9JnVZE9+AjcIVjAiBedoWKqwWHTMBKC21lJobgoeoTvBdnf9syLKMd4R1vMQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181220162531_1545323302806_0.73008655119258"},"_hasShrinkwrap":false},"1.2.0-parse-opt4.20181220234545":{"name":"@atomist/automation-client","version":"1.2.0-parse-opt4.20181220234545","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d4dcba672a035b0ef5d24f223a8b054126155b68","_id":"@atomist/automation-client@1.2.0-parse-opt4.20181220234545","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EZTFJXlaATILKW6tPlEv+AxLP+PxLPhAD0Sdac0OtsFlHPL0jSJniyKazkjda4Re0GdCMaQoiX0V+GbXQy8RCQ==","shasum":"dc8bc04bd3abaedaf67bda49aac4dab89d814c6f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-parse-opt4.20181220234545.tgz","fileCount":605,"unpackedSize":4956379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHCo7CRA9TVsSAnZWagAA598QAJaHakJL0GkMeVRAmhAu\nzL8qRTyy8MVj2c/O4bFgJZ7IDXK4P+0hTAHcgAns5efWU3PNmSqLjPHs4RjC\nKLGXeq2XtXGthYHhKLQOjzhzKVLbSur773IhBKAXRMTiP53PlL9L87dmlxMJ\nEuLXlucPV/oorMaqMCvK6bz6qB0o8bixoTTLhdsfm+dZJJ7ErA1j9uW9PeXU\nWSzWF71G/AjaOymEd11knY0QQzgU7oLeRUDR+uUU3iCG0qzgSPwd5Hq6UnPy\nGKwApXCZExnu8rLW+25K3lj+hkujiHCn5u4yVQPJfWwm5HT5PpT/CQT5UGFl\n+KvT6E/qaFMnBECbuKYMIHwgPNzD1bjSapsYhlDsgqXdD7HhHnfhx0Crb0w9\nm9WjC/QkYwnF7UzYu1rHZPIPtKgLv1SkPGRRE8Gu8ujCC8xc013zAJLD2V58\nC+pAco2Q414aDrlZPm7u5UO1EZ2B1TkDg0YkFtXIvorURCPeJLj/JNWWjwV0\nUWhHR8vT2/4BMvyReeCDqRYtWB6k0EW6nt37expIegxC1nMaIo/ZgQ9lTMr9\nz0x+WcZZokn72aZIrJ/4u7LBGylZKeG8fGtBc99tPJZ+41QzVN8u+avw+I/v\nCI5XQSCWXQtHAmvHrBY6bmJO0+653WixSdMucphSjL28TACs3bFDBGNenLUh\nuyoU\r\n=6+vm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfho2FdKL/3fHJo0pzTkJRFXZkfVLH483qwq9SJ6MiCAiAn914davwXHT9l7xzuH2JOLdPtKfQpkd5P1UZRdP1+LQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-parse-opt4.20181220234545_1545349690489_0.5309611064723601"},"_hasShrinkwrap":false},"1.2.0-master.20181220235734":{"name":"@atomist/automation-client","version":"1.2.0-master.20181220235734","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"de42646c79b6f2acb92dde3e5574e94a490450fb","_id":"@atomist/automation-client@1.2.0-master.20181220235734","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-zvdlgA2tqJDJfE+FVHkTN4Mb+sF8uAEu9iEXsP0wyaaqUT502EVNF55OZAVkbGTjjePt/vKs8cHQFVrBqwUZCA==","shasum":"f61dc6164f9d2aa1c2a594ba9c8fc5830ef55ca2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181220235734.tgz","fileCount":605,"unpackedSize":4957980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHC0iCRA9TVsSAnZWagAAxk0P/1qPxkGt1PhnxUmAAPgh\nKK6WqUIXO7g3fcgsK7IrrAkiVoPLJhgt/uKpL30rfCRMYSq+Sg7p2PWnavd/\n7X41bA0ItsyqT/pUUIp5raruS9Ofw+TWgPkrxt7nrN3LehFrVCPpZjpiIpid\nbmlM85hCFNCTcJXDmcYlX+J0Ol1rh0htBlJc1+L83osMhb7gTPDgkuKJNdNa\n+D2UPYqFsadUFlZhcveu4RRBQeONJuLMOBwRr1kmWAYw9F2xT+xy7hFOu+Bo\no8ynEO2qSpnDckInxQLyCXm7teKQV81q6HGPKL4Aqf8fobi3ZW2NO0VUPYOI\n/q0pnkK1Ahs9xCLafRVjgWwTpxy9Jo0ye9sUzh1LDdYTxiJEZyz4mxxsWdbF\nUJiYOar+VayFvUvamrQRtZu8Ox2LPGEcUw7HG1nROMs/kJJg64cmCjnUprFt\nMINlODFFYWmZa8KQPWq5oiB24woIyZB9tJfcljCNqR4B/06Ak3YiEEPchEVG\nc+XHQ28UsMql0d1Ve2gvT6uaybrr2pmfEOw0f/wiHZyNsU/kUBIrxRbJKgOS\nvUVnAkwIVMK8FnRPVCV+Uk4oSDZJ5qzyir1110RnPUnR/42GxzcsoZrPlsdO\nEFsH2ZYanuyKJ88ATDAEuvQBt0Bgan99dnrHQ+l99MRZ0MdboRfrtKR2yZZU\nTiiM\r\n=Nl1c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJDQdJqxbYu6Dr+beTDgvEkUrlnl0byASUrj4rRvlcmwIhAI522adwjO6YBDyn2kQP2Z9KNMbzrUPlq0jBpe9lIpuT"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181220235734_1545350433532_0.6939001548798298"},"_hasShrinkwrap":false},"1.2.0-master.20181221193708":{"name":"@atomist/automation-client","version":"1.2.0-master.20181221193708","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"03dfd82db33eabefcd10925336d39d494498e82f","_id":"@atomist/automation-client@1.2.0-master.20181221193708","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lN3tvZi6FiX3726fpYtsnJ7cZQ2XcyUsIbS9rTsj94NoewXEJxQQIvgog1eP6dUtHSF5jDSKJdgrMNO3qra+sg==","shasum":"f226699f428182cfa650d9f4826dfdcf01b28279","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181221193708.tgz","fileCount":605,"unpackedSize":4958239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHUGDCRA9TVsSAnZWagAAFvgP/2rUJReEXvZMKIJb1C+d\n2NrjB1Nu7DQ4zNR5584AKPC8aZzDaCZOp1+wceANClct+QR0GwD90EtnKMmB\ngN7cL3TxcHUz52KMkuwz5FnTf9jtJA+D3snDdopbOYQtdmAx54Wu6cIQxedb\nmpIpgLcVfC1xFksWRo2TXYhC71wwN8djJ/q7diGb2gIjduekBSlDM95AnidW\nsrfYM6wl+VIQlGDhXmPRYS2IS4Mq1ikkzUk0AEdXQ6TSqy6UAWY/eT4Igb8R\ngRZVqdOupx8GLKLk5ZxqEVlI0iYzvoUF0TGt4djtygC1b2mxX7C9z6LhpkB+\nBM4VbxUbdAWkqV7K1INePpY8o91WuXnwJUZGq5ks5JYAGxlDjbuQy2PaTRq/\nAW6yfnrymzCKh0POICgJkIP75i9OVcbwUxRM0AqX8uRTOv1VEz+yNzTV1wv5\nSSekL71C/qDgSpwiBCBLEbXBYSKTvwsyDtdjlQbWk4hwFVYQp40sAYzW/vH1\nNyfSCUfcpTDuzTUtUZYJCuKmAI0ueKqU+zaxmHUDuWHRac2qNAUCAAytedN3\ncJ/uCIRV6WZ9hEWrQpmRU1ErDmYp5Zqb9LJNEaPe2rIBRnDTpptQChLq39JA\nFynDecZ8hMf1Nt1uBcKZx/fxCPJdwsrumMfFNNGc/REl2DpiuD+S+WBC/4kC\nsCEf\r\n=YLwb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXrmXlmchKBzh+mu5T8ResPORHdW/c0w6xRwM4CGjRxgIgFhMDSEexVhPiUT8vjRrjEpBggOQBSe4zrRtEiUNALlM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181221193708_1545421186354_0.9669886968081627"},"_hasShrinkwrap":false},"1.2.0-stronger-typing.20181222134305":{"name":"@atomist/automation-client","version":"1.2.0-stronger-typing.20181222134305","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dc6023265ec6c745c892752ab88c4b10437c0f68","_id":"@atomist/automation-client@1.2.0-stronger-typing.20181222134305","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HwryDoDg5LGZlLRz4YSVZWKrjxDux3Tl8ABS4DDSOl2hPwDfvkuAYj8v6sejKhSW7aT/BCuK2V7StTMPMh5wWw==","shasum":"6ddb0106a81ccfabbffdefdf9b79c70375d050fc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-stronger-typing.20181222134305.tgz","fileCount":605,"unpackedSize":4958319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHkAKCRA9TVsSAnZWagAAgZ0QAJZb2CUDh6qmAdCU0hp3\nHEsr5j8c/ZVDNnQrkkZr0ijS0MaqQoXW9wgLRBOkmABpEFzAey1sQPkcbQ+t\n6y+0Ihbpk2WlskitciZaCdDtMyz+JcNAQjQrKPcCmhZYnYT3DWfqcbb4QICS\niD9CDi7nGMng3DmcN/sGZ4M3ECUoaxCWKpwYqQhNJzJulEda3DduyMpQL60o\nBcO3Z+C/lB4v/8d6BQe97SkLTPkmwr61eI3yTKHKVeWNdvHDrULzp92sJLDO\nfwP3hWmp0qk4XdSMdTyOdUIadmc1fLUEJwAZyxDR0co+9Y7DHE/C0EApQQta\nXuLfWPAhy7D3/Fvdw2yPsA3Z1G79HmIm+VgYGdgDwK9x79yfP0PHYe/E9nvD\nOtbKelaGRUculcai6Dw+NYY90MkLaZEIpyQcjKTEX6WrMHsUeIPBmZdSQHlb\n2weCEnDbFpG3XWQVBPPL/0aAEM3RESUPkO0aPrA+HUW3WqvVwdev9zKl8SxO\nxLDQGOwaztIR7uo4mvd7aP8x5v1Y5H8CTaBz3vPeDJOvN60+D/pZm48cCE2c\nA4gMg9YjwxN0dG9UU3fla9ZNbyqaiVAbvldmbhqGkn1Vf3Vk8SaWgJ7aUx4m\nGW8A5+8bxhE2N2gt4SzDbU0m8JYjUbDg1NaTGuDFz3xQ9LDaf+Ulc2fmFfNo\nF0RF\r\n=AZPX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDR+h6/pTFqV0CUbRK43D0lXpsFXxTxF/zoPZxq3Fl4jAiBINZFACRvbWUwOdQfu2wNuaSbxmOq4MrgOEcyqWrMKQQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-stronger-typing.20181222134305_1545486345952_0.233031271513094"},"_hasShrinkwrap":false},"1.2.0-master.20181222154357":{"name":"@atomist/automation-client","version":"1.2.0-master.20181222154357","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"570adbc18a7b04990b8fd4a53a58cf5643dbe927","_id":"@atomist/automation-client@1.2.0-master.20181222154357","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xhGgdFQ4AShTnIQl4XaavLj/EBpzXkRUmJe2PBqCPrN5kef+F1aJmGDAHYMDfb19Wr8tsGlhNgGQFm70y3F9cA==","shasum":"3853243fef4372f66dd3be665362ce2953c28a83","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181222154357.tgz","fileCount":605,"unpackedSize":4958566,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHlx/CRA9TVsSAnZWagAAUcoP/0GxGNNeNeCxGvTD1mCI\nFCmoVwIBkzI5b+MbLG9xJFxMHOeBNQrj8rdS9zDMB8EA5hS0WJoAbz01CmCC\nRx4n0PEkWGCVytoWaQJl+P1qlB+BWoB6y/GO8iAkt7BLw8pBBvP1LzxNeZxx\nw50G40yBTjuCvKCtJZzinCA6UFZrWg5CI9NxE0s7U1yDd7O4epUuHh+1fb+C\nKd7VDAZCpYFOpRDJRuNKummXguSlHNV181+UYif59XP6D7CEZLzQklkC/I5y\nIWddAIzlu+1HkNmJmowryUWOpeQUJrV8tVb/rm2St5Ep3TpKLY3jCi0pyLVv\nQEhdRFLqevdgJy6O9Bo4oYtAt19K1P+1tZrl+0qFqgdlDwAUzBXNR6tDRMO7\ns+zYaOt8BcbkLpqQH3ievq1Nt7zAQiT3PglI3Tmvgq8MrL0XHjacDsMVNg2D\nfI7IgHn/7VUl7XVx1e9vVOQD9S1m3YbaaJIU7ljAkBfEcj8DGPJoQPcfwsHO\nSkrEECA/h3qzZs7xu/ZT395uI/t8gwOuboIgb+3ssNpG+TDdczdGwk81PhGU\ntnoMhBoyzx8IDgAjqz7vEBuvTR9BTU8OETIr+ubxpTMaVhsVU4jYxSc042Ac\nvhm8DHM263yCvabh/+uatI+RAHBdZuv2+17bvGtD7TNcEOQ0PGgWLeIytdrw\noYS0\r\n=ufy1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFA+F+NFbX7AOvVRX4nO+J0oy8JkFVIcbnrCW7cxGi7lAiEArOwL5fwbglRo1gVSmMmhFTZhlwRhu/U6ZX/icTqiMEI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181222154357_1545493630439_0.2309374962125923"},"_hasShrinkwrap":false},"1.2.0-master.20181223121728":{"name":"@atomist/automation-client","version":"1.2.0-master.20181223121728","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.0.1","@atomist/tree-path":"1.0.1","@octokit/rest":"^15.16.1","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.118","@types/minimatch":"^3.0.3","@types/node":"^10.12.3","@types/passport":"^0.4.7","@types/passport-http":"^0.3.5","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.0","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.0.17","apollo-cache-inmemory":"^1.3.9","apollo-client":"^2.4.5","apollo-link":"^1.2.2","apollo-link-http":"^1.5.1","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^5.9.1","https-proxy-agent":"^2.1.1","inquirer":"^6.1.0","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^1.10.0","lru_map":"^0.3.3","metrics":"^0.1.19","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.17","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.1.6","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^2.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.0","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.11.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e2fd2afe7785654a88766aba5e769763830bf464","_id":"@atomist/automation-client@1.2.0-master.20181223121728","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LFgwZ7IB9Ttsqb8x11g2hwU5PfVHgy3U0Yxrkf4FGh6c0Tx7MG7XNneaCYzqg0kQLvkiUJnQ0jDVkPYfviBWpQ==","shasum":"1ae895733b9810a1fe6a9268c049268c97a49aa0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181223121728.tgz","fileCount":605,"unpackedSize":4959993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcH32ECRA9TVsSAnZWagAAWvYP+waAPAMWghTRWAPLmvvX\nc1nEvuC0WHlY19Kh1Z7lDctzgP+bLPRkfD2w/Cc74ZO+0jFl3I8YWTSJ0cV8\nGZkjK3QAKZzXM7SMGfSNPpzdyligBBQ07obmun4Hzc+dqpAyFuydvFuwvkic\nCxENcCVNmtOJuhB4BTwN4B6bUfwnSgbMCjpCgK8pXXlIC9OK17W4hNCfBN3Q\nKXPb31VmTN/oZWqIa7AYBVCpcNZb/npXbyD8+LlqJwPGDp+ENl0tyYxDQsw3\npzbpU/NsqLf+PUhz3Bm48nNsxs52wepKcLVAW2unTPBHVg9FRM3tGuVo8ouY\n2v828zjfwDx/2cvT7L2J2lJG/RnH9PPCAUlBmcrJ0CZa+TWc+mOmsFQknqhk\nPP7XA5CWTLXPioP0usctWLkeK15rFySOvgMz28THnG026pMtwV6SMcIcoPaB\nGL+fHvCvWDsotk0G1Zs5zzLvrpYgA2iJt2tCh5lOGM1anKy1dd8Y8t2/wmgC\nu+j2ItLY8qeEi3lVS8LaoLv5jUtrhNBc9Ue+Mu2qxd8xfrpYHOa5g04FuXKr\n7tHjCrAJJ767Tz2bfE2+c0n7maa7pket2Jwtyv8iSt+zJSumQOseYEXCvsra\n/+WK5je6ZqzOy7OZ1+N2Ebi4YCO0o+1qo6XcOMjHK+OCd/x/3cET48TIKE68\nOE0f\r\n=t+vh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIC5amifRQwuDMuXhriL4FbR9j00xQdh5P6QHZR8VkmQIhALYiSZ1QSYGiEWSFrlREVx+scORAVJ4tJxfEkGp7FQOJ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181223121728_1545567619840_0.5452078151801907"},"_hasShrinkwrap":false},"1.2.0-master.20181227191104":{"name":"@atomist/automation-client","version":"1.2.0-master.20181227191104","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.15.2","graphql-codegen-typescript-template":"^0.15.2","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4c6d006986c38bee6483e961cd768baac0ef59c7","_id":"@atomist/automation-client@1.2.0-master.20181227191104","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EGXWmN12AKRy8V3OscLMGLKt+96yxCdw3OpoqTYSX5hn5AwMd1pduQRBKp5YDQklgfjHtOnclAlvJGgDys6+7Q==","shasum":"d5acbb93d08ca954b2437b9ce72302d52fd35c90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181227191104.tgz","fileCount":605,"unpackedSize":4978174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJSRqCRA9TVsSAnZWagAA9R4P/1EpqQk8DTCuJHf0MP2B\no0PuDGjdYoNhFTko29ogfcKJ8gbsrPpApiSFxGFlp15nJ6KIvHvDRBiBIcNu\nhlNEzinxtVFiaYDGAuplbj865ZyFaTMfNaksXYUYW03OHBbbowJLCmULsZu4\nxcXfgeoR30AsmrzfPu9adwwr3qefO6m70jP5XCTYWAUw1+EfHuwDDOXl5VvH\nfqrkgoDA8BIcJmf6fzWlzX/aMBW7HpVjN065NxWWQIfj02lprjbHZ4LNrp2m\nlSiN6+Ov27dBC48NuPNJ/o0yS5WrOlpz4h5xoc4t4S4/up1ayeWeTQKbDSaC\nQEV6xHQfM6LoOnbVtLr86FHB1IjKyf7TyFRhrr414JQ+xCX7TKF3EU9D+TfK\ndO6pcJM3N/IDxy++E335XtQfI9NYvyk3xiHUtYFrUOl3vH4H+lOLUyxuDGOR\nnC5RJDsHH/PQAzadFOj9B2fHnhmBgwOIDqLIUfRl7+OiP9ZMff4HSRY3Gsv7\noFdBPe+Pt2j7mf4l7TRB362Iw2hmZNCCSJm04W7CY2SvrP+7jtaple5+GRjk\nUkJ03WZ57M3/87uaRIMHnaQZIPMUDS3FTTX7ar/NQ0Kp0Tx8LTLP1jNeLEiU\np8NXyIsiONA+9Wh9d60e20rlaMMUHpIEerArSscrG1UCt7XVjakCjOcpdzcj\nR4j9\r\n=J+fF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmd7OaKVGbqRQteqEAfpy8gNRrCUz+KaqYHb6bCun9UAiBx0XiwCz3xzogH441T6wd4L2pc5DBDRhoZbQ8dRIhPXA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181227191104_1545938025736_0.6533617398490841"},"_hasShrinkwrap":false},"1.2.0-master.20181227212650":{"name":"@atomist/automation-client","version":"1.2.0-master.20181227212650","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5915c8262823f9e3a3b38ed437e7d23c2930767d","_id":"@atomist/automation-client@1.2.0-master.20181227212650","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lh6id7Bj7qSn+wcyWS25P5FamqYSFIlEp82fBSg0y+j6HGwkIW3MLKPR22heX34pcWroezSaAfImk0SJ/JLDnw==","shasum":"5a20247611abe1b13c076e257a8068c6638cf666","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-master.20181227212650.tgz","fileCount":605,"unpackedSize":4961498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJURBCRA9TVsSAnZWagAAD/YP/jFbmRkQaTQ8Z0xyEWWE\nAJqqD0o06cqHdSGkYK1R+T4eg8aeg8WCY7+IqLvUbb07SYDKVv0YbckxBxUc\nccB7W7DAo0ink6dipQdaf5XM8Nd9iAcf20Acdd8zr4BAoGsL6VdDgm1zO3WE\nbDIv6bPdBrmq8j5OOFbbqB6lscM4EJr6yOLiEjOq13fWnqZ2Wu2t+RqNtQfR\nNVEmKdzY4h0ncTISgXKvgVpYWXp11mJ7WCCfXKfrGx2j5i56TJszMGiJeXnL\nuxPRbfS2b9f40WuL0AC18soXf+b8ZFas2QGyO2ojZYL2K4nUREXce4eGvfJ2\nn+Ran6q1QI4Z1/woHgCrTFYHeBaKD/FbgA6DWVqeXgydmxqj2WTtrbaXXfT3\nIaw60p9VT/xEXu4TxP4jdfkgywSvetB2wlPOHIjnkqzx6pOb68j0JScaiWcJ\nngezyoQJhszvYurfO6/4uGVli3nOz62Y2BFr+6GqVjuumCZuejJSYktxTtyl\n5lWer9pPMSTVWp0AvydnpF0gFjFsbd7c0sE00/H/VLIgxX2nLisTncFAJXTa\nMP5SAn2ggvZ8UuBt0HiZBhn1b0k1kmvOG2N+//vyJ8luVI66+WY0IIvxX41C\nTGw13jFnTAHu54+I05LudtwYpyE6vSDJ6xW35FHzAlrhmolRlCURr2eMw+GV\ndqg5\r\n=IaSu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC311hlJc4etXg/I2rw3zPYPcJhHSCi3ynHEC6iukmY8wIgBV2jrV+Wxz/+lgz7Xe3Fxi+zPOGWcEdFzWIubeonkBU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-master.20181227212650_1545946176723_0.7995795084745754"},"_hasShrinkwrap":false},"1.2.0":{"name":"@atomist/automation-client","version":"1.2.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"5a46ef70f463081e491becc10452f36c21fac061","_id":"@atomist/automation-client@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"11.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1qWefDBgLcDGq2f+X0fiQF/X/NUwllZcUFfv71cScYoy8nrMjYFa/Axzduur0cmk67kx9r+gKHS3ZydqK2iD0Q==","shasum":"85d6d0080c65ed9eefd86e8b015d5e636ba21733","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0.tgz","fileCount":605,"unpackedSize":4961476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJUsECRA9TVsSAnZWagAADOgP/jl110GvIrvyt81yAT1m\nrRJ9A3Lt6jUDYvl5vLXc8nRAHzODn2E9jvEg64NGustywQgkwmN9oRK+trwd\ngnb0kUz0TDYAEN18kR3Mtc0H5cQlzm7DpLclH0nNj/1Wjv5LTj8CM1rQGtke\n0ZxhCtOq/FSR4XpFGAZ74LAlfwjQ4dGjje++66VMlcGDJAkhJPXVTx2ZOy0P\ne5iqm18J8CNsXaT88C6/iI6IudmEWjdBAProMOIFOh7ulqaz7iSg0BLuOQ2R\nWiOnEHPcdjEWchKo44OyJov1Dw6nWz7shx0PbI3o9j8i9b6GFVFkRQDUDq0K\n80r/XZBua7aOQNouZWyOqk1QS1xCO+VBzq+pojwllW6abcIuWJ0DAJOd4QDu\nB+S9vULuGcMl8akCgly7UIdCpOZp6Y21JP74Y9aLwERKH1MS1ztqQGUXz6ZX\nboZMe1RJKFFq6OwkwNe1HqC8uv4RdvJBQp2AurPBwOlla1J+X3y/l3nnNQTw\nEN/R0wbOv31VuGiFl4iPdQOE2Z0devhC1FxIP/TfJBFLb0eAzTjD9ER3LRxr\nkCAsdY8RNXt+HaRl1xjeN42GBd9Y2TuyGYuFJSZXemsnOsf1PQHHr3WI7DFI\nK/7DbnGOxLayP6CAhgBWapKA10d0lE8qKac7wLZ8UgdHEgRO5OLiK2clyDBe\nEPfI\r\n=Gu3e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBARMbCkYE0DJAP8VQ6rPL2WTGlXx8J/UetmxLAomjVoAiAZjpCJhSxyVhRb125zy58MED4MGBbtL6Ma/K7Jez3ybQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0_1545947907723_0.478575947216918"},"_hasShrinkwrap":false},"1.2.1-nortissej.inMemProject.20190105042120":{"name":"@atomist/automation-client","version":"1.2.1-nortissej.inMemProject.20190105042120","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1a2b3f6ee3b805bb2d405f8c813cc1da425c95f0","_id":"@atomist/automation-client@1.2.1-nortissej.inMemProject.20190105042120","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oQjiRcbyDKKZYCSFGbWE7r+cdI93nZuv1WewYFvUGHNnuwmbcuum8+xwtIXX8hCIjJWlELNWQoil7MHWcGGN+Q==","shasum":"fc4f7461c16cc03bee1bf8968d40804700a6d4a9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-nortissej.inMemProject.20190105042120.tgz","fileCount":605,"unpackedSize":4961806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMDFrCRA9TVsSAnZWagAAD4sP/2JVjY66uvf5gSpXhdtK\nEcWzBeiBBx/kNPijAtYKE799e/ggnsmlgjC7XgbtQaeFV0YwGzHflVVnGV5Y\nl7slm6r7WdMY5ssoEMzR5EfH54xQD2961+/AQ0t7v9BcN55YawnpV8QWa2NP\nomCXfnEIzO/A0hP2yJvdJE3lf5+9CGHRlQDaOv9UGgNbfsZBhwiPTRZ+LiFQ\nhbYe8BC9o8LI8wl4JuxZG7GjiNAUKsLeD2zSJ+IqA9iyOksATtpXfq2/FVGx\nyj7bQHP2EbYJ/J8gr1ABPsuveTXVf59CTAwghYaxmhO3jftdo+bcRd6m0UnB\nCK+aPkyFLstLITgOZhxp0QXOImQd12qsXgnywqeKueGWfetrWCasus7g5/Hi\nnlgLbuujGaKgmfscSG7vKFidzOdCRM+2yvnWP47BmREbkJf/Z5TaFWBjLoXH\nwiJEIpEawwRBXLVuJlBwSwL4zDo+T0tboPMmHPqWOFG1D0KtjprLzNcrW9O0\nTGshdCy36skWSso80sOM01UQasExtpGmPb02XFKf31+0TUEVNAM5wZMdv1AN\nc3jl1rrVljor50VIXpbpmuE2gfYsldMGHjm4nAUu8WFTBlboCZzm7DoeHicL\nNkw1Zhj++89H2W4pLiH8I1slybOy+KGMSLaJss6CtogybGjEBHF0A2BZgywI\nmZEJ\r\n=yd/G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSGrPmWjLdR2KpS1tZadzpPsheniXORoOgNL6W243X2wIhAIcHLScwHgWRY9jeylymqMg0gJWGdywSNLgy59oOnjKU"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-nortissej.inMemProject.20190105042120_1546662251228_0.11448214468438112"},"_hasShrinkwrap":false},"1.2.1-master.20190107091947":{"name":"@atomist/automation-client","version":"1.2.1-master.20190107091947","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1262e3d77276ea319279fd5bf7395ea61f23ea3d","_id":"@atomist/automation-client@1.2.1-master.20190107091947","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sph8BinW+XJbOhRI63rHMyznizcJhXdK0eVYK2N9nSKOV4numt/fgyWMxOM+CTRH5qW51TNpmEWYkGLSBlnlqg==","shasum":"1acdc0c8684fa07fcd8fbe4c2a98b7a4e9be8155","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190107091947.tgz","fileCount":605,"unpackedSize":4961909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMxpOCRA9TVsSAnZWagAAFggP/0+51xXZJ/lA+V9QbSYj\nF+AB+Bdt1+yNb/jrtrcq6++ZF/ZIARWB4g7Z1uAUc8MisTvVU37uV8IA824g\nX7iwfNRGKtsOC0JQ0wzNdS368B6fQn6eDC4hzOqVfBz3u5XkYhtebeA4Oc7h\nHdfukZhshj4NxaUoftcxg8QUT/5bnFo5jCYzWdpEum8GZXXGynbGwJLaULRo\nnieJX5VQ+l+Qn/KVujm1CEU7woja2btocIkC7x/m7pDLq4WJRwGWd7HXS1jI\noG3N8/dpCaYRS+BKSA8mB7WalvXccDG6FcH8mrp5iq9b0dQlQLSEVIshhdh9\nV0Wg/bL0oo1DVtChdZpqI34TQmlCF9nuwD1xGZFzOzL/U3Mc0Sw/n+kGxhpj\nV9/aeyF/f9zH4IssD8ISUyFEICFzEZkgWMUUryx7L8/+oUBipsJHGHINlA9K\ngajFaUM8LA7WibzLCCL+1+8hnxdyfnc8BhBKLxEJJhhvHP54xZ429OI34EKc\nsctq53dxdUwxvpsgOsv0qE7NCVEi2B6EAo58kpLIibpBr2d4NKFLo1898Fy+\nM3j8TQhWhJZ73KASZ227yhr6d74Al7UsR9pKf8DYXdydGaHJQS+17jQbfURX\nVnn7xKZ3BvY2p3yyJ3rke7023Z/aeTdditYOWv890UZSoKxQyM1HbcSdAkxG\n3u09\r\n=Hcmg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqLvr286jWIviYmejUsCEi52/dLdsN19YNHvp7+fLGTwIhAMh9D51OdDCVVhwwHRvrEtgKVaXJva8lyVXb3DAUrbY6"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190107091947_1546852941167_0.3824391023103657"},"_hasShrinkwrap":false},"1.2.0-remove-sha-branch-defaults.20190107091943":{"name":"@atomist/automation-client","version":"1.2.0-remove-sha-branch-defaults.20190107091943","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"aa56f7db323722d1ec9779bd3e9f27d67fae63fd","_id":"@atomist/automation-client@1.2.0-remove-sha-branch-defaults.20190107091943","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-d3V7OT2qGf2K+l9iEtO+959FmZcxuzV96JfQLCxCSnNWZwBrqOROp30B/Pi/+NTV8tHkNOpKP6/M+K0kKWkS7A==","shasum":"cf03e90b212a711d1a11a5da2d0029e9e5a9b2d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-remove-sha-branch-defaults.20190107091943.tgz","fileCount":605,"unpackedSize":4978205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMxprCRA9TVsSAnZWagAAIU8P/3KLck4eYTIYgPVTjWFu\n2v+/Rdw2HKsUt9WLKnGWAXy3Dnr7pGfHvd2nk9p0BxWQiHsWbUWY4cheSs7R\n2HCKQtwW8eoIO+UfL7ekZS138QIqpZuW1KpPqlInKGzZgvXVos/TIj0cbT0N\nwvEqXIdAub94lcS7n9iBpfZS2jwKjiIHup3YPlhYUFgn8nkVP5NJh7RWkObj\ncneSPZqlxjJUDjnUVaYsBKZNvRnAvkbdYwVa7EydESnPJs4YU1dAdkaV4+mJ\neX1BI0PQZqYa5tZwet+nB3BvQQnFHki8s634LsSYvnXLL0ZyRLOkRS/HFSuC\n/Lv9vBSUG+ufbyhJ7jjsgntKubrfy6Pk76Zxoy7vS/tfLPS5pZJX4r76Gk9E\nAlRhsQGB3obG+PWtegOJdwMIRY0E43p06Eg+sO9+lBvQCv2WJf19ocQ9ORxM\nXnljEGnmw1uPk6poDxAJXSS9bZyyOygAeLSOH09g5EvPklBDhq8WokFZmppW\n74XMSAVQ3Hh66rXiH5RwWhgpxgu7O21Vc7HcC12biKMan0m/bQAEAWIvQivP\nYRlIU9D0N1ipyZFbYYuWgwh1B0MNrOO45Q6I0YJMS7mVkcljfGhaEmytvu1L\nSASVPtQpuoc4b/yrSZUMxK514LSBasUpb4Pln4nUSlKsXH9u6ijGRWxBvwSA\nyXxA\r\n=+E7b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2tpMDYSWlPKjCyCQBW9ljSN3c95OCK3gIQ3t2VWVOnAiAzNCzD0YMaVZ4FQUZZ27b4LEsezOGlEWH2A/5zpMMinQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-remove-sha-branch-defaults.20190107091943_1546852971076_0.26475163189695294"},"_hasShrinkwrap":false},"1.2.0-remove-sha-branch-defaults.20190107104041":{"name":"@atomist/automation-client","version":"1.2.0-remove-sha-branch-defaults.20190107104041","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ccda6c95a958dcc42567ce8453b44a760cd02db9","_id":"@atomist/automation-client@1.2.0-remove-sha-branch-defaults.20190107104041","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JuDMYpjYeer9iYVgSAlptBy/KCvo+ueU+tCjqM+klXZvnWwvOALP0QrkKOjTgkn98F9mR1T3BepwysyhATl0Zw==","shasum":"7b13f8e20c003b6e52e15ba837a51532f0c2872c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-remove-sha-branch-defaults.20190107104041.tgz","fileCount":605,"unpackedSize":4978444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMy1YCRA9TVsSAnZWagAAQUEP/13uEw/aFoktYalRknng\npCKD/L2PDKVkHNMvrh2LpU6mPbnamvlEq2FuJbZ9XV1eiXVsgwP6AJH+gyHH\nvoDyv1NyWF6a6JGvfQw74YrPI5dIQuctAPQgPjYBgubU/raaJPIMYPSy7OKf\n+7jvAfKrtaAhmxfU4Yf9KmMrqn99H4LksFyUQXdPFkDViK343L0Z+ylqh3Y0\nVsiiwxDr3iQsdFUVxAYygqQ86UFKIUqyD8Ycc7MqoiOWftRrKxu/rNOc1mbq\nUZXMsYo8oBJxPWNQ8Rehy1OHjBbKfhwjmEQUiG8tQg2+Re55rgo1639IzwIa\na92LYAjkEAkleWzTy3oOU+zL2b1SuQo8q1UqK9q2z0XW+/J0de+Y8+/V5Br/\nHJ0305p5e/gEAkQClnTfUoGKtER70JJ6Vkn2S21Les1eKa2GTAlJnpqCheUN\nMa38lwIKX8q8hlLJ6qj+qyxrKwFVGg1IVD1YSx+53iNrC4VV3t+WbOusOWUt\nwaaBh1X+BuOfa+b3Sw9YlPu9P4lZdhw5B0l8vKmylU6v1+Janj+iGxDYLbA7\n3xQAyEUwAdy2xIP0+5gXLjYAsWnRuPvXWhv1So+Plzs8W6025mDaLWBy+nn8\nSA7CwdA7JPe9SxgddV2BEuAL9eiH73jEliVCCIF+O4OZ5xI/gyWkPV//4Q4Y\nKFP8\r\n=Cn8s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDFzOEoh44VbI4RTGycGFgTbcG0MmzhWRx5He5DGCdENAiEA0CZLdMk0eVMA+GUM3O+J9aREzEicBcJ+BnzcKowN/nU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-remove-sha-branch-defaults.20190107104041_1546857815389_0.4053250337513048"},"_hasShrinkwrap":false},"1.2.0-remove-sha-branch-defaults.20190107105804":{"name":"@atomist/automation-client","version":"1.2.0-remove-sha-branch-defaults.20190107105804","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fc645f09d3309a7ddd6dd91a45fa5b8446586650","_id":"@atomist/automation-client@1.2.0-remove-sha-branch-defaults.20190107105804","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-R2VG6Imp7DqcHt8+hHkFsr2xVV0eRX065vVmwXM3mf/ZVI+rXHArvi66AkWOz3Pslfj0OP75z/yqj+8XL3WRDA==","shasum":"f541ddd84ced2d065f270fce9ed06fac25e5cb81","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.0-remove-sha-branch-defaults.20190107105804.tgz","fileCount":605,"unpackedSize":4978618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMzFXCRA9TVsSAnZWagAAxwMQAIglLtA6XHM7wNzDTlTX\ncHAKY5KU9nMlB5FCzZh0fKfjS6ZhtmVXVT/vNzUbatApuD1d0PyEpeqx18PI\nhWz61beYicEChfbxfY3twYIcX5YdJhWh00gjIoxNft0XmKNZ9pVBCwutZqEt\nVA1uqhZ8/XgLHMqfixyfGQm8ejFusytnzMKPhzDuzj+ihN85HQ4r+eR55wOO\nCp0/XJRsnQQ95DfNSXOYFrFhVVlATZTZbCd59UPH8r+JdvbmiZuN6qX66O4u\nStcexRTQtYrZoGnR/bLI71DPBdNiTK9fh4HXwGWTpAdEki6rA8/S6/UhAN71\nbNMVTcjJWPgsmQppGJl77PpYqR1Bi72pIWUaz9zPdUvDVLfD991mwMF5rBuP\nTQ4k6Jq8xcJ+jetF5xA+7gSin9W385Iszdrtcn6hUxUG9VYMFznBS/T3fJlc\nHeRcuDM6FKDRVZLGWYY+iuqLxyTjVSSnV5ymh/hhuvQp+MDF8sgYSh9iWNM2\nluN5MsYh+fPlS/pV/NXFwSNGdYWoB7VFZ7CiVcTFY8lixieSEFltycP14pXu\nqSs3m6po34t1souu6FvXwonylTXfqmbPKVsPDSXHOxLq65bOJM70OeGbeuhr\nWl1PDN0UDIALeczrGtUWAVdSKPvYuBFFiwOaux6MO6cB+xY1DVTqwsNcMyFP\nDT5q\r\n=aqb1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBfvCKIclM4eUpENWC5PYY4wSZ7zwi9a4GIZDH9xJN/AiEAr25ooMZTpmJHHWvS/GW8QET2Im+aA+1yGQVFjp/lAqM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.0-remove-sha-branch-defaults.20190107105804_1546858838403_0.137056418609806"},"_hasShrinkwrap":false},"1.2.1-remove-sha-branch-defaults.20190107110335":{"name":"@atomist/automation-client","version":"1.2.1-remove-sha-branch-defaults.20190107110335","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b1356e25e39103be1c01dd54567057ebc8e0e602","_id":"@atomist/automation-client@1.2.1-remove-sha-branch-defaults.20190107110335","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Ysb/4QFkzwRx68rYgZe8Ai8k4XEyB6sH8kz8m6wv4bh10xot2KbreEKk5GEgL8h2Uu8YafPFF0fh1rEpXUOtnQ==","shasum":"90b87497cdcbd8c2e2338523d7ed4ddb654f05f6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-remove-sha-branch-defaults.20190107110335.tgz","fileCount":605,"unpackedSize":4962353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMzKhCRA9TVsSAnZWagAAyawP/39PYiaNr2NGV/D4rQ9R\nPgQnjsODy7rnsaXJ8NMChgoqDkfA0/oQRO+1J8pmDBUOmua0AssmJKttQOKV\naK2nvtpdZ9B+3FW+J07nWTkRClEKSWNgp4PhM8j23OZf16wlQfrIm8uQeZC0\nINC9Rs6D9iLGoHllfqOq4I+jk2RIx1oyWCez2jiJVc2Ujc2b+NSIEcfTnA5G\nFY/hkZaXQEPC6LZLjee2O0O+EBU1ier+HxL00yO1F4cJvlGG8vpPUykeDOED\nrusVA0tRnP7B7DK+sR0ri3kU+QokmHoT6nNaSheGIrOVIQL5dAnfrb3vC9Ho\nEr6aEgsePZzHTL3O0S9oZ5DX/834Wz1tBGObdPhAgGysfFjWWPa6gYPZ5HV8\nv8h8347lco/lHGDR7NkyP5jLqAUY4GkLuf13m7cK/zqNuFK3cgSZZzpBTqyp\nveVx2hSUmTaYmpEhChlsBTijUuElKQfMTpLqf5LJ3t3gOLeQR3L1rkX53pyr\nDrreCyOwUOYu7jlJ9o6vc6C2f472IsUro1ROITo/Um6PaAE+T+cyfM1crx8I\nUKJ/5meuyWj0QAv8LK12cyNbm4MaBHqP71sAPC5Umn+AHqlEx6BO0UjX6JL4\npLnhdOd5xR5B8fwp2KHOjWDtQo203Ze+6E9sthvMyCGko0GdlPnOOp7Oh+8X\nuURI\r\n=Fw3/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbHA8kyyMg35P3t0juae+vamZe9aiy5bfurpRZLrT/iAiEAuID80TbobZUDbykR1Xln2OQAznxnnMnvNNGr1/ReXMg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-remove-sha-branch-defaults.20190107110335_1546859169167_0.4980097353587096"},"_hasShrinkwrap":false},"1.2.1-remove-sha-branch-defaults.20190107113217":{"name":"@atomist/automation-client","version":"1.2.1-remove-sha-branch-defaults.20190107113217","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dffaaae15589f13182b2229e47eb06b27a84fbb0","_id":"@atomist/automation-client@1.2.1-remove-sha-branch-defaults.20190107113217","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-IP4VgmBN9STiuqcJnZ5dpef4WbaEwtkXonX/tKHgQtBC50J9vbeharnFXU43IrU2FP/09VKolBiGPLetRISvMw==","shasum":"1e5e1edbf189e45da3b6649b2267336cd54f0bec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-remove-sha-branch-defaults.20190107113217.tgz","fileCount":605,"unpackedSize":4962359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMzlRCRA9TVsSAnZWagAAs74P/jISp/BKxsZMf9918TtT\nwbHYkCHcfI+AgrXw/g5HTzWLFIWBm6gVxpTS1gAl7XpwCl4uqyfI74bzNSQc\nIQ13dV8A5B8leF51GaNY7YNmhOiAhTSpM5/Lp+jFD0aKwHsK58xy9ohH0W8w\niZe/o9f035rWJ9TyfZG0gqOQxFwL2uYepU15cqDqeMtEa4GlrDJDJJUczcaC\n+QmwmyDVAf+4EqJyaiCpNWQn2+sCEkOpTciUlsHCsI4NZ8CoJbAZk90I/IDl\ni8EkoKf9ibIxEJyjXYNrwsEWmTaRozsabS6+Au7+AQxMFq0HKQoT27Ss7oO5\njNXx0hYctpNxu1RTfnBjgUan5l5xPMvCpDzXAUbwoXnj2N9ewbRdJ/C3TCGQ\nscfxpvnuI8ZFGp9ChquAHCuuEvyiyddzf2WytF7Q+LR7AKPAckLpSI28a56M\n7/5GLwNgtqr8QAkHFNBJ1ep9LS6dKIdeSyx+681zDNhyTrHuKNgGy8TqHGfL\nKYgHJ7u+OvfrmvHsTomP8PxmnlW54AlSsu6EB7JFNuGuh4PQUTHNyk23RR3Q\nvbahYKg7WidoK4o2D94vqLX9pXw0nwU0F3AWiRIvuhfjJElXbHv6d9+bhVJB\nFBJRYooWWOOeREgCjRkzFXej97kiKhij8GZogHa7mkgGDuELCoygfwjzUgmU\nOmxs\r\n=BAD/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGUwNaB6PxSSow4YemAUj9Q6IR+L5E4h0YFBQFDZ806rAiBjXU9pOv9Lr6D8i19kKjwHmWh/fXlCQXEn+d8EkT33/g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-remove-sha-branch-defaults.20190107113217_1546860880932_0.9182933439535759"},"_hasShrinkwrap":false},"1.2.1-remove-sha-branch-defaults.20190107134738":{"name":"@atomist/automation-client","version":"1.2.1-remove-sha-branch-defaults.20190107134738","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6fa988bd6f44f1245a03ed5d6886fc169d734c30","_id":"@atomist/automation-client@1.2.1-remove-sha-branch-defaults.20190107134738","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AkxrZusPF/pZkzO1Rpv6cWKJbvrKu/I9g70SvKawqN9Yqr2RPxW6rAwtmgO45ZkNXcK6P024qrhJu2Jl7shMsg==","shasum":"0260bd3b0bdbb9a14b80907e20ae447fb49a85e7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-remove-sha-branch-defaults.20190107134738.tgz","fileCount":605,"unpackedSize":4962393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM1kYCRA9TVsSAnZWagAAsvcQAIT2nBREYlDYc9f5Akib\n6aycut6Ijh4QlaJ0n75CXxpPWhM0ZBY+UiLclZ7x8exjZeuW0+yaTsgpGrIY\nYez2dhX5Fi+hDTD0CP63ybWuZGxiBp+1mUNI8moaKAFim8N4d3nvyfQNvvEv\n5KcYnGNGrJSg+nskaelTdNJRBchXe42lESWJ7YPlSReJBleW/PZWkrgf2cUE\nwv0Oy1Z0BaIQ2od1ys71D2W/h9ciS9XE4WXaOZEZS+uZN/ACITpWpYQZRoor\nvo9ELF5WjuWaDl89ggVnl4Fgu5IkuKLWp7vAtHU9DkRjgvmUbiN2O4pWHwhN\nftfOmvH6QYqpYPZmm9EWekkhxJ/VJceE9g1jHfJd1uzGGpzLZATs3Rul7fxz\nTzP5riiztCo4I1tVHrluKauSfPX10ZG050GYHKawrIZi5LFF31z8uRlhQogp\nkwUgLhmX1Ud4uRaUCvlYF402znfCBYalIKAI5uc5ZlqKXnRP6gyLCNCE5yBd\n9tiAeFz65IVroJpWxbNc3IaXg23pzxeoKiHwzcEwnv8qrAUOlNU2oUdHGpuS\nmCyCJFHehPMsUBapJvkQGBSisFgGxy7/HRtAYi5T1eTJxufHZCiFU+kMJLqb\nU4IZ+BN6XgL6RRED3xp3fsPsjDFRtQQs+amq6KEIAQvwgSNqQ2xnr8il/7sb\nmjCG\r\n=qsim\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcnjC7Zfu5J1/GledQ9U0kN0R/e8wIpI3zW2VDasKm9AIgV45LYcsr8fvWR0d1XhKpcrf97VieWnAJvkBebkQ26N4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-remove-sha-branch-defaults.20190107134738_1546869015727_0.296620654679858"},"_hasShrinkwrap":false},"1.2.1-master.20190108010118":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108010118","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3b63b49d4c4292a673e57b1548802d8102a75b93","_id":"@atomist/automation-client@1.2.1-master.20190108010118","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UqsmyI4SoBCpGJrV8GW21pI+OXEv5FcakdrUdg/eR75TCkTHbT02XZ9vUxELpO2fOCBdmo8sbidMm1JbJvMlww==","shasum":"e0d78ef697410af60c791a25d1d85e5a3025ec1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108010118.tgz","fileCount":605,"unpackedSize":4961934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcM/cbCRA9TVsSAnZWagAAlbUP/12hAuD1eEAGnC4K/IHV\nmq7LLV//ygr/9x2JYN3+0ownZu+VKXdWDbIbXR4E/IT4tOJGcp3O3XRMPJlY\n+zAkQdnwpM9MFryEsLJc972UQ3UjS4V6N+wloei6Uw2BoT725/VHvUYlh9+u\nnhxJb0Xk9QUtaWHdoGp3qNyDYRgVoc5b0KJwSEpl4RlUTErMgtyTCQqkq6nx\n1/Z2zP7wITEZXuc3zHRZS1xmrw9hoZayvp3VE07043LyTzb85TIe5/hmSTqd\nHIpPc7G7vR/sLHXaTGkfGTNAlm0OWHgGfmEIgaXwjb3dVg8/QDcdxIIgT5Dd\ncnboKgpvuKKlCf+zYKIjYU1IZHrxRfcYXFATOHwEzsplxSx0WYF9rFC4mrtY\nzrw+1m7QhH338RfLIq9X6uhvxTx7mtJGcDhrp1CUxdscHqoCf74JmZRNHQmi\nH2NQaj/K24A3Z5eT/GlwB8qcZlorWX7r02PgfMKTpm3os0RoqJrnbyNp1If1\nhpmf+lnPBh34C9sLIE9shygE75FQi7VAh48syYjbWrwwnIFjQpxnSkPkyhiy\nzANMnc2+B+Q/NswFvpnvfvpInp1DwY1Hk01soufBr0d6O6bE1RjeNVRis9bM\n5rFanaq/VbVmZv/8u90N+/1GH7tfohPoBDir57Emo1jq1whpAXjxMxmCB2+e\n+ahu\r\n=U4im\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAd5hTiCYfIBHT0AzlJYIzFO9BhLJWcqmCwxflkGVSmWAiB1WcqClhKpdBzRUEEtj1+hO+gTVW51lV1CW0cC1vEFGg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108010118_1546909466713_0.9161909211630823"},"_hasShrinkwrap":false},"1.2.1-master.20190108013928":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108013928","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"deb8066c8a3db5248d1a307dfab95a7d064fd882","_id":"@atomist/automation-client@1.2.1-master.20190108013928","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Iqdb9j0mCOJAuz3R3y0vWimNrrv5fBjlTf1Ma+02qdc/Qs5RLnUFbfkpfshno6moOTl65T3B+0+X4HzLFDpfKw==","shasum":"a4d989c890ead4bff3b0a2c3d921f4f1c3e61267","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108013928.tgz","fileCount":605,"unpackedSize":4962320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNAAICRA9TVsSAnZWagAAu3wP/iLAFAwXj1vagqBDRJVX\nQxXE11V4ykJFP/BH7VzHXHWk+enswr5fcsBCNYSURuSWYvXzz2HCLFIq3iPB\nm/sg8WGYtzIpvLph4sHT3kpCCMXY4JUDjCvsnz5Txa+e+aEz1AzZJQB9FRz/\nFECu1kdx59gA6GXvmF7Jw7/4Ti0Lle0OlcDi24JxrdcfQzgIFTXKShJj8MiO\n89dT+c7EULAFxy4plNk5llwLaFrAv50j71q9Uy1zcUpuf9Cw+FwZUA0KK6yQ\no2mIJZPtF1RLRX5Wn2mCTYZwozVKJl4XsHiHkbuZIHl0PpKv678SYawn/WDT\nPY57XBMDk2VJXpkxzgWur26EOMBKTYqmojyMOTdYd4c9wC6PC6WLauWFv9wF\nuXYr5oErJy3/ycLgrcUpqOyhReym2cqhhUf4zZ+Xaf+jtMgvdV9NWt4wJ/mz\njWJdnYtBy+k3jsvK3CZDoFkpxcSJrOpwZkXO2PNqS9a9ed/zznaAuLOi9Kso\n3FH1UAFz7702DjGa7+87GALNLsFSPFB0kfphs+hvTLmN8kgEJhELmzWmHXN/\niRkLQvSm6cPOfN4j3EKT7buCDxSnUPTLv5g2kX4LSR8gcHxdNmpYVdVGHNni\nqjz79uN1xeiTdU+qITv1t81xBYz6ZqNtau21jQmsgNi1sK8DS+FnPdPUsvNv\nmqIM\r\n=Yzwe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECjZiR2zyTwSYz1dsbhCHleqEyTtqj0uxH2V4MdEpoSAiBbnWrJdQjV7NdsGUfAptXPndIzE5Di2E88RFnk0B3/ow=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108013928_1546911751448_0.3143854672868598"},"_hasShrinkwrap":false},"1.2.1-mutate-iterator.20190108054433":{"name":"@atomist/automation-client","version":"1.2.1-mutate-iterator.20190108054433","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"66bc1e36fffdf4d6c415e8a5fb997c933cb24fa0","_id":"@atomist/automation-client@1.2.1-mutate-iterator.20190108054433","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hofkUnl6mW5G8775G6acJi59pjDaL6BSKGaz1JPEyQ+gHcTWKViOsLhAvOFiMzlfv0o2fNi5/FIJl6X0NDGLPA==","shasum":"ace4d06b60bb5356905d82544163027cc0fd1d5e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-mutate-iterator.20190108054433.tgz","fileCount":605,"unpackedSize":4962938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNDmFCRA9TVsSAnZWagAAPhcP/RA/jH3F250cOZa1ntYs\nX/3lUtBvMJg9HwsGXrPqSpDtCQeGEJy2/7l699TIjkVVq1RW2qqS5ZE+tgq9\nZf/srOp8jDRyg6RR5IPd1zmi2QtgoW7iFqYQJ0ddHuyyUWfuKkw2Dl5H4r4I\nwbqIT/htITfCZYNpeF8H7W3XXUuQOh21Ivo2g8F/8JTjRkXjd5qDbUHtlcs+\nGb4uYnoEazqL1uuJMkseWrCjH6F/coHq8sFfSiAwO20WtnpfE4roNRz4IClN\nSalRd5RznyceygMrgvEWPr9paT96szgPnffFsF8WQ4BrQUpypF9zunE2TlxY\n571FG5ryAAK3Ywcd3xvgk8606T3U91Bc/GXP0MgUb31eWVXPMDX7UsIXaIlu\nepz2Y2k5JLfAQEVf3bGiyyxLyVAynv+sGHFZis7nVhdmW7EO3CJoOpDLVRMG\nPc/LNahUIZ9gwIMg81Gs6tSVGYWOyd36m/Y84FA8JwQN8MTXwJEca9MbA46o\n5+7p/U1+BfeBxnt5uraSzHAr8x+1MUsiZuIGglByNwGEJNIhBbAXhWnDZzHh\n2Pgt+3cJKdiFvz+eTQQIGxOqaRddfcYvGpM6uR6Hj+kwiengtpHhfDGSwGhz\nw0OQ/CUNQksC7+MxLf0K75WdsTEBV7sGftP/BwfLPoC5T96i7J+lwshVMZnn\nE+U/\r\n=Ihmp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqpcMCn5TeCioMIMnyNSwONYIIGgSNdDZeZqe8+pqBlAIgXRTEhMEiYJMhnvfIcHljald/SQ+2PoiG8fZPUNTchec="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-mutate-iterator.20190108054433_1546926468960_0.17271457971835047"},"_hasShrinkwrap":false},"1.2.1-master.20190108065236":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108065236","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f0ed34f32979af43c41371d76490ee9a73a95457","_id":"@atomist/automation-client@1.2.1-master.20190108065236","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rJ/FjEAvTjGMQ7NQ+EhVhpz1VIcR/Z3FVWRd2lk1+qecX4m4ja0c2wXKpqSMF5Ipgno4koHjp34U3jxk5C3wSA==","shasum":"efeec12ccb29adaef655eee3e186353ec6c9e61a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108065236.tgz","fileCount":605,"unpackedSize":4962320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNElSCRA9TVsSAnZWagAAhxMP/AiO8Xhhy6VyxkKyUo4x\nyjBXDuvtV2ZqQr2CZTSvYPWsKUUB3eoI0IbNjVQReMw90/vSyKvOkZrOeztb\nvT4+4PlQz19ShwfWtOBrXVrk0/kW4B7arHq0EVy72m46oR4orTVsJc8hbzhC\nRe19WzptkCFqvbyNJAKCt9b91K4ZMjaX1IanAcUCGrfz7lZ26m6ycUX6Rze8\nrmNCvO1UZ8ioCIJgxWXK3JxXb7bVNK6bhFISNzEy6UwClu7X5bx1NAhcUNOM\nImKmFH+54E5j6e3kG7T5de+td61FVjsplmq0RoK9TC9nfYXlM0eVrkW3d5do\nXYi/CXdwgBEe1+MbbVWn3GFRbtT5FA2rov9L63x0MAW7W05t0yZTPvyOpDLC\nIfLHo8r6fpBiV1B5PjIJns+J2ItPwrWdEsXA8d2FnDv41CAsbh/pmt5kkhtl\nHo3eJwcUuOauNghQiKRAPgCixXBTL88/bMY/xm/0MTEspcsS3iip0XwPNFGz\n7EtWhvlf6rk0H3KnQhhrPfUpbnF0QOQKt7AAxLpVJCQGWLiRXGYQlpDvEXjd\nH71IHaOmcoHuSNuVpLJEbt6Rwu+dneYGLkBZSKYTnI1i4OAs0KqalryrvJa9\nxn4SRo/gB6IFxd/ZHF5kbAegK7lfi+7XdlnzP3V8tZFOHbxOn0lQLBu2YAe1\ni0T1\r\n=um3j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGj1VTymwD1jLUCNLZ50yPOKl5P/YRo9NdNrtaEe6gpgIhAPWBKWviBvCkXoABLs5SHodwRrsU1nRJa0fmVvUOqlg3"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108065236_1546930513251_0.25556227838512746"},"_hasShrinkwrap":false},"1.2.1-master.20190108133858":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108133858","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"214e2fd99578a779232f7b433ab1f3415d5cab92","_id":"@atomist/automation-client@1.2.1-master.20190108133858","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-wJ8uoUsTncAceZEYvgKTCEROJ0Lgdfp0fX+Ga58ylEC1Y6rlKk0ZmZ7esjD2PduYYeAtzRgcO56F3/1Fcl3WQA==","shasum":"6a874eb23c4254b81caec8f0345fe75e4c4bba0f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108133858.tgz","fileCount":605,"unpackedSize":4962332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNKisCRA9TVsSAnZWagAAZ24P/2d/husGaXgjLRLucRhc\nslZ/aUqWK7pPuR/sCmzQWumg+jeT9K2oAswlOD4ycx0DY1PJdoYvYEeUEU8Z\nXAi0ySokrfsqDTnP13yRhLlsMtDNMUpr1cgm71Ft9AxxJQvie3KVsWWZ9hXx\nOgP/04ZMftA9x6ZAzwCFVl/l1LhSFWYWqAhPTH1WKE+XNHLD2OGZr5bETWGr\nDxA1mST+Y5slg6iO86RS+4Mw2q2V/cQGi67vgXAzw4RD7XQuF4yjL446YPSo\nskz/UKYDC0IV+OC1uc1GzOj5eXgkF6lh04bBtphioQWFmnreVEqVmGX4H23T\nI73fOg/J/KX196PGXF9Fynwu3/IIo+6WUcmGcZuciNn3P5GBP7AZLMPZQMzG\ncmtxm3xzKTzX89xrnlcT1ucRW2MhvmkkX9r8+ETe3oyIJoiI+blqqzlFD/NB\nJZ0zAWObpYmArbKSSmJxrPuoHQ8eiPJxGFPv+rF0/sYu0ySRzsQWJZum1szk\nT/u2I2sKKxwMImmWAh1beTkkTzuBOBsvXWInrNY21DHoUQCfhB16yHzacl8C\npY6tgNWvaW2zIWXOwmtw+t5LytgjIRPWxA5mhdFoJ/jVdnQaKR2ErWPmdcD4\nzjx9W2JAD1rdSU3elgrvOrVAkZHGj4LvYyi9gxTyYI8rb96dm5X9xYxVmarz\nXaO/\r\n=3U04\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7Fljr8ZqpQPPTK7RWVTBI/wdjvaYosie/aziFqJMOGwIgD08dR3loSLkFH6zkwB+Pn+6B5Fwd82lNSzjlnPEVdi0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108133858_1546954923577_0.7935261780467786"},"_hasShrinkwrap":false},"1.2.1-master.20190108134942":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108134942","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c6eeff177a7fdb8d193d05298fbb333b0fe4ef34","_id":"@atomist/automation-client@1.2.1-master.20190108134942","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-udT/93fnC/+o+Eo6GyhvrmgjmsEoHmNl+sbHkcwChsHm72AGkDufySddMZd5H2xEYs/MJ+a2N+PQR+QAlGLOVg==","shasum":"e1d458380f487c2b1d83415947e0cc53c30a4990","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108134942.tgz","fileCount":605,"unpackedSize":4963073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNKskCRA9TVsSAnZWagAALbwP/jsNXFOcJ2XlYczXGHRr\nFXgW3oKmltZUl3N0tm6viYoPS8PQHXWG8q1xFXymjNPHuuZsRVVdpZBPpdlV\nfFoiO1cEWWGljfSyj2TgnE8Vtr1QjWAV+eXhu6bMArDTZcRj9bk9XUl82WEA\n8+/rPe/tK+iv8m7RPb9Ii3//VN/G+/EbYNpX3T0KMm47RV3ADA3ypHOoDD6J\n6dIpbe+udiy2Zvf9CLmosty5KTD0NoTh3CPqQK+W3D8CQ3yM6xGlXdVFb0v0\nU0ExB3fWOcVvRWWOHtsbAZ/+mhGcKdcVllhc0z7n3AcDRaohBrwmPlafS6W2\nIfw7n6x7ua2YBBLXn6dcTaRlm/wBO7DTC7qu3u5bbRapk26A2ZMeXcIdCfIT\nKZIr1R8d1H/mF8YzgByUa+qQbUqTa3HvDohE1fsjDAI3M4xWijl8dJRQl7yu\nwFXBmmIRQzkOAZt6W45Xx7i6r4MKsDteRmt5X3y4WCDW6LesOWeycrd8c/xf\nzvuPRx+bzID5j2wkTfhAWLmdTAXmNWEtOS5Q6/xlCy9VrbGAiFVZSruimNxQ\n3zt3hXtKZXrJRqSwI2tP4uEQfhpcyvdQdO1n3kFSt5MehuJFJ0EtwouExb0k\ndn+oZeCI8069KNiItsTmWQp8YBkLCkw+OJkxZ1PC6c36KmyeLgNxYpc94tpK\nh1Ez\r\n=rdhd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHoPX7Nt8YR8KvJM7K2BOzdwXGPOdr+ZTfSL05BwBlEgIgF5p7EcXzoH3a4WjSBkhR3IobSTl0+SWJFKVKaRHJfkE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108134942_1546955555677_0.10330147550522195"},"_hasShrinkwrap":false},"1.2.1-remove-sha-branch-defaults.20190108141045":{"name":"@atomist/automation-client","version":"1.2.1-remove-sha-branch-defaults.20190108141045","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b33951ffd3d011a8a397598af9802eb21e374556","_id":"@atomist/automation-client@1.2.1-remove-sha-branch-defaults.20190108141045","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-u2K979iUxwetwmXfGvIsL8+tMAD/mWByo+8CtpBVGi1YOcUTH355ox7fMSOhstaw/I3QOGYalwPHoge2iJr1uw==","shasum":"5d06a0e76fbd5f912a3cf7a57404365d1aa4aab0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-remove-sha-branch-defaults.20190108141045.tgz","fileCount":605,"unpackedSize":4963557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNLANCRA9TVsSAnZWagAAy1AP/i6BKukGyH8pMmTxxCOy\ngzaH02A835E7St8/Ov578FVEz8/UhXZsluQ0PFaQVfa3GbCtfxsddCp5ZR1M\nirtjDvR4Acmig8Q51g0WxuZfdJu6AzpAeV+frZxQuYxzgwf7uiaou2Oqof7V\nAZuNcsKKuqFYyk5xJQb6PPfFfZo9rSzx8LoA5Yf9UCYaCdLhrKDhlgQAmwS2\nxq2oDlG3VfUuR0PzakR9YkNbxsLuCWklKbT9xFuGVvhBfWhL9E4srPX8Fb3e\nbPKq05oCie25AXLz1M4qATU5fIFxjtbq0kjAjhK7m7VO4qj+D0B/jiQXnxt4\n8dBYb3vDu0NlvcYNE/5WDa39w+KYxQjCrGgE6slZ75nSfMHmMQSJxEQMulSq\nNuxnrLUyvmNHUcESI8RGMCNJkqeIHhFAsI8orzXyLksuvGV+4Px7JWUwohZ6\nFT0xwdw+Ud31SUsIUTSXLFS74X7O9BQDLrilTWS0SHkeNl4UDIcdW5CdUZGM\nUJLvCttN9KNy0fz/Lc9X01HF6okggQF0cwj9sYDtYkDdFA8OS12Mf+rmZ/is\nTP40uY8atvdT1BLrarEJabZFQ1l1PJ+Rs5GYvlBjRIIutDBJ5dOBu9WkBE5s\niQqcwC3VfxiKz+l/3OIi/Jki9QBySMMhnt9pdpqrKRPHoykjQ3i0K8mYWrrt\n5HHv\r\n=aQlX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyvkRgiNTE+oiyTP3yvAhB0IuGd9LQ7AM+nyXyqdTQLwIhAK51kuq/WEG9jPlP1asZiK8nufnjWx038d0mz+4VNIwg"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-remove-sha-branch-defaults.20190108141045_1546956813042_0.19846970751865323"},"_hasShrinkwrap":false},"1.2.1-master.20190108142541":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108142541","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6d3e323d8afe99f5dda8c475eb0ff604048f7437","_id":"@atomist/automation-client@1.2.1-master.20190108142541","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-hfS+fnsRckeoHZfFG0CN10+JXIASHg6ZIyOsFrIfktSGsW+Bky4CRVhZ4kNWE7DruY4OgwV06FY53c5JBs7Lcw==","shasum":"4822901ad5522f47ae3fe4b8697b7eb85378fbc2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108142541.tgz","fileCount":605,"unpackedSize":4963668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNLOXCRA9TVsSAnZWagAAllwP/2cdNtN5V/vQxTdZUk2m\naUmA36JlXgeoDRq89QG6uN8ylSADAsUji87ZptBShwW4uIGXxViSMAggAxs8\nZsVTNHibaGUIP2lhC+oAguMEUbELPshxZJEGGtTWLvG1hfNPeLVO/db6II33\nEmhW7w0DbiErks7X2T5/kZ+CBfaGRXd22of6L9PET8Aagl/tczir6JhwB4j3\nG3axwt1UB3wdMf3lvBgy5C3yBArQ/NHwvgOZv/+8Q5FhX6MpCU1bMCQDFmBh\ne56AgjFIb1ne9/GE7gTsudZ2QOcIiaZippnkOQfaFm9qb9jaKeWRb0pIPWo5\nATMaDMGO6CsW2jk75/E+Hw162zNr43j+YvZi0fjPY1UESivWC2rC9DQGNhEX\nIQCRPHZvuviWYX4e5609BUlG8y7uH6OiMA+Fm9/P8o0WTfeSF/KYjWulTZue\n/XwlfhsKvaKn53Rozb/elzlXRp2cgA4SyuWMSUbPQiz8rgpwT6KOph5mAHxQ\n/Ble+HBIftmSeOCvhLAWbArBpNyvleMnSwev2Z9cIp5Oa4wYtqQMkoYMAQzr\njDgkBx+BPkw5zUim7P4oUzt9DpRcZjBhD/AcaD9TFVwDGFMTGa6GoGAvOyXT\nnnvZTtXERhWZ/qoGEbUKhiQCi37Gdjy13UOatrm9G1Y/TMvXkL7TsmSB4EXC\nS4s9\r\n=Cxuk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjD2M6wtaXm4JlzNItqDT56nvHn2SF6Ctgi2tX9RaNfAIhAOHlsmQGYo5zNNwAyMr2z5nrfEn/VlN4g4m+QVwiGGDP"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108142541_1546957718452_0.8158597686879789"},"_hasShrinkwrap":false},"1.2.1-master.20190108154720":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108154720","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"157da60a66a17a5b20c829fae4116f55728d0315","_id":"@atomist/automation-client@1.2.1-master.20190108154720","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WC1HrmkanDLo5nCdaWCo59UCSq5IPuI4Idkg46aTUyBiIRIXnr4jIp53vxUJ7tOxR6lpD6/Gr+jiiuZ3u+bYNA==","shasum":"ff34014c48a03c3eb7b1a51d2384857b5d2c508a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108154720.tgz","fileCount":605,"unpackedSize":4964304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNMbeCRA9TVsSAnZWagAAkXIP/0NvE07SYomA9+y+xmXu\nis19PQRdRZjw4VbU7hiHDdIrFyuOb4X7VtOJy4ruSBeuvtUuIg+bgYiyAcYt\nE9JT/n2WGPWIaO/qgKHVCVrY9psM4uQ4eOEfUM9BBCha4HnE1jylu4w1qHCW\nWPjhn1F7K5vAi9HsXtfn0UcUp/DD9j4+iyYrX6m171GRX0soQXXl3IRnz6lQ\nXDfHZ2rS37jm/Cc7BmZKkfYUKja22MkhUqkWvrqrrd7nOWjJILMmSJA9vUr1\ns0aYq62xF/qNR5C7PuMDKxju47wLHgaDuCeNyKvDm7ou8x91v3tIqe3WnTRb\nyhaE4hhz3d8X1dGasQ4B975uolVxXhe/Wo/E94JVKFXIBPFE8nlrQmmyyx7L\n1hFNwuuU1kNzANCEcp1EoShwyBE33FoccR+kG+suacwryIwR5G5n2jdW99ih\nMkSOb8RabbsVbdBCzKVVtWUussIpjPjnAS4Gdlr81evKm4kSKMspnhwF7PPw\n2QFMXDIMSZSDQQtkbDYL9ro5MeHiGYEhGeAYjl84Pu632kRAP6nh9wfQWdgw\nYqN5Wg0eBxfVIpjBrg0uqEwf6p6kSugktiMDrsS05ixT6xXUVKVZtDAhQlyi\nFj8I88zfkL6XhPKhGWJVHcjGDBD/vnjuCDN2WHii2r/qffu2mBZXHT1Nk8kt\nPjDH\r\n=hU1x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEF0FopwtoakhQJXvddJroh/r9Ak1M/tR2qkLaobgKzwAiAXZG6iWbnzdsgPY/j0g3kfVJn0OYwS6V2lOJi2LWMRGA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108154720_1546962653853_0.8715318662202878"},"_hasShrinkwrap":false},"1.2.1-within.20190108184155":{"name":"@atomist/automation-client","version":"1.2.1-within.20190108184155","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bbaa4b05d56e2aff152cfdde78d37262b51c5f8d","_id":"@atomist/automation-client@1.2.1-within.20190108184155","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-08TUDShyOyLIXtRW9S3ditpm9+yzwJaVn05JLWJiP3LD9LznQe/mraQpPTLr3/QbIbJTJauBGevfklTeXe7vMw==","shasum":"68170a672725eadbd8e5bd9901bf636a98c40dd4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-within.20190108184155.tgz","fileCount":608,"unpackedSize":4968043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNO+mCRA9TVsSAnZWagAAstsP/jg6jllfzYyX0A2WaEep\nFEY44zw6SLFrVJ3qbWg059c1UpVT7VSfSXt29XMnx/DbMg9+tykJFSs6tcwn\n6U1TqyQwwRewjJbAd5pITWSEadK32Qg2O8zbtJxRen3DIkm9cm0Fg8NL9n+Z\nHekwqJcTFrZFN4ZnB3frM8cew1aLFffOCmT6uqYNJbxlyJvPN68ZTVnykjsk\nbm1aNOHUELXd1JGV88suVtzeSTgIHpQVGq5acSr3YHfWrEUxlgq6OM3Ddb+1\nFeYjvBMRmyaYmmzUjkWukroiJcASc6TT8k4odwIRiT4OLInQgc38newrl7YY\nYDCmp5ZFQG0O5zDnZ96SpImJiOGKYTgIP1NKCpfdtUsM9SeCkD3OHDwBY2Tw\nmiy9GONfQr+ufgeO5ag6tBuH6hdtdDFdCJuRdBGgrdwWX+d10kbVp299KYna\nIMzghEjRwvLMoBEOP8PgP4DjcGc+HsSgfZ3s5BwoDL3Ge1ukv8x+PwBWQqBq\nF4doucRMWSHUv6hmK+xuEIgASrzryL8Q+bMYoB9CrblP8NpNlSfd4BtQ/CRq\nAEbahV3dm3HGTafoEaGT6c1mNZIeGbP5j8DMcMrthMYzwrU1sdVXo5939mIN\nToIhjtfhXeOSPAQ2mobrnu36wsWxc3P4i9bRn8C6sD1ousZ1X6utK6lRniBZ\n8Oav\r\n=vN4B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1Nsrv5Ya2lwwFJtNtt3apDqD1ChfStggntO7jFz2OgwIhAMlYpxAUwdMYaBZzOpDOM1OHinwdRSuNXixUAo9AaT7Z"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-within.20190108184155_1546973093660_0.04232860387383064"},"_hasShrinkwrap":false},"1.2.1-master.20190108234425":{"name":"@atomist/automation-client","version":"1.2.1-master.20190108234425","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"77f51fb294dc1cba043524eb7b706814ae3db717","_id":"@atomist/automation-client@1.2.1-master.20190108234425","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-EMmdJsiBmwz/CCGaECs8Om7+6A0CB7bvYJXngLmZhbWRiNyrj9BNPPpuO6j5Halycmv3EhJNT6NBMlj7hmAVuw==","shasum":"eaffbf290d7416791afa865a4d7a1cd9bd7e0739","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190108234425.tgz","fileCount":608,"unpackedSize":4968043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNTZ5CRA9TVsSAnZWagAAv+8P/ReQMBKflijKuhVqVU9t\noGpVBRVihqePf7ZIV0+fEH5559dxUGhk/vIKJMMOY9t1ohZTXYmYKyMsO89D\nyncF1yV6EWnMXTEo3TDAC0eu7/XY3/fM4EUHxM7zrlYAUXhqXm29Z7hn0pZI\nLTsU9B0g7rUCAWNxmyEXiM1CmiGA2l/aiLF5WPlMPplfay2RldD/pzhc/LVf\nY9aykD+3cIgP+USgJfy60ZHVkD5muq7KRTl8UiRSHjHwpYKNWkH4r8DrDm+7\nwNCz9SxYYRYRRcd6rKUv0aT6bzZyeYgJiZsqYnPpl8aR0wmdqt0hJWLni69t\nfCBCIHPhkdd3sGiniAFuUrtiCFIcLCU6Xn3UtrDrfQeZ4A6CEXXm849TnXcP\npE1y9j4Jq+PzsOr6iC45wfsTZA/6yXJGmD+geiNco/ZisI/zIqfKCEQOoacA\njC4MZ2MSc1SVeO6T8qmy+ZzCf4dHy1vGtzdNj8bXB+3CZy9cv/NivgRgz3qE\nhCJzwHOBOyWW0bVEkI2Fkc0uld/AK4G8elIR1PWojNILC/YDKPZotKAErkgc\n4+50I4rEDSM+LNGDoWg4QQleyMCenWRqECDeyacKvxtxwRvtvMmkTvK94k1J\nZTHpBdS7fPkjj/LFFiiSu6Hh5IyHgMtf/eTHQHhKuacvs8FpIHEO4tXgFnhh\nBEOX\r\n=FVSS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGAwy74pKwFUpXmyosCTQzZc5YS8AEHhpr2EKuGKxPC+AiEAqKHIbFh01UXot2ZUwwc+NjvhM0vvIEH1absjvQWyyAw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190108234425_1546991224173_0.8715730206275498"},"_hasShrinkwrap":false},"1.2.1-djs-number-params-ok.20190109111042":{"name":"@atomist/automation-client","version":"1.2.1-djs-number-params-ok.20190109111042","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b4fa63b674a97b925494be58e64d971084007e5f","_id":"@atomist/automation-client@1.2.1-djs-number-params-ok.20190109111042","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-dFJ13rj/pAaJ0J3XJFiZlXT+D3GyyFi9kIgl7i4hLPLEi+bPQLm0uZDeMn12zBsVooU2oPqlNufeazB36vP8Zw==","shasum":"c350c9a5643bbd27b93c0de307432ca587ff259e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-djs-number-params-ok.20190109111042.tgz","fileCount":608,"unpackedSize":4968278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNddGCRA9TVsSAnZWagAAFDAP/0BNenJXUUdy7ty329ln\neFjzD5Q2osnhtBJIQoCMiWH4KnI0HcRQRTgEec6kaasaywlvNrVMxv5yEddi\nTB7r+a1Itqm7jZNiAlcI5z1cIaBl3nxq0G+1EskoZZvKmXdzR/WynTprx2Fc\njxlXHc5ujTSzFMudgLWL7QHAvFd2/js/VHGMUYUd778YgPaqGXT+c3NXyxD3\nTUOO5WjsPjgXZ+8Uux2YDYhULPymi2LaiysVXsvXxw9qWeIL2LgT8qHaOJcS\nPkGmCzzaed1SzZoVNAZ75XyDW8rTPcGxOpIev+R+ORF6M3wg3wEV8MZ7A3mc\ndyk/qFCljz9OXYzKCGB1LjKT9ZuL7ZgacCofDANfVVOhJYqsrcfSmqoY4iIS\n2ZRV6BpFBWtg5IGtZ0OZfV5EFMtl9TvYKhgae9J6ADt2dtd0wL3OM2HQ9qX+\nUJ1oaNFXXmktJWSLTuSN8vxRUTaRtDyh+EHmXNCbHmvIlZic654mVr23iyyf\n8niJmdE4F5NUihUtZCqUJwI6i9Jz4/l2/SGpgRfZdpnjrkMI4UI82f0H2dCg\nJuWSkzj9Ag6/ZY+KjHXEhj45Y3d0Xerg+mvKEd5ABPyJ+I8llW8fCWW2NY2D\nqx49yB4oIj+1muKPmJTKbvL3k1L6JI70iY83R7PhyeiAvRUxlZTWv6jF+0QY\nMTLX\r\n=9qsL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzCMBtJJJMvZlpenv6aL+R/S2TVRSvq7vVKiUSTxpCIAiALuj+EhFnIfLWxj7jvWrdL3LBqAlIeRUa5xKmoAXvjHg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-djs-number-params-ok.20190109111042_1547032390186_0.7288763148002169"},"_hasShrinkwrap":false},"1.2.1-djs-number-params-ok.20190109114033":{"name":"@atomist/automation-client","version":"1.2.1-djs-number-params-ok.20190109114033","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3cef180453e2693cfb631712a98b72fa621ce0d2","_id":"@atomist/automation-client@1.2.1-djs-number-params-ok.20190109114033","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-u8pFR4H6F0JcdXVZ/CukLNAhS+n15Eynxzc4jIqPN+meCJJjOBZrz0ClhI6kErVfMm8pPIt8oHlx8JFtLSQmcw==","shasum":"405b57b8bd04fe6745e9600bd55283f8f322dac9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-djs-number-params-ok.20190109114033.tgz","fileCount":608,"unpackedSize":4968309,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNd5SCRA9TVsSAnZWagAA190P/0Xle1Vt9wNU9fa471CO\nmQ327tmeUgsJUIJ84dWS+I2Qe/YOKGPZWTxwOh/bjH6SZXLOR78NpW7yjXUg\noaY87dXIrrPvadeT+P+blzO8jtSsUDeIb2X03rq0ytQYiD5xS4dZ2eCBAVgZ\nccCtu78GhRqi0x8Zs6MBxOwxWmA597dgNl939Ewjlj8+bH4b7iHYDeANfdO9\nNPuAPWFriLoJCQQe3wvgAcbulHpuC5PqX5M+oAl/gIFWDlxVN6xb04caEkaU\nFexLk4Ox5L7QpAm6y7E4VZdsY7jp8cga9pXjl4qXqSSeUZROc/ypnMCINbsg\njJHpB0JVRPkxmYQV6PYJdoIYBJe/xEpmzaWcyw7II1H4ZT8QynUxMPNCNeSz\n+N7DmSZAJs1Oq3Un4+kVnUrNGMUiMdNTwzMXPQSTj6ek23LJzAIrSYbWOYwd\nJR9OW5wthSLl5XvlpTDaHs6ca6zSMjPvP5NkpwfZLcduMNgN5ThGtkOOdDt0\nKzFCiTDAMMOkAARDEPWFAYCCmBHDVREM1A8MIr7wkMjVB0V54t2FmLd6puD9\n3knYPlUk2LnDsSHHRrrjC8sktOsBs9z96DKR/aARRulDf2LvjpDHU5X2IXF5\nf8ii19y0EmW2Q/c3kiDzaUXFHYc9jhRLJyVwQb/HwWEd+Xy8afSjJoVrx0Pv\nO06G\r\n=5jZK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMU1pFIpvOfvYo31jreCs2Fi2AZyVvQrpinsRImECCwwIhALFU8x+13QztvHEIqki3ZaDkmJl3WabUIah95QxQ3qBZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-djs-number-params-ok.20190109114033_1547034193851_0.028244947972791756"},"_hasShrinkwrap":false},"1.2.1-master.20190109122016":{"name":"@atomist/automation-client","version":"1.2.1-master.20190109122016","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4a227f39aa5ba95ce97445682a8d4c65ac39a573","_id":"@atomist/automation-client@1.2.1-master.20190109122016","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-svESoYKq9ew3ABoey2e8e2JosbK5xKFi2xsFuJNcsACjcn8NTv2ZoRgxemnlguivqqp3lxJ5wefXqdL95yCrkQ==","shasum":"bda8adcb945b22c26807c81805e480f8c6c8be01","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190109122016.tgz","fileCount":608,"unpackedSize":4968426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNeewCRA9TVsSAnZWagAAsdQP/1IdYroU1bIss4W2O7rv\nnsh1pCDDcK1Sh0qx5zqiET7uBpVZ2D96YH2nmo/Q+xmyeclxElanbFcGg98N\nuMGrYYzKzuStJ04yjnpc/F1rb2b0haj2j/AmUnBHB+qiL2QzROTe24V3JdnG\nXLuDVZ5idfg6t5ui+SjYqq5rgf9EI0HEMlIocTBZNy6/v7yoru44VpSYDsaV\nwvrs8Vfh2WCZ5KghSs4GnT0GTzblR7Y6wQ5VFSIkpBmOZNPHx7ZFymWy8n0P\niIz+M0GRWkBg9gFCYSOn/osLAQ8zCCiTv+fC3ZRfGcaYMQDR38NMfvCjqNkj\nCUiL7eOvXUPDzSjwzFq/ulwKNtSRLv8dtfXVSc4H46nQWSiPjx9alpeFWpxG\nXe9nD45mWeCsUAnsyftyFuM8PQlE90D5P6AD8OhOkbvBClHWOH9ZkSA46Zd/\n1CdSANUML7PFsrtLyOSnfvdx8Kyb2I2tpQKctWjSJhUn1mj0J8/8UmzJo9iJ\nCEJVWvIbdBaZPwokwM4fUKkVICTP2lnsV0WNljWvX8lExXyGreH9IOiHG664\n84DQw1WkGcbBoe+SX9uGy9posqG6FDDI7wWeaEtnLuYtj2HVU9LPNKeTDOur\nyG/1Bkv3CibfrTg5FzueL3ndFPYNWtRFp4JqbP21BF1qoewUL79KqGTpxyq8\ni0nm\r\n=67lf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0vei+iyrNUlD8FtfPMOYaAToCgKU8mGC5V/FKFyw8eAiAo1OMV36xFW3gvHgvex4a6i8sh0IB2z/sW5bV+DqRArA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190109122016_1547036591595_0.1569762962240282"},"_hasShrinkwrap":false},"1.2.1-master.20190109142943":{"name":"@atomist/automation-client","version":"1.2.1-master.20190109142943","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d38aecc95e2eaa9402be8807080892671c108e4","_id":"@atomist/automation-client@1.2.1-master.20190109142943","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-XtNMOkbhOpG7jWAIXXPGYyZp50i/RGOHm0GnwcJE9DVamnvmDd+gKyEZfh3LDgIa9u/DlQAORAMX+w507DnyyA==","shasum":"065fc48bd284797d01a54b155323370431e468ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190109142943.tgz","fileCount":608,"unpackedSize":4968547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNgXxCRA9TVsSAnZWagAAiIEP/2EoWOqjPWBaIpGDa4BS\nJojtuaaziIlMLoruGAAUJYRBzGCC7NBuUUpw+lQKc0CekwXiug5K2DQxbYtj\niNoprnNJUUnWW8iFl4gKsJfS3rgx9gBv/k4YA5owMoJKflLM98igErP2guvI\nrKHp7GZ52zrBJ6Ho7JH1Zxe1YaiVQwVH/436YkjUVsLc90IW1g02mNqIXGr/\n7117YxZq8BahO25+iSvknJR+vhvUGHBKNr6nRFuxtZI8HhhoHM+spuNSqUGC\nVsJvTtlJVsv1MKxf7WNDrgE+tB4ptEW1i5xTcumiwxT+Zec4apU49iZFZmCQ\nRIIT/llManC+lQMhAERSS7LgTY/4XSHnWrpOqeMUPyCaYzAt9djw+gEp96F4\njrOoSATc5Ta9ue8Y1U02wbtSwlmgZtTzQLETkzNX1xaDmt7p2/G9qjmsNvIu\nxjM0A3px7ViN/tKBVxzJlxmESPBGHCOy7IREAqSlFOh5Rxz7Xa+bWp3B2FQJ\nmrgdfNJ9cDLKZ41aeJVlKfTFnlEeykJkyXA1oEcjiY057BWKqJ+qVefVRWNQ\nrZyZ0vSTFBxPuhLYE/+nDpRgDODyX4TOIDo9u77K1Iqpe+Tss5AgDp6L56bI\n23ZNyD2DrXQkIZkhGZROmAzrtkZ2zdRDkLOIOWKqNbzw0WNuT+WWDtpTGunE\nfGAo\r\n=8oNo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4M5R+qsoezs2sQ5zDPYrIU/S3pCd/Z0oh5qT5KmCxAAIhAOUVlZt75fO1numRyobNH7jknDBn4twClZYXNQ9z6ceN"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190109142943_1547044336532_0.9201781882982099"},"_hasShrinkwrap":false},"1.2.1-master.20190110014350":{"name":"@atomist/automation-client","version":"1.2.1-master.20190110014350","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"627b3c18e0fd7138bce2446bf3c6b8fe98448646","_id":"@atomist/automation-client@1.2.1-master.20190110014350","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PdnimYJP0CWRebjGv/CXV6eXJdJ2nSqw0hLkOyuAhmL/71Js3fzfLN9S0xfxsQIqjhZbGK0fOdsY5lsbiu6lfg==","shasum":"b64340cf2784fe2950357adc4c18463b00e2f54a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190110014350.tgz","fileCount":608,"unpackedSize":4968697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNqP9CRA9TVsSAnZWagAAHl8P/AgHAf2WXbrOQb92OtH7\nu29XILovgTAO+/tqWsFvq3Jei5KjBbWvsa2EEtBPPtGtuKdPf2tvVn+Y3pzm\n2Py6L5bQfQnl2Ra5GBdIAxDRkxtJXuvunZN5quMxud6GDzwSJnVpb0RGwN0S\nUp/wBXGnbIypm+4MOTlZvlXH3LrdIMzd4lXQBDg003OfkiZFTVwXaTD8WKmF\nNX8UOBabzRY58DaE4kZ5/rDFjmuBvcjUb+2PPtqZGhGM9kSyMfO2TJXebwvP\nPFqJ1pOn67B49JpXZCcUIP1Hh1mfwqrPKnDn04cjGEVcOxnCm7MLyhWYtKxJ\nyegtcDTLbuIsUvUmOfu89dqbRXkW80TfyJazV+pDSM4cc70sn5sezheK9YhG\n4DbVYbeLj/N+YAdPWQNNTRhK7aomvGsjPj4TOyI44n4TQhxblbzUUVnDJo0h\ng79zWXXMGEAblhH6lRVs3YKyTnmYLDhZZVzIuJ+EWzYd8u+jtPH6HsiXDXki\nI4tJNTRA345uqupSjq5MRyTT8dpvCd1qTcsddIbhTJSmtSq4go1JEj5pEXhl\nMauQrKCm61cnT6QuSYmbn4mewbJftJLNsywEw/xrCwyFDHlzZlpBQnjLe9eb\nLk3RkKS+WjQUlqTATQSirmV1iUvTuzvLZU6cEavrRiq9E4hQyV6RtQsdbXfb\nRPsb\r\n=ctC+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCToJrIF/tHf5YP+lO/aY6ZN+bOsNHyG8DB61eLgfglawIgD1+SdgwsCJUUEt0FxBR74JqxvE3rAoNE8DFaKDD1/NA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190110014350_1547084796601_0.2110446745485719"},"_hasShrinkwrap":false},"1.2.1-fix-451.20190110035024":{"name":"@atomist/automation-client","version":"1.2.1-fix-451.20190110035024","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"94428f0a9a5673f4168a050795a14002bb66608b","_id":"@atomist/automation-client@1.2.1-fix-451.20190110035024","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VDiLPG4w7iyCKZUHGlEAmW/HZf+KN2GD6sG0fkjvUoaV3KdnVRmrVii0pVyareo5HqrbIwTWFGp7yr43IeL4uA==","shasum":"0ff5b4089be5a061250fa6118f0284280b463a4c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-fix-451.20190110035024.tgz","fileCount":608,"unpackedSize":4969139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNsGiCRA9TVsSAnZWagAAsKoQAJj6rDbpJVva5G1mz9a1\nNUBaXFqzHrJC1shnlDHTnZQFYBNwtEtT+rgf8VFJUSWvAJzz/aGIkXt5T49w\n2MoSXbF4kYmjnAHVmV+PUuyEpkforXgjOWZG3IFJTl3scqBnj8JvZG8D92KY\nSL9q1njJXpos4xefEfKeWsxPzs+Ftc+bbxKBU8ZFiQX+azNvyqP5CJUAL1tH\nulxWSnzxmEbC5wjvcAEb0vd9hyCGmjlZ31+pjpQj7SeCgLStHOAHmA2qYMtE\nYnY+o6jyUCmJ1gAUDQmn6iNDUhz+u5lJftFDQbiebBBgbRwcgZahUGxT2KVt\nJmfJYLc4BShwglH0NXOguQ7lNQmje7C60uohYKEAR43m7nfC/wBU49wk+4nO\nMDvBsA/lutHQmMzTl/eyGDGuejwl8yQULpwwvj7QS7hixahLnPP2pGkq5afA\n+kJzk4RLF1mqp2hifhB0ThAC/Kwy7ioq1/fPt2xTiBWqClB8ykIUFLGkxJem\ngcQG3yJcg2SFjaVwswiu95KgtjMQ9z52IeWZYM7h5Ctyhu4Z2lMUBd/70KD7\nJu9WT5lMC5gdbJcMbAbNz6hWC9qVm57QY6uyi1NGxXf4gAa3XGIgYbFBRU5F\nTLgfTc9TVWVbkpCwtWldP5/8Hq1kd8PnzT56U/vikHnTLmTUBQ5FumL47y81\n29VY\r\n=fT6Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrUyj5eJQxbZnERz8hHFl8ACVbS9zft8lV+JbBnpaacAiEA1WtEqgNlAOoV4TBU4SvXA57Nu71K/PO/em17eutUsI8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-fix-451.20190110035024_1547092385628_0.9248251994323589"},"_hasShrinkwrap":false},"1.2.1-master.20190110143442":{"name":"@atomist/automation-client","version":"1.2.1-master.20190110143442","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"9f03be4028613aeca617046fe69c8c24f0b4b790","readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.2.1-master.20190110143442","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QgEGJWuHKGgVoKQL3ai7+Xv3s/GcNYRqVrWYCpAt1xowscnar+Lb7pkZ+K+Hodlo4u1vqvALoxFq/QAJXCO6aA==","shasum":"0b40acf21a583ba31fa11263783cd97b922f6114","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190110143442.tgz","fileCount":608,"unpackedSize":4969138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcN1igCRA9TVsSAnZWagAAmWkP/jBd6cVOH1ZFxEQFq061\nInQN9TMFaCEs79lYcQLQtGOT0iEYfVarBOv0pKrgZjOJhfh2aWcxIh1Uj08N\nHfO4Eh1UVPGAosd9baCEG3MSvKPG5CZaSdT2MDAG7p27pDLpZtAeftNeY5gO\nkswWKu/j2RFbEGLtERmHSgoSvr1MyQ30I7UVjeZTosb0ScSeBMpPnP4dcJkG\n8+7bibtVZ7AbrgGPddm7VsXnpdp19BwID/Z0h0J86vZD1xjhLnv4Jjqp2EwK\nigK1skMg+gNOmJ7ptJyV9wdFvmXz4v4xH446QdCJ3CcZQyzld6Sl2LYonPp7\nAtA54E6UnoThvOZHHfpkXG8dxkpPrKL/d6tVSB1BmiE8O3yHNRtY87ohGOV9\nhKMdYiGx79NFtX4efDBEe1yq/e18nXF+Hh1J/rH8ZNr7zQaSHXyhebo06ayS\nKpe1Apt0l/iilvHgT1GhOcsVvHo8kYHRi9PbCWb2OkmMk6aDyMXjxScQQEBm\ncnKa7US4JVQ9RUoC7bhOsGx02xibs1nJ1Pitx0+PP02olVdH7vI8KfV3aNjv\nCyNYMoSdKUUo0KDqwkY7HlQzFUHF/BU1sX4gQA9UlLo9SyWxAFlCOESslSOe\nTqo07iUZ010KsyNcmnV2ygmHnIYrpM8hQzuq7h6agE2DCi7cAO8dRLrazs3L\nPZg8\r\n=xR/w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDgJndHvQlgKan7YjSw6vd1cwFy9U61JgeNVlRgcevDTAiA0U+G8eKwNyDVVHtOhnyCiB2drpwco3nLGuxMufVZ8IQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190110143442_1547131039968_0.29332920132207674"},"_hasShrinkwrap":false},"1.2.1-regex-fp.20190112203709":{"name":"@atomist/automation-client","version":"1.2.1-regex-fp.20190112203709","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6a9c65c3a649d4492f22093725950dbd7e0d66e4","_id":"@atomist/automation-client@1.2.1-regex-fp.20190112203709","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AQ5NH1TrRDlf4hZtj0RLY5aIJcyLa/vE7R5sj1Od4v+NXg3EAKh2rTjkqnyFa2UZQKahenCRyD10gzel7lNPJA==","shasum":"c5f291a30aeeefea6390f87f1e4a6800044e37ec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-regex-fp.20190112203709.tgz","fileCount":611,"unpackedSize":4975552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOlCrCRA9TVsSAnZWagAAiIcP/2hSCq/g6HTPopcesnVv\nZFl4xHVdHKo0Z/Onp5VovSzJi/F7/f/WFAvPnmURS7dsOJ4WQ4NV5lfOB4Ap\nMo09ZlG/0A+e826KO7W/i5Mjn8SXdoCJlH0brYM9HoW/uOZokKQeyGORy3zW\nZbK2rM8uxsb+tXJBzqeHNlE5k1QVDJyqllXog5DP56MPinU52CEct5tTaV75\nEanlzxO8tAGInhT+jHGpyC64W2WWn5x95j9ZKFwkI/MESVjSePLwuM5+8v5D\ntziKkMZOLYjnFtHdV4wydaDx+EYfGCcXwkQPNe1ysUy0QZ2/6hd6fqelW1yA\n0uDciARxL0b7HtZs0ZTiWvS+B0L07BN4rg+BNQmbdnv2fnNJmgWpkXtMYTHM\nxD4oxRYUu4ZUmGud6L7A4zlyUBmwsCqSs8Uw6vuT6ZoD4aUblZIrss/cjtlY\nfzAawHNT1YYFN5u39rGKOmQIiXJOe+AYU2yWJ+E4RX+U9qpXO3rhjfEirFGa\nvNzzPpuH/Kl6trjTQJN8Pn3EoZriSwJm8Yly2Cd3L+y+ibAh0uokWlRzFt0+\n7LimifD7hFy+AbhPHJz5rdd8c5R7LhlNpdrixR2ZrJ21Xn20eG6/eXU6GBZb\nCSGFGVqMosekl/vJGEoG9rfYRSzMNBHv45aPR48HH6PJXy9c886Hw0WFmSpl\nn6xp\r\n=F5jW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2NBvK80bENqPqmGPiY3dqFZazPw9xzwbCK3v4vngd5gIgRL4uMmXbg00R4uQoMfZDaoys6zTgph6zpFNL7Za3M4A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-regex-fp.20190112203709_1547325610629_0.9551348171384564"},"_hasShrinkwrap":false},"1.2.1-master.20190112213145":{"name":"@atomist/automation-client","version":"1.2.1-master.20190112213145","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"15450029e2553967a38253d9440a2b237af3caf7","_id":"@atomist/automation-client@1.2.1-master.20190112213145","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-i9+XgXtaG8YIOWBa4am3Bp7/33Px5WG//9seaqWoh1QUVV47S5hMY401XEcdt5BfR/P2JVIYJkKSxvGsWjsbbw==","shasum":"6eee6d01c2f7a95fb0d140aacfd6aa5d584f0530","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.2.1-master.20190112213145.tgz","fileCount":608,"unpackedSize":4971616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOl2zCRA9TVsSAnZWagAAb4wP/0kJvdbgT3lhr+4arzKN\nf0Koji7Qax48w+NnlEGkdKlR9eGwUm5i1qqfHHnPN50vINhTs9eaKui3g9sC\nRBxYW0vCUI5ENfnKy7Ceg8pv7dVi9obqDKyyvZ44WQv5xTdRQc/eBl8bFiFv\nl8r2VdXq2B5OfKKv5ugcz8ao11v99UIjH0ua6GmCLGIzuSK8OYW6kugKw+Ij\n3+boQFXRBhU/qbL4L66HJBx1D77+CZ1WNhKAdxulI3719528T1Cr14CMUji4\nInxzHnenHkfJCP6qH3PT6ULJjPB6bdPuAo23hBViPEH5T0NU+5S7wqYxEGE5\nJC6AFtgXtqDPTtyNODJy1oJWgkhGSMfFEe60DX0YPIpI87qUEtXfrEjm6q9H\nQuFSD6/LlS7q+DtwL4GEi/SUTKImPP42hzBGaGhn/y6whOu7KGJdKGC8pJv4\nNE1yFJrCUQMEylYGsEwAHN8sdGAAjP1KUGkIlpmtSauJPQbtay8cMbWYtfrz\nVkYRhOEpIaHy95HRptjaCk9JCHQlt4PaqVN4Zx1DTMZJKLLxLtzwvgB8FAIt\n2rLXzRMwOljYjxzTRWXXPcu7UVgC997J01vbgZfII2WbiIARGl2GLU2V5u2p\nI5hWxh5nz7G9ecv80WQthqwGENxq6W0DKWvjD9yJHUZ42mEWfi13XGPF9IRv\ntS8k\r\n=7KmG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD42mYXqX5dbpZMChdZCKNlII7s/2gGIpBKKYi5f1HAmgIgRkz8c2jr+f5XWczEoOsWlwx6lCq2ucpheUkYr95FfUA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.2.1-master.20190112213145_1547328946698_0.2031063540757223"},"_hasShrinkwrap":false},"1.3.0-master.20190112215508":{"name":"@atomist/automation-client","version":"1.3.0-master.20190112215508","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"56114a40ca216a938e7e3a2a3eb47dff634ee793","_id":"@atomist/automation-client@1.3.0-master.20190112215508","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZFAUsz35VkY9S8BU9NTI0w7MHnXRJ2FQwNtbJFtmdGkXunE9EXNTctCxEpJ2EmQrrcm7ODFZCT3wfZ+ek1IUEQ==","shasum":"897c1a8b1dcac894f6490485cb79868f085d3104","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190112215508.tgz","fileCount":608,"unpackedSize":4971616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOmL+CRA9TVsSAnZWagAAT40QAIWHwopX1ggu65lRcu9o\n7ylzjCIppZ4HEHWCpdEsQ/eu2qrguY3baUDYdbDPzrLeFI/GE7El20RFebAC\naCepFSqxvg043piLZ5aG1tvNJKOXT54MHqI9741Yutzh0tQzRZvgbUA1HAIm\nruxfQWIlNs42Int8xG82x5S1LDoIVe4gmSJ+HO5r5sfsTXUBRHd8h8knjxPN\nrFgkeivhrrsSyQV0gNthQKSyNADKGOuj3KqBZ0DLr6epKT7i1lOJ8+N3KqPe\nw+vqCyhTtBoHSzuzWV2QJudT7DI6QFjyK0TD+RZq3w0+ms0u06gOiaRgVkjx\nx0ETNN3bdymQ2p4mmv7Af8bS/bKEYjSUTy9QQYo6j+gRBf3Nu1OUznXoXprt\ngAsDrmXv6+BSxM9ceaTzw4KRPBVxqV6pE9pL2y4aT8oWN09b6EiH7Q0v3O7y\noNW3i3YJ/DkPO91KlUtVBUCSDcc/ek+oTj6sLGyFWM2fsB0EdyVUx65+2QJd\nZL6ZwgaG5/5i7gaIvxE1XF/NFNKdKlRpbDArklbdWdUa3cx1BuUazovYsbAS\nX/4R4CyncKAz3agEy52YRddEPncbZMLK2QtA2HrOB8u5KaEaW9K1m3ae2QQg\nkG+8zYfWT3q2lQ3mWE+j8d0/XrsjBAC8GAngKp9h0ejAfTArMkfbDYwMvXqs\ni1Bm\r\n=+W8t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxWbVEhg30LBP3PbuyHEzMhEHfr+dkC+x5QxNPx+eGegIhALwT8ZDX4QAUxhzSumymfl9UrsiPtrsLTq4fJ18RKgjd"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190112215508_1547330301392_0.32052681636316827"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190114145336":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190114145336","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"01e5cf264965bf73bb0e18179c7bd9d4a29b222f","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190114145336","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-d5ckGr1s9ZBg/EBy/G9oYMLyTakXTpG7E6zzjo8nQ4joy+KyBFOkTx+46WUM3OGo2C7Jrm18s1nPPInO+iDI2g==","shasum":"67efe0567f36955f37cd5c8d25d14c605163fb1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190114145336.tgz","fileCount":608,"unpackedSize":4971722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPKMfCRA9TVsSAnZWagAAPwUP/R3CKOCr8kPUUwFF9Jgv\nfRBibWSBJ3qvMhn69u0N2w0YD5q/NieM7wLeRih0yC59hfq9IAQmYYPI98xZ\nqA9egKbn7WE17O1t7YsO0eJb2316TwuzCWbtXLlvyEInSOUPJ7X9CEwIq8yN\nsP+of8BkP8drXnmTSXVCLS7eQ//vmkfAu7g1CywJqHgfYi//m2IBsNBh/VMD\nm5AERJ7wYz2BbEWSKVqhACLalRScOeykd0XENDK5ojGmfAY8dB6tiBGWnmoZ\nHe20uRocCZok7x4qBk5LC0SCHgj8yapIKlsaY8usm1qWGxZEqhrkk6Vz1PFs\nuaI3Jm2h7ai6YZytxxFo4ZlmlNNuEEZU7UKZqpeJbhI3sOFHRHOE42muy9Th\npuHcD4uf6JfmK0Ae5VXDTdxmFsWyfNB9NfJwDe6SQdDNjNtMOxAoPT1mskHU\nEdnh6SyWZEItUZqo6WJd7YtvMnlSdu/AI7X+VRcpgPNErAcTiZJp+F06MTFm\n1D9osKC28GseqrJ5dI4OIaKooLJKeG4irZdmcxYd8P5F9AyEk3q9gKMcIe6/\nBqbNuvHJ2jQ6/ghHHSgz0X6nr8PY5xUTKOVESQqAlz7ZJ196GoZoMJvS0ml/\nZbZ2U8PB86VhqfjS5tziXvCDByo2qyks86Y9NzzOMX/CYQgKmEw3nRb5HoeI\nc0+d\r\n=vi53\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHljrQfynZWN56sywRpujdGeGNgnaQ08dhj11GmClgNYAiB2b2FdFJtI1dgz3r/t9ddzSr3RyrhXl0RQxCl16z2JIA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190114145336_1547477789871_0.18630823917210382"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190114150543":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190114150543","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"baa4517a5843b211ef974743e13cb87c4f1861ec","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190114150543","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1373AV4KcJ45jyKOcjHWNHIUuRgkWZwNx7d7u2Koe/Qps3CLAgr5S2k23c59vCnfQy/dQYa3URuLC2lIbqpb0A==","shasum":"6eed8f696711991a4873788b9429473ec14a42d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190114150543.tgz","fileCount":608,"unpackedSize":4971804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPKXuCRA9TVsSAnZWagAA0doP/iKHoB11k9saWjAtWF10\ncuE3tD37MHjnCoHADmZXVRsBKDxShaE38JgcJxvdh4VfDfHyhK6TSGYh0G1h\nUIOXmSCa/D4A2d2xA3Dl47Y860DVbA1tFHma6JZgSNlZuxlqmj16OFu+yYAu\nicDYOQwiwd4yGfwkiKDYvcwRkeAQV6Y9IO4BDYuKUvQh2GJm5Eoz2O+VxAiA\nyF9K+WaNG57RDGuO7up5ibQ0doFHS0H4/C0+H9x9jRrWoaQiDybNWqCFE5nv\nRsKsHVlAzlOJ1uYpBQiF07ptDOf+/6Sab4CyFLJ9baiYxS+zeFgZdJdG4IkW\nDJ37MpVhpTX9YEQpYXIzWMBec8ZYZ90wJP8psRGipFB8aV6ElnESbd2gPofI\nWa+Xnip31r47F9vubNibTHBycahQvg4Qd2/Jb8h7W47rdLf2jsFVF0G4wwwu\nstiIVEsyZt1N8wmeCBGwHXz9VNecNxGniNk62iapkxRFZJTwB0AfBARTVF/5\nybwO6DetW4CtQRJ85mFDr9+qQ5Nt8F4MC4Dhvqcpb3oh7HgpXvQUMRBlaueH\n6hFJDN6fkqE5IlkQ+0EfhFC4SKQr5H/ppCZ60o+PaHKzn1QCzcknE6YBpbri\n994skYbaTBaL6EniaNCTiBys3Dq+o1veS7trBYBujWeHgxswpANJwLNm7K2K\nKJ16\r\n=QN/A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHNLwBLG2OhkZWPTjI6+xgOZXpMz3SJoa8JQYwfjPBNwIhAKP7y+t5VbcEdR6ttSGDOMB+YDe6rwGHEgdFZPKrkKlI"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190114150543_1547478509115_0.9514161663221627"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190114151657":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190114151657","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8a60947a1d6648dd5b9f972ffdadd54e7eb3fbe0","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190114151657","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-nWaK84VsVxUBB74FfeDazVE1c3JPT/V6ZuS41myJ40x7kI+COAyqMYdmaI+XLwvuw9g84ppq4J3I+NYfhyeM/g==","shasum":"1f61a3ffe211c3091c6cba4ce0c093d214c89dc7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190114151657.tgz","fileCount":608,"unpackedSize":4971999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPKiLCRA9TVsSAnZWagAAL3AQAIfAZI6KS371G3paOmMZ\nW8zWB0JAhzuDrGVvE/q3tXUMhwtmG4lTJRqKzZsNTfBvPE47sWaDQbqvTu4f\nT0a0YDwy1qP4Ur1KaD8gRSD0pY/bR8DXIAax90fbUNwrKhh2oMH6LyuQMp7m\nsX2IWhKPo9HXN5fCcf0WR9iisO5aCv70o8FMkPQrwkub0JmtKcFbA5j93bwt\ngyxZn/4tlyONNMOaUQfDekiTZmkaYxS210moXGMT8t2Cbgyq2gT6K6JPOMjQ\n6q9KIxkDX+UZEUNy7Q6DGmQ22xmWCtC+2zAI91XA5kjt78zyc2Oz9oXBonox\nd1S2YWLdYpFe024RCOBSbkLlMhKHiOk61qzdcaOZHmBog3BmOHD/Q4u1Uf+V\nfQINSaOH3JGJEQ8ZKT0BNmXXLIqOTMx+5SFfRPhhtpXHcWKWAfALXqzqdEqc\n65mYgTuv5clzuhoS5yHfdI9jyhwnhxMlnsLCyIrdBIDX6svRi3qmdSxO3QBj\nN4pHXD1bAiLh4JHBnuFMiYAFMKadj1n2jlqlYdimGV9VTFkM/2hQXRy/TCyG\nwXQMB/OwSztpfRyvseZ+V+fn0LWT1B/Erg/9p9FnUSUe12tpVgvbmuSrVxd0\nY1VFJxU/EnEyjG1Cla8eDZLPd7h2U6SCg++hMDDyRqxZP+Xvx/ZVsiLrbuXd\ndb0q\r\n=rS1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGemlbZ+NjtBJhejD6ALY6wWoACQbs+FiaccvxmSR78GAiBa8qdJFXRhRV86kuL1aqKR5cokxEy/Ox8xVUrJId1HHg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190114151657_1547479179167_0.9917449122460447"},"_hasShrinkwrap":false},"1.3.0-nortissej.mg-upgrade.20190114201119":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.mg-upgrade.20190114201119","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"88128a5fdb21f05845e42d28ecee7be0cc9c351a","_id":"@atomist/automation-client@1.3.0-nortissej.mg-upgrade.20190114201119","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3MQj4BButPsYzXyvybIh2ORHZAPu/XuMgi1bahXhyLyX/aNPYJ8ys+3XGVqeUgR+B8jUhLzuXZo5TPRhDdkLKQ==","shasum":"03f7a34d322ed8329ac994666ccd95e99e6b21cc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.mg-upgrade.20190114201119.tgz","fileCount":608,"unpackedSize":4971631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPO2lCRA9TVsSAnZWagAAASEP/ixlHM3rsSxQBp/tcbaC\nqXnlTlhmLUXN/O2oR0XOFbzCMKqSnh4f4/NgqeH0mi0FPu/ry6JB1CJfMsbB\n7n/A0zqYtX/9VopIIBumJOFgoEss3fPkXUt592IBntWcOGxXfU7mkmDtbrg3\n260+e2wYKxcDD/b7yWLzfMZn/RWW2etvJFsSSO+9HTedjc2ptZpyYvcFhm2t\nHVmpZ6Jr3DDEJp2YB7cgv1VqIZ94O0HhlUjHARh6TsWU3zV5gGr3uoX0LRE6\nYbjfAstUeLFUGTgx6s+up5g9Lj+hFre1o+zn7rsWXA7/ffr2fZrTV8dfK6WR\nilegoKj6Pty5qgNzNvz6IlJrYulE4RgLPtvFThgQFIICfn4zLHrrQtY5yJ08\nPwOSa4EXzm7N0RaOELJKw0ieYT0/Z++d8faMVrl1c1WylbaMN4dlAxpd2slQ\nHh450poU1PGqw2Eo7+SdwikQM58s3puS0ASHlLxDlnDocfcrY0wgV4lgG04G\nt/EqY9ds0AJ7nMWJ9xdUghqn5TWOmEmqYLR6NpucSVjEk02cBPk3ehksadz2\nI5V0y0t/ZbwqBjuQHPSJkv2ZuHls2DjdPHGSMJRA6SEXudX5Mhmf4VgmxgCQ\n4K3KuYhYaswXH8qaFlIhw6C8lg4spCoLPqvyIC0CVtCyKJZqBSn3pfXZsMOX\netra\r\n=6Kpx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBQMUkyg5zkyRTxfR7E9JLj55pWF9/5I543NJqZ0yduQIgHbA5HIEb8E+rGjvmNWw7J1hNRSNDO/c2KdWDQ0AAhjg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.mg-upgrade.20190114201119_1547496868988_0.8256482873184265"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190115114923":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190115114923","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3b66445dd6dd643bd470f4fc4414bae79b4bd0f5","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190115114923","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-UcKNNBek8KzNSNYfX8La7xuL/VHzT1omgPhmAFYC6RfzJCvpERNkXap7iaa+sctgIuJkjdbFtdYcI8YmBokGQQ==","shasum":"42938774d6a4efe0f090fbd11972e86b6538a6b7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190115114923.tgz","fileCount":608,"unpackedSize":4973968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPcl+CRA9TVsSAnZWagAAfcoP/1n0yuN+VEupypUXUBcX\nA6F2WTK6bnJDycgb8uQ80Vo4ALCHz2FFJNAMR0KmCYDjJ7vNG2XGzU9gIzU/\n0nyP/oVtIkd1doPG72fqZcbzXplcWkSMbIv0zap19myM7edm8ySL4Uea039v\nEihBYC4az1vHTK7Un34mlv27ZLm4wIkPZ8HhiB44r4oXNg0Yh5Tw4zuexxwd\nFNa2tUYfUToyZdXd+KqZ2OUgM97ngZspRezw1Fbhcw+O8BTRmgi/LVJxpWTZ\nmkTRV2eCqeTHxXUKClOz7JhQvDIiVJeczbaJUhftPEkq1Lx+CM8qgbAccmKa\nbqrfrrCj+unGswW4IZqHBNHF5EbFB2RbR8nrg/aKhJpoEBqxBEn9hID9ihRX\noWCNLbWEmOkP56RyMxGAb5f9dr1yUpr8Z4zedY2woEd4/93vVxn8ODAZQgCM\nspdUAQY4bNF/jnSxwWh+pCJ/cOu/Qi+/XWwHhBe3ww3ldydPT+VRtOrAK3eF\nZoqEXETTZrwR2s1IpdSYGdtnnNFNcjOoZsp6SR2vaDGLyCwAOadQ2oiDipv5\nYfD0msGke8YIajUJnbH19170Nz51tptaU0AndZ553sJ0p5sBAm66OYsK3FFl\no6lX1qZ81uTeH76P/MKs1UvtfCQh5W9ElGtDyZWj2MaJqxCAZ9S8BkjJz3XT\nYUCw\r\n=GJpU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMKBEPPIQK1KFdJZz38P03dnC5A0dHolW+ife8IJGdpQIgITl3OkIdrSUimrIDmXmEhgjBTKC3tlJ9RsPIv6/5iN8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190115114923_1547553149818_0.381436619507598"},"_hasShrinkwrap":false},"1.3.0-master.20190115210858":{"name":"@atomist/automation-client","version":"1.3.0-master.20190115210858","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d359d5188c494811b467f4a748b59b4bccf787aa","_id":"@atomist/automation-client@1.3.0-master.20190115210858","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-fw17ZeQmNFxjsnB2dt9WhqziYBC68t17Uy9GQuXQ6IR0PBqvZgeLouja5U7Yf3p56gbDGClZC+6JMKEkUNlAoA==","shasum":"6bd64bb20ede22fb7941153e60b8ab600f0db425","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190115210858.tgz","fileCount":608,"unpackedSize":4971667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPkyuCRA9TVsSAnZWagAApZQP/RVOgREmR4WRkNMplr2G\nyJG7UPw/jEq0M6//gdUxiaZ8hsyBxeTSRAWdhYzXdgqYoWqZ2HmwTWLHaw3I\n7N6D/3UgN0+Yn4cU9klvALCIs9sShCUwIQMHlzWGtQ8oQepVSdVBt5HjEKTr\nmhpdMfcbvZ6/2FzjWdh0kqdiGCHtcLIYNje2zlPxJskBRmRHIVTmGXA8KF44\nafyzmv7cv7xdlvMRtCdZq+lWCA7tlSTeDRyYskD6pNlZOyQWRMT+y0QOfUb2\n5MELVu8VQ5TJGC1S2MCgvU6XL/UiB9fQLRi2BnvEwX28+zDOk5R3uXp1bC/H\neTAaIRApwnyiCccQ+uRkT3QbF5S1nP2pNfzx1ibPmlxGhxZETrcGPa8lddRd\nBoZPKjidoCYxWTRFRtfZZp1yrp2JX1U3VFhLksN/ZWm/zQ2DL270NmB8M8Yi\nQqitgxkuMZcgcbz29eSCsPSAJ2R5CgSSFq9NNe4bOs3EqNwOhQ3sC0yi8Xjt\ni1H6Y0iERm7bEWyE6z6Yzbz2+lg5up3t54j/eIJXJOTA6FK5nbNqh7/LLaRv\nd/k8siAQGeUShqshhd/pxQuLIsMJ5bahWoIryokl5rNP8vicq57ibgEBo63l\nWqlr8rpdW14Qv/sAkKbt0TptnnNXPsM4LYmt6iZNOs1Yoq/KFpOvIz36LB24\nN6yF\r\n=luNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdKpLEygmm2Vne27H2wZm4bfRU+eL0Wit2tkJJ+iZEtAiEA1Doy3QyU10xYRR6FFN/wM0cVcM+dfDsFLj6dl3ervio="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190115210858_1547586734293_0.8094108664670641"},"_hasShrinkwrap":false},"1.3.0-master.20190117232341":{"name":"@atomist/automation-client","version":"1.3.0-master.20190117232341","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"75d7506c2d3b936fa454674b695fb8842838714d","_id":"@atomist/automation-client@1.3.0-master.20190117232341","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ZFQUBT6eS2RxZOsqZAZay2//lgzEgRovlB1//fI7ZNNhTOKb0fiwOtnImizIsiQnthL0S8lXpzK3rYoWhgJcfg==","shasum":"55906fa8c6f3a424a30f37a84e464160640b59e7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190117232341.tgz","fileCount":608,"unpackedSize":4971668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQQ8pCRA9TVsSAnZWagAA120QAIao2T4pASMEQKFhvWj6\n0bizZqqGsR2O1BKVsM6qd6A4JlsA17H//0My1qdRiuZJ6j5ZM71thD2nM/qE\nFg/ZzC4dhoByCfCAnDcnZMoxOFH+1r0ez6uCzwbp2AVnTuAc7YKstfDFHZk6\n+Kkn7mqV1DLce6kRaxAX6G90GF1GKI85Gdj7Rn6PGpWGjGOKOYNujaCqzMy5\nThdrWHagdyA4lXMBEXNfLcBeyvhNKEyS1Bg2Pl8bVpkXhT3wjyUdQCVUMmxG\ng5PczhLClZVlxyIVoVsnsxnK/bufRKHuuGqRkPomeJJ+kTIOqXJy9PcU1cqc\n+3Iifs2DLu86M2HYHUmPTDdqM2VfZxgWEoTAkgcIuIc3N8YFFwxdgmHLxlTb\nQQAE3zm4XEgBe7v2Tr6IIzY1OEIg51OWNBmHG0Y2FTdburUBQGnpsweFzR2K\nyEsPtq/PgC5LT+tecNZdXpHHgbKuVAtpjHxWDbVsrv+9Nz0THliagHElXnXI\ncFZVD1gsnxDaL39gXSqp97eYWQJGFKD7iJgnupT+ubQA3cTqugD+s7/OAnYD\nC59yEN2BIYncKFQLYOsUitY+mFATJ0iRA2XNTjWOnxYYYFyFMVmyIbgVENVV\nswz5wqsuBxCSCnLo1uVykHMqVprOMSO5GpRr3+zp6cGyQLj1dXdDlXWqHVAa\nslZo\r\n=zmXk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFXiPtQlFqr7hM62HK+lv+GoU2VDthLYFccIfJMXNVnoAiEAvHxxNl/1TDiOH8XQPKGiFiqXfY1Aon/L/Hvkmii9Vbk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190117232341_1547767592955_0.3325266140815897"},"_hasShrinkwrap":false},"1.3.0-master.20190118002357":{"name":"@atomist/automation-client","version":"1.3.0-master.20190118002357","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0ef58979ab554c48d3536642919f30e175492928","_id":"@atomist/automation-client@1.3.0-master.20190118002357","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cSpZXJzdVCCwBKNQ4bSrwajJAbIaueNaf+HmfCfupq+vE8+hGa7kmSiUDuiJl+de6Ne1ew/JJjzlaQJoZl0Pzg==","shasum":"ce6177baf42baca3cacec42576b6cca2d2cf2839","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190118002357.tgz","fileCount":608,"unpackedSize":4971693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQR1MCRA9TVsSAnZWagAALLMQAJ93tZTiNHxhssgOlQin\niFeJRsmj5DAPEiEenjoenR0CYcwHFn7HqKKUaREOS1Ak3m6ATvKbFrTqJ6Bt\npXn1I9BwzMYWwhD83CdT0iXo966YpGECB+bQw8sHgEeZ7/oa9SR6muURB76o\n5r/mV+IiSf40eQ+s+9W7/O11v/DkV01pu9thC8PDTU/6CWMGKkJ1k031JrXB\nqRR6TbwxZDSB7jlfevkQoFNw1rwQ9akCtM9nGW7lM7b7WYbUUpR2RzbgNmF7\nwV2C9prg8s14zNBedBDsW7DQHo+atVVvuC9V62hJHlyPK57WYHw9VgBgF36U\n7RFfpQHiB3lVmHT4i/b+fTr/aw/K74ZqjJ+jNKZcinamoV9mprNeb3VA8tAK\nSgaxluTm++b2jE6dWpNMMabnNrkqTDXWcf6bTZXwZbviJ9i1FvCooxUFWeX9\nDutprnad6E1UxT/W//ZLp8TzZLiWNQ6yv/Fe341/Pel2zs9nEKRxbVJOFIwd\nfsjOy+InicmBAuvNjIwY6b7QhnjQjBf7yb2FLzPR87LyPvYd6NjMwFbXsYB2\n1ud0sE7wglgulm2+ocx3oY6TGBS9f1H19uScz1mE96cCGQbExxuGtSXBEigf\nQnQCe70MfL5JCDR4Mx2/VBckWMag0/41TC7WBf07Nf+FwtgQg20r68ZzNT/k\nFb+J\r\n=FdJT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEbasxU3R9h1Bp5zRtKOlP1AZNkrKGrIk4SF3aNqnQ4AIhAOkDmzUDQxfAnV71r7trhJ6rA2UA39JJ6rG7+88c1G96"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190118002357_1547771211316_0.19697175377967802"},"_hasShrinkwrap":false},"1.3.0-master.20190121171911":{"name":"@atomist/automation-client","version":"1.3.0-master.20190121171911","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5f258f6b8911f98c7f8e214649c1eca409087aa8","_id":"@atomist/automation-client@1.3.0-master.20190121171911","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uedbHocNljvDFUOaaW99SlvRZJvJ+UeB0q5B8hOJ4AzYRjhgPEet926KJceFAGUIZrBVvSpKKrKYwOmN6lMbKw==","shasum":"16328acad9900c97ef8cf9420b6e462568b96503","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190121171911.tgz","fileCount":611,"unpackedSize":4978105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRf/gCRA9TVsSAnZWagAA5egP/ROY1FJOl7gjNQbFNKUb\nYKbABMigE9NCU+RPpVAdOPUqwvzhu882u03Z8au1RlK0sOQ1qLVJ5GG9W8X5\nAgQZ27u1K493nFg0D26GU7dcw318pUB0dJledYNVw6yinIdxxNYhqoWJPhMg\n5Nz4Ni8+aGzHMFumVeFKR/iefGclURDBm8bjZX2m01UmX0Pg2tQ2ovBsUiWK\nTOWu5KFm4us2WL2bENiSebnXi1xaN/ZRM2eBXpgiUkKtEZ3w6ka7N//nbiWn\nZfq54m9tkwaK+zDE9usRj+oHsHBK9Vl0tgLrUdjd6/zmW5jZ0qqEi826NkV0\ntN5FTgLmW1CHCQCND6ytve5DC9UixtFPPfbJ/QFUo6U8NvW0UMTrEtc8ZLKX\n/akLOSOuyRHVOmxNgBFxx0FeRZS1lFlkbQ5DXdJRt+GzsfeIoiZCjXHzhs5H\n1bqY0uHjVTpV/V2um3IGln0molqIAh9PQIioJpAI/+YAdlp7Biqz1Fm4T95l\nb4ml23j+UAo0vrboeVVMtzNX5sF4Wu1Oz3WKRArQuKtbg/vkyv5J0MkDSMot\nlqlQt72qxFyTSS+X8Q/J0VCzcwm7Df4oprmfnYV0I86nqJasZa1rsyXbov5Y\ntMlTYMX6LjKU+FhCSvGQGMYRZ94Az3Z/WRy5OmBCn8ZLa4ixfvvoNOmw+bIC\n/2HV\r\n=DhP/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL2t+bjGNBAkCZons9hzu3ePk42MOrm5OHjM7KjI3WgQIgZxOfW1AeMacbD4S9zhEJWuidfPdBeREtBAsTtKP/YL8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190121171911_1548091359288_0.9450835331965595"},"_hasShrinkwrap":false},"1.3.0-master.20190122094600":{"name":"@atomist/automation-client","version":"1.3.0-master.20190122094600","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d8bc2d99292f6b8a0b07d1b7d4ee48b93affc8ba","_id":"@atomist/automation-client@1.3.0-master.20190122094600","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Xw759vPYQ2iNP1pOOum7PqA9IKGZmo7JJgJpSHaTkHe++LtGcwe+N+rWHnLDqdAuy3j56qdD8HF8SRZVlgIZuA==","shasum":"819b6a7f6a5f50951fa347a159cf1c1d92060d80","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190122094600.tgz","fileCount":611,"unpackedSize":4978116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRucgCRA9TVsSAnZWagAATzcQAJsV/u75cjJDIETExvm/\nA+KpMNWmfogBJnlqg/5bXmtbebz2CxGPgTGxzKLs272MChjROX1V46k1+H0t\nbN+d9iwkyCa8VC46HRuxtwE8RezncECVtooOJPkalf3LwlVzfN8wdPk75nuQ\niz3DUvJMNEkn/+bhOyG2WGFpRQFWKASp5kwGlLxfES3wra9FQpJ05T8FlWrC\nIlpqGAdkZV9jhSIQ1GLOsFxzWacsnI7pVPsN2ntCMgcUHU4n1ZDjjmdll8EC\nWR8+nxO6RRqOKy+b3SUtQeWjLqUPkn5jw+RRgYOW3itNAmKpdTMqLLOR+WZO\nSj8FpfsdP6qyfh39apehR0Mvlq7LS+PfvJZ8cdWZhekFbBnif1iKflXjGemO\nUEzjyiyJkJCq3WpAlcFMD4aWl4vxvOrf17KUyKfzhgjA2vz11FngWndxdSN5\n+92TqMpBhxJStsNBq9qtpatdxVp/s3Ac0cRGxmshm7cFXAjRVOnNFc3UFx6d\nwbA8UC2BmXT4OGBZnbAYlL0UqW2mP3aLF03Eeb+weE2fd6Dmdvw8KFTLCwQ6\nFR2bogRbJMru7V6QCs+ZaIKmdgMM9f8YGibPm80PP5jTjCO5oZij8bmfK9cv\n8RqqG7T7xFQsrs0R/OkAmMTkjdJKXvIUeIAgqou0I/2AqGjpbCkU/MtC34b2\nquTo\r\n=/TzK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDox95PdpbTdVFVigfgzw99ziQJz5MAcHpUu18mJKSoLQIgS6tf0twJOie3giFgW/7lDKc4YpmfjniTeaJz6BDosEA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190122094600_1548150559220_0.8814859537500124"},"_hasShrinkwrap":false},"1.3.0-ipcrm-logging-update.20190122114527":{"name":"@atomist/automation-client","version":"1.3.0-ipcrm-logging-update.20190122114527","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86beea634ab9abb190e779c5515d676846c1bb12","_id":"@atomist/automation-client@1.3.0-ipcrm-logging-update.20190122114527","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mNbIwxbb+ZdHIKkSV8Qvqdj51Z8VwkGYc9T1pL9uA6aTKFdg44026Xunc//wydSfSbDGd7CxOd7GW2Md1dBjoQ==","shasum":"8707bacf22e68ab6c4460b1a70dab7f0864ea257","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-ipcrm-logging-update.20190122114527.tgz","fileCount":611,"unpackedSize":4978118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRwM5CRA9TVsSAnZWagAAE/UP/0VVF4MQDEQARadp5G+9\nW723GIhouEj6hCKFUkeA5treq1iorR4M/B+2Ogrme/NYtnK0DQnV3KIhWnNf\n3bVvfnIy2z1Z7acR0tDCA/0PPGF1kHj+v6qdPg3J4CKdCP6KVCsPWAwOj81B\n+3FHRFEy6w75rdwqNbOClffj9yqPNPG6Cv0YwnVWH8f9j45SstKATd0zhsP5\njT7GoBUmDwUf1beeCH+yfixiTZE9zmvaeGzVAgVCzh4/NSUJpv6IU1vOFONT\nQGB1DVFsrQKfpjtieql3PEn6lgYM0mp1Ym32o3ugG7NY5yMzHZFk80kwTzuu\n09hd6FRcPLFAlEl3KAECEE0jzHI39YtFVNQFO9gPLcxhHpNOt7aWI1oqO/UL\nfShKEr/gaS0IK49I38ih/M1YijvXMhZnlxjRLcOAmg9izLO0vdaf4zayle5r\nTAFPTf04pzGZ9DRN5R6szgQPGtcp6yJnsykcwIQzNlK2dPD7K1ghnUsY2Ecb\nfB+PkvWfNh/0EDunTmShP1UyU/WLznb57vF8PEz9qETtwYA2LdYZlsAEHvtw\nNYq7STFdPMi1Xw3irHLagYCUXuS3HHIs9G/RW/neYra7nFSJPoe8DCTNJTG2\neqj2s8d2qNHvqxeUR8l8IVaLGFJ8jfmS3DHUu/9SqSTrWdlOknLt7vc8wGzK\nZElb\r\n=67fp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/iuwAR1his2jsxnAD51OCRLnfNGHP7SAso/pbDdIBdwIhAPtY+wn08dKg+r7aOV/yG/3/se1Ui+y+1tTkWzmcoxhG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-ipcrm-logging-update.20190122114527_1548157752362_0.3580215926449266"},"_hasShrinkwrap":false},"1.3.0-ipcrm-logging-update.20190122115427":{"name":"@atomist/automation-client","version":"1.3.0-ipcrm-logging-update.20190122115427","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"68121445f803a5cf0e01e1258cd93dd063ad9929","_id":"@atomist/automation-client@1.3.0-ipcrm-logging-update.20190122115427","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AXvJ9qjx4xlnha8ai90+EyjQaKEmswH7vMl3x+5t/73FSbMo1TXCmYNIReH+MzmM4G+Ip1N21tJJSUcRmNjfgw==","shasum":"ca75b41f290156fc3485cef9fe6083e318a5f026","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-ipcrm-logging-update.20190122115427.tgz","fileCount":611,"unpackedSize":4978118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRwUoCRA9TVsSAnZWagAACN8P/0LYR0+VGmf7FqRfhKgK\n6azKvJlPJsamw+qVijmfhIpSR6AFTR/O3V69X299jA4uW87kCLdefIyJQC/0\nPFjUKdJIbssUZDQAwRwg2l3vPrNM/MwNZ2g2F4qLTOqYPd1jVAJpu9Tui2Vq\nxXBzOFr2fLttNZHygYcmsTWCxWu92xW/brzip24+sjIHPT68WkCbf38IXpEH\nil1SHKjnYU3fpsKEWRa8qB36pXq3C8sAlyZd6nzQmTFvP/G1vVQDgt50mbBJ\nf649KquNIr5Y3qE7uG1hgsHu0Y1aajGDnEgkCVjSDSXFarKmj/4NnsKxzrPk\nwSwipCHadD4eI3Auj/RyLscE9oT0vLFy+Q7RY0UVuOuNVlU7qf4OGHgzDmOj\njG+STfYeYjB+00ngn70A18yEx6df88RZbL2kgwSOUtSHLIslPbCrW3W6yvqt\nnbmZz0GZPODJdPq8/EWGXYGy9/n2Qjt7abD+h9h0xfxnlFFfwOIL8v7czmdY\nvwoxBklMoHvYJew64GzjaZ/DORzHxVcsTX+hIwQpiyaS0to8U+hCqyYdwYJv\nXhYX3HRQkqpGNAEnc5c+PXfDXTTxh2eJ4QfZOxU8mmXeVDbfp4rhUN0U6zqi\nF0PHqLY+6TfA/nFtExF4nG4rcXE1aTx85arLZTV3o5jsfmCZntEPiXOdBLjg\nZBPS\r\n=/wwT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+lIMpt9Gj7g1K4gzSYsGsgcDs236tFYBk04WDoD6TtQIhANHmoIFi2hPPVHXYOtxcKRDxBZgCNZkORFVlhGXrnOn2"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-ipcrm-logging-update.20190122115427_1548158247664_0.6281655723548836"},"_hasShrinkwrap":false},"1.3.0-master.20190122143519":{"name":"@atomist/automation-client","version":"1.3.0-master.20190122143519","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d731239d14d6b36e3b2c71df6ac0f697bb04cf76","_id":"@atomist/automation-client@1.3.0-master.20190122143519","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KzQwrHL9glOtqvYFziOyck9TojsAKh1K0BJahH5dp0KgdGBi5XvEBdjaOCzxhErk0ukvZJLX1GR90qzf6X3mIw==","shasum":"fbf25e0dc4f871e2dc0dab34c408143d2083212f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190122143519.tgz","fileCount":611,"unpackedSize":4978222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRyruCRA9TVsSAnZWagAAdD4QAKEA1/3ZHghK6qxNPoak\nOAnUuiSHxQAA9hBRRSsWLZtDwVi7WHAcEBKsnLnQIXX0YJCbwXTtFTkdROfW\nw743OdAKl2blM3zz0cw/Y8MqP+0+5LLXxinaGuui/BVlWzB5LVSPCeSz/PFp\n2BcwJxNFPQrqUQ1Fe6rxjxF3mM3UsNqXTXpneBG7OADZyVf81R6ecTbXjkzJ\n5IKKYd9DivNQTWIb3WhEJWrDZu8XecC6FjWa1/pWxJGxeCI8Sx9nRbMFtz1B\nD6SOQp+olM0KMxmjuyAmtMd49WYPUabl12ISX6OM2ebYXnmIMQipaxIJQPMB\nkp8jiYoqNFScaoOLiACSCwBk4FcI9/FGDOan6xjp+89HuMk/A2K5PhWq2Frn\ncpXciBxjL0IJMy1o4xr9b+gZ1daqdiZ+SveI+KdDXq/u3GY1XEObGk7XgMXF\nDtUePTTuGRwYsbE95chIwSWeIzUm9YJt7if/gstBf5drPl9zSFPKUX1XRGn0\nBb7q4eQjePXILREY9OxTLNlwSXExrt8JPjtnlSWCA5ZVrh+quYanIVkU1R+X\nO+t+Q7ksk3MzrqNyWSMn0owlPTSoVnpUyiW43X8YvmW4sBmlAJZ1B2U0W3/Z\njgr/KGxhlLUq8/d43yMlTmEWyitboBoT0po0Z5iTHwZiyz79SvTstd1zVHDJ\n8JWY\r\n=x8WS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMiV0G6Hg40M+dzerpoYZ8AO3qSXgJ/YXzZJ/L1Nvb9gIhAN7rztSQUkq75JguBYl0uaUG0Z+cN/0071QFsUg30Xg2"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190122143519_1548167917724_0.7158946993626722"},"_hasShrinkwrap":false},"1.3.0-master.20190123083033":{"name":"@atomist/automation-client","version":"1.3.0-master.20190123083033","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fcfb68396fc2916e5e1eafc0f0056f04e3543790","_id":"@atomist/automation-client@1.3.0-master.20190123083033","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-065qytd+ZSQOMcTjU5R0YTKVP47oXbO0dkrEhF4DVCm900/TbSQQwHS1OhSFzIeLP1ai0BXi9vryL34kN/irzQ==","shasum":"381e71a57d05af8e608e2965a55a93fcb3c39fba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190123083033.tgz","fileCount":611,"unpackedSize":4979101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSCblCRA9TVsSAnZWagAAwkUQAKOTekd7Sm4T5BUoJ6iH\nO+hLwUAEm2Jk1BPK/bPFjerpVWTdHJw1n2wSgVz1YtpW9CR8l2inFF6mI6em\nE7KyFAbHHjzmGmWbw73pQLaMJP/Qw/6ut1v97/0qJjdrhZi+WQfMKSANJ8EG\n1bXBPBGw8pWZu1KAYEv46hCpBu+2mF0gFqVsjD3OnzZP1qw1Oj6m2CQHizoW\nlWyBGrHGYpx0UA7NAj7w8NSQtp6gUKRW2pfg6gXrKvb+UOH+KtQDaL+Yna/H\nIhRgIG1AMAgMTswTjuFZOkDBuHluCVVtf3q4+tpD3LAXwK2s/lt9uFWMaT60\nQVg6LyG2wVf8UJWBfZD6qDv0xWcm+vlxL9bONgb4n73HAN3G30cwQjDj50Q7\n1N6HKBVrtQ9rNSgw1umPuZ7tBNO0bvGJZY2X/1QQza3biywUqxmYDNVtq72m\nPNC2dOIugKpzL5rr3NqmVfohfzr4AZShEqt3WwSvQ6W8hQ7uCZ2q45abyA/X\nogBbQDXmPjvLl8ZRQpVjHCO2wTwhDssJzvKozBfsawcX5Ibd3uBhCP+rGbE8\nFE/YgPZN0bLZsGSVnSNt9Vmo8+mQeLp9p/eDzaKIDFBwF0/9q3K36U3QkiIz\neLVOJbh9NNx4CnGiTAIIvTk1/Fto68XA49oJdSkYQowbVyqRw3aFO8Alpqxz\nziOy\r\n=uKrS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQn/j0GKMSpyZeaTqS/zaskozq0F9tuvHtmq30sc/N1gIgB9yX4bevxrUci5FO5uXuwUxIh8LjkoeWgPekfrJndQ8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190123083033_1548232420857_0.06059305433526152"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190123164821":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190123164821","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1d21285f16314703ec78da86f5c85b728c276cd9","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190123164821","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-aR1c+3CBDTZ7+x49xtSuix2oz/GPHyJaBlpD/NnMRoYkhGMeYi3ju4k62hAuA/N5TIb9Zmw9lqqO9otlHl7x2g==","shasum":"aec5c93e2ce5e978f2799a2ed67c74752bb83d31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190123164821.tgz","fileCount":608,"unpackedSize":4973893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSJuQCRA9TVsSAnZWagAAHoMP/1H7kygl0EXkO+dluR76\n4EjGvfX7FzQVPISegFh4ig24Y79MDBZxMs0JVJjKHEvFCzpRHKs59rizPVaw\nHvCbBWaDuHtvlny/cxQEKvJc4tztyoYTVRDAHdfdZgOnNhZ7ynFjYhgDnJjl\nO988rWkXLgjJsgxe5M2PMxpiskVnHgTEyvzaM/ZD9KGZAaNYld8oFF8Hodw5\nrhCN1K+J6ngYmsbH3eHHBjzRurqFjk1KS6dzDvojE81gGT7hJC3ImqOpTUQb\nZhhatKIYAKZS0AVXgMDUmf98OWgJNnxRymbqKhuFFeIGbUcbRIALBzNPOC3u\nPReQXR72S6cPVf+d9QmjcxmKzNOFjDo2gr82qEIf2wA7YuBw/qfF3yMsbdMC\nNsANB7R7Qs360w2T70m+WYmgdtYfAL6247nZpzAS1P45rhwK3pqGygMC2l1q\ngemfoPk9n3QGiSxMwralg1I9wpJVJyUwQgtudFzJhSZWNXNzLE3wbJKTsCU5\nRKrC054VBCPYPRv5n10qjSOh6UcuXoZkimEEfwx3GaNetw0TYqO+2Ntk3Xp2\n56C7e4EMAsApT1dVauo1aDRcifgP593GoLIr1NhCk/jZX1UCnOSYvE8PzmFl\n+M5ICFVgZ3U2xDcLbEQ6fwH0B5WuCJ608kc+uPbTeDVyp+kJkn2DN6vZsqOH\n3aom\r\n=2csE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMPA7uVkGj4UQIAoZiIdE7mv8HR3JTt0rAEGCRgs7dtAiEAuVfFVNLGbEiouGF/Zo925CAhFPoBWtsTEui5WkfOEvA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190123164821_1548262287517_0.5147524864368458"},"_hasShrinkwrap":false},"1.3.0-verbose-axios-gitlab.20190123165420":{"name":"@atomist/automation-client","version":"1.3.0-verbose-axios-gitlab.20190123165420","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.0.1","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.1","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4816c6bbc33a1d36562837fabe46b29b1f8f8096","_id":"@atomist/automation-client@1.3.0-verbose-axios-gitlab.20190123165420","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-pbxPh0V6iSlLRlx6b2VYv2ezk2/IEcR43/dQ2/O0gAcj9a4FW0BMJhALZsYSw5AqvjhGcMsE2ZfF4HHprSxQ6w==","shasum":"78be22c4b8677f03441c79fe75d2e0db29ad55e1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-verbose-axios-gitlab.20190123165420.tgz","fileCount":608,"unpackedSize":4974210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSJz9CRA9TVsSAnZWagAAYkYP/3bsg2SMuCMnRKJKGvDZ\nomttbBpenUCzRAb6iE1a9gUAd/bN8hhgLwrTbRMmgEvfscQe7j4VF+EJYkUx\nx0jxH4eSuTQm5Jn9ZUeBdbzRITcy5ZiJC9+WRa7nc5BIQAuaPpxa8oaTXuWW\nRvdAXbaMXYy+jyFqKMRowZjdEhrTjFWSikX81XDsaOFJkjvJbVR5VtbtHPI7\n4knnp2VLZdS1vt5MJJ1GRyk3QOpj2QQgIhK2wia4mUJm2GJTSbhPSpOR6sYP\nVmLeCsAfA6c0g3FtxTa86dC1XqrjOsRpk38Ye7GmnVnXUOv5BI8nxgXGugcM\nAAk7tD67pjrJzb4kBa5QyZyF053ImlsVhgcxj8WFvV5CrQWHS8I5OhCrjRpp\nKCYIorp9ktsk6Auv0iEXFDFUVA5ykAVVntshMP3JkPspvG9+zQFc6a7jACgN\nzSRkETWTbe7YLjoCOdZHgNWfSFLAezSZg2SB5AbuHUycxtIJmuMP80QOIdEn\nuEPUFhVvXzLoaZI9c/Dc0tnjpLp9lLkmfnSO19jJnr03hTK4nPIxODH+x0K/\nFd+I52ahiRgEWMiv9uilFTybfqrLV0HAjDrYzOdw228nW8y/ksR7bD6pUPXG\nMP2mDMMEMm7I1sPFqUZyOBN9MBwzFfLxA3st0IowpeWpBcuKGCuNN1ZoRzWF\nKogI\r\n=lUIv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGX/0e4QblrT3nSJdm2Ol5eTaZQdcOtqa/f31AgBUWYOAiArYzlyUKFlDyMR2t3ihRbPZmwmGFqBWDwALbp4iwSg/Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-verbose-axios-gitlab.20190123165420_1548262653091_0.3348710874168279"},"_hasShrinkwrap":false},"1.3.0-master.20190124132630":{"name":"@atomist/automation-client","version":"1.3.0-master.20190124132630","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fb82483a10ccaba82a90fd466ca786ef169c6fec","_id":"@atomist/automation-client@1.3.0-master.20190124132630","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DddUitPF7whNmcEHkt8fupIaAmqs4qbwmGD+A/XrkwL5WpEUjSExb3kcURRvI3Rk/qnWwcVUqJejVJvDk1DvIQ==","shasum":"b17f1292d1ba0a11a31e0f150bc21b87808f1a04","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190124132630.tgz","fileCount":611,"unpackedSize":4979293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSb3dCRA9TVsSAnZWagAAoHoP/ie20Wy2GSHXGme+qMfu\nTB4SvIDeGNwkZOm0Uu2TYRjKkxa46qeebZ3PCv3KWfQuqtSim8I7xO/hdyev\ngvVWKgTgh0mDMR57chznkGzQjOIELx3sUZp5qc9K9R5ZAV+NuCS8gIoQK8yp\nACy2YiyHndfaJlGaDRqu0KgeWW+PQ3Ufu3fn2BgGFk6QSvBL1b3Mg8wcW97N\n7qZhkzUn/eeIAdvyIqppUhcmIJck6oEdt6OeJ3mjk3k4cbR6rEICq03eD5I7\nvWAS47GJih1osm0bxp6FDL0vbe52m924xqgHSuahAfqgPuCGhwiTEOCr7thG\ncclfZHPuKZ904cqmp1ZwwHNQKSomFlvjwDGFkKI5HFmjLRViXZUz0qodX3uP\n3TAcy/h2HD8WcBIvPoQUw2Bwk3XsivDTsu2If71XwTjuc86y12P5DkXkegzC\nzIPUcf7MIsj42qeeUgwxuQqfKv0xyd7dNfOqEFYFhQVA1U1N7rC8XcMSUdsG\nA1844uKYycBnibbKBeUUaVD4hLZAIUXFjtOLvuftftXqZNUDv1d/DJJhq1b9\nCL3JgMEV3qfeQvX7rHTw5uwfQBtVXWQ3qmDwtbPJDdFmUAJb81GvYIX+PJ/3\n+GBz2kwbRBOm7qx2One/lqXkX2FASgUBmK3volsmQgRMaTr9iGKiWg9toBIf\ngCeA\r\n=H1Yh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC871aes/DuLvuzTthFfECG9lcA1vMWizCgpblv9Ol9KAiEAsFBuFfUKvV9tgiAdunYVYlpGvij2wu+PT6pxzEkjTKs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190124132630_1548336605204_0.17695706830707558"},"_hasShrinkwrap":false},"1.3.0-use-http-factory.20190124154753":{"name":"@atomist/automation-client","version":"1.3.0-use-http-factory.20190124154753","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"34cd668502f3e004d0af027dc1964b01ec980d04","_id":"@atomist/automation-client@1.3.0-use-http-factory.20190124154753","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9AkmasprlW1RG3wFRbKKVYYHN9V3m8jjlKwVbJ5EVuSk/0rNzmbRuUCgCirMB5XJ5McPgXrRauqMFHWOpepZsA==","shasum":"1f7024aca97214ceec1d5172c8692f48d163eaf4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-use-http-factory.20190124154753.tgz","fileCount":611,"unpackedSize":4978359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSd8BCRA9TVsSAnZWagAAfL8P/0FJWC9EN7tsY3wwFQG+\nvUmiEaLWpMcgOkS8taaJgQP7gCQ2L0l0aGlicVN54MTrODU9+f7N/d8JurFX\nqpAR8JYPBWp9k5IqOVfHWMgYtVhK9WqTcCVKNA1rkR8El1tm7UI51d4tIRHa\nK3x34qCVnB4NDak+BW9esSnWK4bb/1wKMEiY/HA8XyQk0Lwx1Wu7qZ0qQJVE\n9Qxq6QAd+C4tdlp5XGlIFhMsgsZ4e1ZHzRW//lqDdRmYvfi9X0aaf2i3oZpJ\nswGopuady2SgSmIFWTFZg2ephCrBwRN7iRV+ko8JoHIuYg8z7vxQ6M36khNV\nRMsFFJcWnYPsa8JwbzApm67Cijw3gORBUN3hqkJtyd6yAVq+Y7pw5GnXkeRl\nPnAenrEJpd2hlg/E1vwcUyrD8MhAyFMWZsnCVSckou9N2fpiYtvWPrAa2bN6\ny6p3hiePA8REaO1f7GavlB3ehqrC+VfBxs7rPpMeLNWzKLzhyHO5e3E/6WqQ\noUoo48XZ8BGmRKVr6XhOfOs0k3qv5Dv5sFV+3rLABa6XVeciGA4Z4iuC1Dn7\nuxLPlkrDbpbKPpm82cjl9EYdMFtYt0F74ILfeLPE8VjPMPAmaIXyDPi+HQZ9\nLGCOgzntW+BbVTIyZe8Jm8Ty0o1Ba8jdI3XwjcWmHBli3oNAFUIBCpGR3L/M\nE9ra\r\n=EL9/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgrexdQQJjbdKl1o1Mt2++4sf4dBdtTUn25olcf6VJjAiEAlrwirYR3BlB6GQjoIkIo3ocEVJ2trLcFbunttM5dnnk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-use-http-factory.20190124154753_1548345089116_0.8532952241874285"},"_hasShrinkwrap":false},"1.3.0-master.20190125150355":{"name":"@atomist/automation-client","version":"1.3.0-master.20190125150355","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"599ac971238b100359609c4fc0a28499c5b632c5","_id":"@atomist/automation-client@1.3.0-master.20190125150355","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cUGbGd9uGJuH9Ag+yyt+9Bg0dT1brRHO8pBuZRiGEEqL8cHXgM4vQvkv2WiNdVbU/D1yIRU2/Zdda3Vi/GlL8Q==","shasum":"5d08cc6061669ec82b08aea0cd7258bb1a93adaf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190125150355.tgz","fileCount":611,"unpackedSize":4979706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcSyYICRA9TVsSAnZWagAAE+8P/125RZXJOARwYCoffuS7\nzz1PCarqKChfZVAPFeSJxSM86+q2o5p90/x7ROjUVFTnRl6mhy8sRqD6usiH\noJuMIotJD/sY9OSWhCU1buL1PnriYNoq4UxHylozBaLnwy12ws4IWc1Q0uHJ\ni+k3EMiVf7Fq0wGLDapMmJbf1sDaFb468TesYopANApxZVErvWouTSX+cPuC\nW2bRE4HuTSQ7R1VjpdtSjOu94lRmIDByBnXWiaRiVApFKZ5upIZdeqvy2M2b\nmAVjtfhMghVaaArKN9/alMGErKsUm3MOt8xsqTI/YGGVcw6h+4cfSZ7WPQ+x\nQkx//3dgAlNkDxKOXzM9E1L/hk6LUxdCFwxvy5rqRYrkqys8qwqKKRI7CMIB\nQ9b2OJ3mlbdJcao8zLBTolnNTCEdVVpi1++xt5S8LPmX/E4ywWywvtldh+zP\nJqhYyskTI8ZTBjEUZRMSqi5LunAgJvoMkgLX1eIEtXtYZj/FBvNBeGsYafzk\n5e2EIJ6yM1eXUn4WQFPqJ43CSMAHCtl4vMcPuG/FFt2Pjhiw+Vbbrxl7Rxse\nmVs4puny7X0IlezdayOklxfLvym6+Ec+knvY3PEIChlZOxk9HjnGEfGqX1ZN\n6sBv8ytcAa+NDQInRXZ2kGKFhJbTZnDFP/dS5G9MRk6xoinMJ0uM4xuKSG3F\nPCV6\r\n=nD3b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD381GQ4JPz70o4rOTqsEgBsPUl33uj20SATTtf4OHEkQIgecfQDRLtpIB6P6MEXhPUOvLMwp6gXwyBHG9Tu00SCs0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190125150355_1548428808267_0.311984325102441"},"_hasShrinkwrap":false},"1.3.0-master.20190127064847":{"name":"@atomist/automation-client","version":"1.3.0-master.20190127064847","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d38dbdf431bce8b0e5e414b5bb835cebf4c7aeda","_id":"@atomist/automation-client@1.3.0-master.20190127064847","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-zmFg4ZmOBj3uccqkmwq1Qml6ibdaxQWbbEKyATI5eRr08e6XmNI/ZjhL3Wst6o3ri8Sfmkyx5x6Pr/x0CGZ19w==","shasum":"dda987df7880e06e4cc6ac04931a5e1b4d4b8d7f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190127064847.tgz","fileCount":611,"unpackedSize":4980052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTVT+CRA9TVsSAnZWagAAXcIQAIVfKKLpOqQJQqu6Vqyq\nhD7+1o5pl/jeMmXnenDYu5WzUhPXKJ5ZIg3/9e7RVC4qE+BDWaNku8RDM6UH\nOy9zDu5d0Veprziz7icpBxV44RcvE2WhNvp/4XrKkJXULDnct4FG6I0p3K7L\nt2hArBM8B7t0Ytg45tj0OpDri7gTA3lt517Gtaxp+Ae1MkaJXc6iQP6aqUmt\nTG7h5jMP7pB3CmX3VZ+rv5Ag7gmXxDTl9g8eH7urXPtSkP9yv/rnK72dVrT/\nN3tRv1tZqUaRdEM2fOO0O9Ms71Y2lDqbXUFb4u2S5nmqUEs/Mn0GXyns8Q1x\nwrjH6hLBt28dvBkNWLcxZ8ENhu/4VEPqq6d+YaDA5R96CW4BQf2dVNFiG+cG\n+3rC78OqLa2ZWOm+M3WAXF0Nh/aDaUBbnGwyKPOmA5GiIULed1q10tk6yyRM\nzaaDKcw1PkPxF9hG8dV3kV1p84on4z/tic6MPxpu/5ohW48Ls3fxKouj5o0K\nTcgCLIhWNFpyweYVSyXzpIl05R1yvmblxpyvMeaWRXPEK/l52FSfiPopMQU7\nW8sSOfuqcPmeC+V/y4rBdpYAV8/3Sx9b7pdL6yS1x179fcqPKn/T5HqZX2RQ\nGdYN2RI7UzDDP4cjUvmj7NI0pHWeNIUewJ0ZcwDMGoIi5Vwhh311kJNyWyh8\nSaf5\r\n=GB+t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDikvquu0LfSpbTRXTPezsaOdj2I7kBCxQ3mNj2fNLCRAIhANxa9ol+MAabK7EHjdfM4g4GaVRBRxu9y2TK7w5KhPDy"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190127064847_1548571902092_0.4439486806542239"},"_hasShrinkwrap":false},"1.3.0-master.20190128204925":{"name":"@atomist/automation-client","version":"1.3.0-master.20190128204925","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"53d879e91936b9f5fccfbc8e578a19ade912b5da","_id":"@atomist/automation-client@1.3.0-master.20190128204925","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-RvNBg8hxYpjU1ZT3gX41jU4J0PZTUarB52zuu1ijHqeaCF8vQfxImV/g/vJJPznPIrS3ETJ6xPass18xkCSLPQ==","shasum":"cf6e313c5336da901fb571d8905b3d191090ef2c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190128204925.tgz","fileCount":611,"unpackedSize":4980633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcT2vgCRA9TVsSAnZWagAAuH8P/iET8G67j62dHv0Qdzod\nxy6aOFzgwzqBHOmu81AD5go7a/JTF4KCd5jXs97o/s8tdfGwN9oSVUviF+P9\nM6YZP3BtgDppBVx+evBbeu3KnCFHtqC3+tlc/Bo1kqCf2qmbpzT/mvTU5JSo\nqHQwB+7ZWrKmHdfg+ONxdLeX1M6f8G3P1b8gUYMDqgfg+950msN/FzxzfL5M\nUIiNVS4hTgaoJU+PnLGIx0/sYv8Z/WorWo1ztgPit4J8J2G0qE789DTvTbqC\nwGdSX92JqpnOV6F2i9RhBybCydtJQg2r0qNdYZ7oxvVuAOC5xEiizb2k1dgJ\nZm2gWAw+kXxpO5Ia0T9rTQjL91GVgYK4BpgXS23RGGzePMdExjGbABqsW52H\nHcnsd/ZBnceJrlv7yK9caEgtWodokqLtZE1Kj+MmTwwosHsN5JyDzo7JVfsQ\neZUHYyAf8b3fLzIO4BuZvA4iExnBhNUjPX9FFqi8RqSmC6s4GiIFenkjgT9P\ntI8G/Fv94F1hwYYAN2yTlD/D/HfsRrPxdRXZ04BeSkqVqHYkVIklAo6OOYac\nQSExVis2mgEamvuuuxS4pIjjaxr8aOHTXWm7OTSgSCSIxx9IssQIsHc6AOMk\nsW4F67pUr0VqMiEFvorIVRuhOxDQiuhXPu2W5IvrZzBzQWOUVBGcpX/fy5iv\nsq5Y\r\n=IMuy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxH4zyUslfGh+y4h5NmiJC6nFPFvVtdggVE5RWeWBdxAIhAPXS5EgVSNknPJCuWzhCfn71I5bP6tMRYXOjZNWncX0y"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190128204925_1548708831124_0.8204112440121225"},"_hasShrinkwrap":false},"1.3.0-master.20190128222233":{"name":"@atomist/automation-client","version":"1.3.0-master.20190128222233","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d7193da76c9df82439d4676a083d2866ce81cfb8","_id":"@atomist/automation-client@1.3.0-master.20190128222233","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-oRLvO2PKcktiGDWUBu2GATew1dsTmkEGACXo4ExBzpLlFAcZGAXPZyVTJPpr+QXk0c27jWp7N3xi3I+FVSgXTg==","shasum":"b0b39736dc5ec85326a014d05122ae0ac9b8d624","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190128222233.tgz","fileCount":611,"unpackedSize":4979950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcT4FSCRA9TVsSAnZWagAAq7cP/1/Sz31/1JsMnP7/y1CD\nBBr36YRqB7zuLAKK8L14thuakvr3yAip9jeGp27YjpUPyvIiS3atvgdxXPXq\nLR5XV5O7/rFV4Vm/HqFBO8RKHcxDL7Opxwqx2UV4Wxs4KNFGGVZBBSQwjEyK\nQu2cPzWNNNKB3+N/I4eB4uPn/8Tfl0NZxbeWrbnS41FgFtckkkWWTnJOSDq5\nO9mzjw/pO8ke/+W81JGkXeJuq8Igq1CUtKO0hlKytDPmm+Bx2xzB20cCelTM\nXpvUoc9oNHm7W+bolaSJLOciezg7PRnpUeK2D7vjVJo4ybrZlRWefcHJuknV\nnj/2lsNfZepf2vugcGJkRXW88CAm23etyC7NHKODM6WfTUjpyuKBuHM9rhPO\n83Fodn/nQhZToVlPkUIUWjVgKNAUfLjg8Q0usiGMKaEFf+wDGHiWQZEmxSAn\nmcuzKH6rDg4yJhh0l+X9ax9wHM74WhcNXH1Wz1R9fPEbL577pSmTplY+ZLAp\nlYlEA9Cga2GwBH+PZ+x4LGY504tA2aobZLBooDHQ7459aohb+LSESRRKYqsP\nBvee5OnHSecqEEZOEgxuoxomAoJQmuicwlYw3zrwfuaruxGhF9OQzdUXYVsv\nahUnWBWnW7ydZk61hqmBN4EGfOUWHsx+ba1GEWp5DgjjpIT3ZGgGP/CgMvQN\nJkdD\r\n=8fId\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEuA23QK/CiEhO+wkvPS+8Ysj8bVh36m6AwTIf4UY8OAiEA+TG3s0i3ci5A3KBdBECp8r4bpjjmG8rgxuJZTGxBpGA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190128222233_1548714321940_0.1546965031205354"},"_hasShrinkwrap":false},"1.3.0-nortissej.no-string-throw.20190130221301":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.no-string-throw.20190130221301","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.3","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ed6fc4894466b6126a93ed7d158c181b94b1ff16","_id":"@atomist/automation-client@1.3.0-nortissej.no-string-throw.20190130221301","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xydH+IrpagxErZd2gVQoAX8xzmcyxtEYUnyyqat7YM7SBfiQEQXhQlxxagD32OCiuyEmm04lPsJq2lHGn50JwQ==","shasum":"4cb9907d20770d726f5254d36e07a7ec330474a7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.no-string-throw.20190130221301.tgz","fileCount":611,"unpackedSize":4980000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUiJFCRA9TVsSAnZWagAAthsQAI96YiodVhxGq23R26es\naFrVGaPlRVyvp4uJEZ6SuJDWmujgfhb4bk7eoZEKREh9flFnI5ya2FF4N/of\nl5TuB5uoW2c2VPeqwTpuuGx1ArImLtZwC2s64jdx4qf10brJiyC2wp1KLnSa\n+ZYGQFCV2Ryemd5Cz6sqxscQF3M5NzfpI276Bam/zVKwGBzng9LIzZxOBXAl\na0Hi/3Ad+xxHBD7GUmTdeRHFmx/DPDk5QKdNaYjtM3PLnS+IkFLE3W/NQU2x\n6BbjgxBnYgPtwgcckSVaUx0Q9DPHZpffmuNTtv44vVNAhQ/8YrfcBFP/0sCq\naKTU3zurcGLfLAd6UlEdAiUq4G5TugMK/KD0/7FJsQZaup2TRHW/rcJkvV/q\nfJGGYOTVp5ok2f2rBaytE3nis9OO7SEGRHPYeMTNNmge1W1WSxItU5EhTUuK\nITLSWPQm9ZVKwc8yYfegx6G48i0x9Z5QIKxlAxQnwcCEEKgBXu/+a+kIQzej\nDCU5LVI4qJs5LhcrmPlvBUXVgo+jprLl1nJvSC/3VLThNb+ln7QcrdEfiqS4\n10GiHu/AwVjJ+XSZDXoMOZngIDgJqLFT0c1dhIJl6UVSShp9QvA9KLV/okPb\nIGMuMuTdrBsIVh4LxaJGGOFbGO+oqbiFGHjHz5TlzquBKIoiFVxdEWJZ07Qc\n0Ndz\r\n=2j21\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwvHwdf6QImqTxowKEy0JAHkmoeSAYROI/3iRKPf2YBAiAcSkF5RcDPyKaQT7ttsDiHOEwu85x0unvM+hOREK6dTQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.no-string-throw.20190130221301_1548886596318_0.5927980231122909"},"_hasShrinkwrap":false},"1.3.0-nortissej.mg-flex.20190131015226":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.mg-flex.20190131015226","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"03128011c74e3f82808f6680e8657e6fe31cebb1","_id":"@atomist/automation-client@1.3.0-nortissej.mg-flex.20190131015226","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PkkpoyRlifR6WCV2k7LTXOnlEUMVg1ruj62GFTwdI/3NKXD+D3UNUQssGivLI4F0jCpyqRZXjVJOBlOgHJHDkQ==","shasum":"6c9a7dbc7f38f0cbc1e8016d12a2f0498c771ef3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.mg-flex.20190131015226.tgz","fileCount":611,"unpackedSize":4979831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUlWICRA9TVsSAnZWagAABVEQAIpDXxV+cW501/zHDyX5\nBiH6Vma0yEXDQXsUqVtkMosSV2T495brNoJ6y0h2SQqPoOi0fs3nb2ZtsLB2\nmLoOWsUJ4cdt+v3X/GF9crFwRXDIkIbXaGwwxgvh9fUemUt6XD+IUGTnmILq\nlxduzXhvv5rpyKOY7Ji6K4zEKIgsg6qBLUOoV1ueIEAedO45RrsWbTKbu/Zr\nZHlHnu3fmjnXH1IqeNI4TX5CX7wZvdzxF0Ng3w+cs3TBBcmiINIYrg4lp9d4\nmg4XtDbUU8CvWvuYkzIGPV5WRUc1IYWH7+oDFr/w9DBJCnKUxJOXDn3Dk3bc\nyVnrNx5n+BsVBSslEUW+CZuINAQ9MVFS4jUnXHBVw2f7qC9VMeYsvpFgVYqR\nvj1yvl5V1Zbu3Ny2AmYM//y8iXOMT7+GMSyt11omhT5Y6ukq5zmEUEcRCjr0\nOOU7a+cpjkeHLC3efYouYmUmculc5AYZ1Xfw0gpxGFsQhX+TwMtM0dBfIQaC\nb3OOM4nMPLkno5fbCzUm4TjTCmia06dK4A5wIQvrX830WkspQzI1x0hhE77/\nCyVI5CsZWCgnYkgvP5iIANtd85QhFoEy7uErYfY+jOLN2gN3vEA47lcNJv3l\n1kfu/WwFmWo7TJ1EFv1Z1G3Og1YJl5oIYz4loQwRgqpcMPSIHbHkmrmwyfvS\n3Emw\r\n=1x6a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG98n7DRLG9r+3/9JCw/EZNj+t43gvEl9Rvl2L1n3zB0AiAZdelQukZK22Tiagj4lIot6rIDeADG9ao4iioWMr5USA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.mg-flex.20190131015226_1548899719692_0.0907057067893704"},"_hasShrinkwrap":false},"1.3.0-master.20190131044443":{"name":"@atomist/automation-client","version":"1.3.0-master.20190131044443","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"98441248347557e4bfda776a96c814daed3b77d8","_id":"@atomist/automation-client@1.3.0-master.20190131044443","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-/yvYbwPky44HczhVbJGg8HaxLNzbCi2NiERaXO+FbKtNuDA+oJgRVeHohxyVBem9N8N+FzC3mxkMKVeyn/CiZA==","shasum":"d0023fa5ec6d60135e69cbdb68696456928a551c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190131044443.tgz","fileCount":611,"unpackedSize":4979851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUn44CRA9TVsSAnZWagAAr64P/AvyhHRgdN3Bq5N6LhAY\nmx/i0sL/Sh5OTlvHAM0lX6HvW0bRnrWCkVv/Q/e3BB5+DCWfJhzmid+1g0ji\nEC64Jn3UXOgEUl7ufyIR1Q56f7FiYrwqPji0UuUwZBZ1szezb+mmPvgir3Zs\nrAuXXHeHsQLVr8M694EekTB+NFODWnrlZfk4F/RHdSMdvzgcugim+MGimvNG\nSFBUcIbzN2LWZw4cD6j2aqmKZ3vdZLtHOjJQjNhQaCi52j02rN+ht7kIm6I4\nTjakl92/qSHsJPNBFG0BBElVQKMFwKYeAe9bsl7fL8GLQ3YtgvzIx6LqDSDw\nyMV054ZV+vKI8RV/HYoxNj5Ekaif7GK5RSbdZyqh435aAlasjbTs3tB9EKlF\nd5cYkoyNKeL+EWb8LDWzOZWOVeaCLC8mnABYbwUh7L7ThY+Acc3cpB1BbAM8\nlEmW2DyfBPFry1/73Ee3sS7J4nTfWGK0eCbrV1c366tivR1VV79ZJR9awULk\nLsHd8EYEt5P0kS0KVgjNv5dTLiQ0EMq+naDHuEN74VdPtclJ3LNlUa7GqeQJ\nOWij5XAcMRHOig3Q334yfBNgDHPVO0sKdzBYOnTk2x3ezYWFfuGvyFEymAB2\nYPVsTA2TXoPSw7ociaDaQcLOvifzjvXag39/VE/nquzbjVFTcp40KibJW9uG\nsLnB\r\n=QiSG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAifR4d3VGK5lQs1FY7Y3A5gv3yCw1Dd8dIV9kCVop2oAiEAo0NY8sWG/G2pNMwhUMb0WIgXe2tJHXh2pZKfkhkrk9I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190131044443_1548910136242_0.7055197058820126"},"_hasShrinkwrap":false},"1.3.0-master.20190203162633":{"name":"@atomist/automation-client","version":"1.3.0-master.20190203162633","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.3.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.11.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.2","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.119","@types/minimatch":"^3.0.3","@types/node":"^10.12.18","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.1","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.1","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.1.8","apollo-cache-inmemory":"^1.3.12","apollo-client":"^2.4.8","apollo-link":"^1.2.6","apollo-link-http":"^1.5.9","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.3.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.1","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.0","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.0.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.1","isbinaryfile":"^3.0.2","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.0.0","lru_map":"^0.3.3","metrics":"^0.1.20","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.9","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.2.2","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.1.0","winston-transport":"^4.2.0","ws":"^6.1.2"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.14.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.0","typedoc":"^0.13.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"044e05a4cd2576c2f55531c6f0e6c686ed83328c","_id":"@atomist/automation-client@1.3.0-master.20190203162633","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Lfk92X/WfEikRx/0J4pMUe5dKDjINwjs+CxhVg4V7500z2unELvK6yH0oXs4gsm6fUM/05+sPKL2LnO/lkNuyQ==","shasum":"6eda38d81c0048358acdfb6bf9a29830bcdbe89c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190203162633.tgz","fileCount":608,"unpackedSize":4974457,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVxcACRA9TVsSAnZWagAAsRAQAJG0YpHKUtgCoDJgQ2zS\nNrBQ8CGniD/I3bFFybiNBYo7i9/tCxJt7h0c/y8/VddnZSf3381rFhCsat15\nQI6fzvymfZtUmEVBFk55708Rb+Hazf7WqyenzkiZvGOn4B2XA/ifMlQnDUQh\nHqoVFUKXpTqYzZn1ug1BePYwOfrEMvaL2ioi8Eb3xNqnGj0KKSJssPAgWbYY\nR01bOXdOjTu8YwgWZ5D9Qs1SovA9XoBp9PMi4HP5+cBqrHKizNn5zPe/Y5Kg\n4DXUhxd0c3018cuSTi2Ii8hnP2ntAE+ghdcbMZpKW1MW778/ZzkX6rfpuvIM\nNo2jBWPIHHHqUhq0VuMZoyi73hlJbjg8WCTxB1icEgaO/sJkqa3nK8D/eqj9\nwD1m+NXrkbkulqMHAcM0/pNt22nnUJ1HmX9rJ4/Neqi66POfQ18v8oBMv9KX\nGqKpZT+A7HUmkqwssTnl5rEEk0f1HnJ5huG0mIyHJP57yMtBV/NpeMfuDQ5v\n5htS0nsR7mgoCKaeFaiiSS8xhpBIRQdznqJViVQaOmC4GJVyGauPolhteTlp\n7tQa6+8Uovh4kqsTcVcDeuoqNX4NcpRvq5HkGkEG3GsY+DuDjFy6/karnp5U\nx+N2UwXPa2IjxCbQEGqXmmG7wIQHn7lbgnqSg/t6Ye78N64QqbExWjZIeQci\nH4k5\r\n=dvAE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlJ3LFLFFYAhSu6iy6vxmUxLx1UI4hIADAQQOPmY+m0QIgZ4k+uD2vrIUbgtKNHfPKI5gSJ3QwSZ4SD1/OipSZQf0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190203162633_1549211391545_0.09788416550056578"},"_hasShrinkwrap":false},"1.3.0-master.20190205134251":{"name":"@atomist/automation-client","version":"1.3.0-master.20190205134251","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-template":"^0.16.1","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86e709453e64be77fb01a1b0d1a2af7598d854e6","_id":"@atomist/automation-client@1.3.0-master.20190205134251","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LTal4ciJ8xAnyS6AXIt75xMRn5v50LZqaGNm9sUbULtL6dD5HTo66ZmbnKS59xiyc9A3jVYxe0rbk+qFHbm7fg==","shasum":"fb288d13fb25358033fb605bcd1aea6ef4813f3e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190205134251.tgz","fileCount":608,"unpackedSize":4974574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWZOdCRA9TVsSAnZWagAA6y4P/1QTFP43nhv7pwbk/3Vt\nFX2+V4NA0kSIeCBHDLg90RLFeT/Ke+MbmqHwZwmQBtFEgm4rLgsLkbJcux4Q\nRpBhWXVenIGmgBTosB0nOi2hFbC67dBHRJlu1fGVikJCJo0gweseAbFgWKb8\nTwFJZm2oKwkBeOr74vrlE2TtG1YHMsZVUw8SKhLiSyMEPKTQeNWquUmXmXgP\nlW4hwtm94IozlxETI8ePL23abPvTKJV6B8vQwsIk/+MkC11hPe96TnjY//KJ\nWWTuEXSERiocbvEDbQHX1hjy2XB4KAJ7230t1Z5CC3X+nI+3T6Xym93lNDNC\ns4LMjQYEMk0v3mumO0jB4a1eFhPYKYWOQodyXi8a2IdQPBS41yglEAKGJqkL\nuT8NLZCxB8oczaI4P8HTnxFlLWOrNNQPvNOSvVFPHS3PD3kF0RZSo9nX30xm\nCAqAeTrjd3XzKwh9ZGMxbuUpM83hQketwsntPGL8FwEiGPvb4hYAgLr9Hajr\nkfv3avoqUIpCLPz4uT5qmfVrqdUMXfDNRkeqY9XgZKdyHIzn5p2DIvsneREN\nIIKe3ekF3GJYSjymDHjZtSl3na9QsTQ2bUvMi0Uz8Tz30zhJSjlTyi+pstOv\nlqLH0lMgTxOORuXDE8bjMTjtsUeZSnmE+RzdAPYscgYoqo41xhORnZplg3/C\n9gWm\r\n=ypvG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYG4RSX86alYGDpxy//vwkkQaoecZfFCJxJ/7FEIf/ywIgZMk0FZWDDwhyuQBVL9HVCCDRxfyDJ91pVudgzIDiiRM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190205134251_1549374364881_0.04546346505927379"},"_hasShrinkwrap":false},"1.3.0-master.20190205165735":{"name":"@atomist/automation-client","version":"1.3.0-master.20190205165735","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9224ff6b7be536451fec2549caed8a67070d8858","_id":"@atomist/automation-client@1.3.0-master.20190205165735","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-DR/L92htkIahBRGMrpTmnEJbg5k4ljQMhvV/sWRoJDmDFgvT4OnH3UuFlHTH9AR+i/wpxGIuUHzsBXGFVjgkog==","shasum":"877002a6866371d035ab67228804a06f6abdcdfa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190205165735.tgz","fileCount":608,"unpackedSize":4976688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWcE/CRA9TVsSAnZWagAAM4UQAJLcom+VDQpQVZb2btVk\nnYobDyOamU7TB9ZkK3VG1zxZW715ZbKGrCaqzZkm5NbUtd4yYlTeyscm+Zfl\n5vp81ELFe1pyNY/inG8oRZg1VJKYbtZ0IWOXcA9UAMcpZ+osmIY2ELlAdO0T\nujtbPVPtMPpAwaGlkmdTxU9KuVDnLIbt8CaU3TiYch04V7sOBXJqbNhVDvi2\n4gdllorBhy5b+aVn4rAYlkBunzNI9y5l8+VRCZNW17x9PsVfD2sq/onG1rFm\nfODRuybmxWzkT4pdiWKq1QI//u4bc2YcrAuDIE65T62onvIhtoykT189YWw3\nDlAjr4gV6z2vGzPU4TcOBmpznvN7kgP4AqSLZ7qdPlIgIDN+pFk6MCI9EXZP\nu89jVYiv0NbR0/dWivUGxaELUBQDYVaI0NKbAbyju0rqtRm8IHoy4Sxz7zKN\n/mE1K5UhMKO/qdRRT6Bo8FWBSmj5IGrALyCrteSJ7Zhv8BxMbtZh0W9Cwy1O\nflIQ+AOId1iX5sdsdTfD82UDXLBEALceQIJ5ecHHFftXqFqqO8PGMLchuwI7\nNvcI/26vfHAZSBAkcnVKfBp+1j4rm76m038aGUcv778iFjnXjrQvVSuKDv7a\nUYVbPaf2S82oCm4Lxspto6ujICHN6JfR2wfwdVn2HW95jbFXuBMEMhJOFT2D\nzTqM\r\n=P6uE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIfrcmHd8MkAXTUvdT1Pt4jRrumha3QOCp+K9D20YnBAiEAsbHuDUy3kNiXLzz9H1CcIVJyxJc/u788IpcJUeZ3lb0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190205165735_1549386047241_0.12532207161799436"},"_hasShrinkwrap":false},"1.3.0-master.20190205193925":{"name":"@atomist/automation-client","version":"1.3.0-master.20190205193925","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4948c19d471cfd7580bf8b41afcdb870c0ff823a","_id":"@atomist/automation-client@1.3.0-master.20190205193925","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-a7/CAlDZlIlRAMMX+C59pqg2nnPrXqJINsX4dnTbSkb/85jCNWZFfBJRG885gc5/s1ydteUDYETiy5rEuR35Tw==","shasum":"04a853a4408fb7d54a9c264c34dc8d15f6be5061","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190205193925.tgz","fileCount":608,"unpackedSize":4976679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWedcCRA9TVsSAnZWagAAtc8QAJJLVhOMmI03X/EeiLgG\nGN5ozbtc81P4UWKDb+bOCItMtlTpZsWAcwi84uoUpNoJETGlImCX9iqToNJg\n5fa5p6ejIzxjFgrtiW4xKAR48jd/QdCYZmpjRaVPDdKOSuDg1znu3GY/Y8QD\npSsYIokuMdjs3J70Tmvoyc9cmiAJ04t99gu6agpRYMnRbtN5MreFZSnzKSxt\nGgljj3gPdCbToDPGleIqQcUgxvsBW9e5de1lcCDvLP8ARvVKHeWZvonz84JP\nlIfwy5zMdRcJUwjANs3LttmyMXiOHcMg1ehem7SRWT/vFquv4Ctvn1IgSTMQ\npY6EkkGh4K8Wtq+ruiBrTbi2pPElm3q/UFG9nOyv4ONmOVha23L79BnUMpNC\noFaYwcriL1kkFk91goJWPU5sj/fY+zTeTmmjS5/Ti5zEl0V//5AtrbiSFVEg\nHFXQFFI7X7Mx32zpgBXgt4VpXk6OXzS3+QR7+uDY6iwAOgL3SrzUTMDDeBfx\n6z+urENAOIAHeyqnX31/TgjruNCEHZ8H203BepO/pK9FGFv5n9/KweniGL2n\nn1xApBN0R0e22XU/1uRRT4i685vTeULzg5PFaRaerwFDPge6DQrEjtPKoLhl\nfeojYuMHs3PCkDUWkQAPV/2PqyzepuZx/ubFbjKrhSGIQdECH0WdtHtGB2Nb\nLZCH\r\n=Aust\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNVcGTbs4aDDWrEnXT8Elf4qSLRckzLLzok+iQVQXz5wIgBdThFSu8eQkQm34tkX8IGQWK0h9f6oYQf742CDhokFU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190205193925_1549395803620_0.39431463889062246"},"_hasShrinkwrap":false},"1.3.0-master.20190205210857":{"name":"@atomist/automation-client","version":"1.3.0-master.20190205210857","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"00d96759a961f57c36ea6d4cd2d0f218a8f7fe95","_id":"@atomist/automation-client@1.3.0-master.20190205210857","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-PY7oPf03PDPaKx25833nZcMkkaJS2l+4F0M+YoACsjJ7QmR7mvOe53x6f77UjQQWstpk4Cpp3wzcwz68HgIBfw==","shasum":"526d10425940bb32259a425a54fefd198752cc12","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190205210857.tgz","fileCount":608,"unpackedSize":4976677,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWfwkCRA9TVsSAnZWagAAg2AP/R+1vzL5CYzPxdXPzg81\nLzyf5mi+TdZkDu9n48KfSxI1TH+TKLjFM7pJPiRobmlCMZt1UQZoUDoGDt36\nkspQjOEaH9YxKWH9IEQGzFE11UbeLxuZNDybSy5aLYeje3OohhcWlvVvUOPV\nEyFkaLUrfsASzPHHFlEReg1mLVsb3d0sYnXlZ8FJGTbsUNbe6IWb4XUHy2Bt\n8LAI4gdywui3lbb28xivFeHzPp67Ie9OI8ob1gjCQJiYNl13ynoLgp28XuiI\nSJ5mhODEnli8EqHnDID3sxKRqP3Yorpf+n2nGVBqO8tnac8tCpkPAxvtTa1C\na7uWKcD22SMqMvVCiS3y5IafUgt28ORMI2zC9oHXOkdvF960msT7R2yAtqVQ\njV4v8+NCO2HKvJ1ld4waoatMcQuc1IavcPR5r0TtI4JQP6G+tVQE8AVtShz5\n4huBdRBklKqOdrNoXLT8gHcAQtADw3y2KHopD3uhGQxjd7lw1nQKiHEJLRTy\nhBN7gfL0Ua9z8R2XPYGyM5bV5reRAbhlKiObViNQGl3IHd1SrkRYukFxP62k\neG3JcBrkkA6ekWw5twOF6oixwQwl8cDP6SLnsBXJu/zYqZnJJ/XxC6/BrfFJ\nqmuyCPzSlv2fCHyiAhIf1tk8Cph3YznT/hkhSiKAxg7eOuw0Yz513AI+50sC\nUTBh\r\n=7TnA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbi7aQ5XMQqeUO9CDT7bCHY/2HPFotiB2B5+LNRpbV6gIgXo73KI2osFzgoiK79CWnopIQU4hyQjBVJv1mGnC/F9M="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190205210857_1549401124189_0.8499602184583852"},"_hasShrinkwrap":false},"1.3.0-master.20190205232644":{"name":"@atomist/automation-client","version":"1.3.0-master.20190205232644","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3b09df54b6d3f4a2bf4915cd131021a2563b9923","_id":"@atomist/automation-client@1.3.0-master.20190205232644","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-v8iROxtOoz55OsEqEq3capWsQJO2Cg9QkFiZ8POGf9WNMaerGuV28aZY6R575zPtqvqonpT32l7kljZCMn50Iw==","shasum":"1427793dd64e488b693ac4edef17b670b95ccf55","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190205232644.tgz","fileCount":608,"unpackedSize":4977157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWhxfCRA9TVsSAnZWagAABo0P/0Q9onyf+9OA3IJQo3in\nruyJ4J/3bkodXhE7zG4xbcM61hZGBUOfGn5w2kAcbiI/i+CZ4Bdxt2xu4qf2\n0HNWAJqyi/YdNwDA1MtIZupUMP7yk1EiFD+FNiC0aw0pZFIpFaLjE+tIxJvc\nUymp67bPOLPgHSmYAOgkWVPwfji8ldPKV/f9MtSPsTZMPLXgV0N+ij9mvhIP\nMXGjSL5nZIG1WJuRUdzKF8ORYU9f2/CDlCCfustEOrIs0rElsiOrAr9FGTB/\nI2pKPdKKtPcPRfLCVakS3A8u6zdA1I0KbEq1lpyDcCToa2nKKrhvEIj4ejgI\nWA0vDiUZp+A8IRbX2V2SYAO4hv40uZykGLDCTU2GXx7nRJH5AWt7IH7/5Ghv\nHAOLEwGYFY4o9P/Veu+Z/o1ug0jJ/yTwO6ImsimIlVcQ+ZiXKZxDPixk7U50\nKOygp0hK9KpqgOG75MpNByBv6JHEntb6cRmYL7pJZ7hts2n5njqrRnUR6SQK\nU402V86mnkn4zGgBdJdc5WIsgn4WVrRNeLa9oy7AKOsXoxC9lmQkODhwD7+H\n8Yqu2Ir9jNCPp91jcbTUR1MNNHVbcn7dFNkFDgN6ce+Oi5wUE+28CFEoa7vu\nSHq9bHX9YSPA+EoujV1o8O42h8Nc5lkVLsPXZHjvYG9IFvtu1bK5ptwt39na\np3Rn\r\n=oslr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVEVA6X/v27RS7R+GOoQ+mY7+G44llgJywaGES8jzpNgIhAJY4Il5t76ESBmkqbd7L+mqYfvtQIM2eGgG9fR+908HQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190205232644_1549409374923_0.6420476221658351"},"_hasShrinkwrap":false},"1.3.0-master.20190206133811":{"name":"@atomist/automation-client","version":"1.3.0-master.20190206133811","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d4ad124025f4ba50f48dd85e5e0bc14226b04dcc","_id":"@atomist/automation-client@1.3.0-master.20190206133811","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-9km3kY7mbzyiKhoZRi14lsCYJX9L3UfC+8ZnFS2DKBMjTVbaatNsJ+ijhE/7o6r/Mm+YQ6Ux7wKtHhZtPD2lnw==","shasum":"6d0ca2b6a4e77b7cfb1b703ed051c64ddc65405c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190206133811.tgz","fileCount":608,"unpackedSize":4977590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWuRRCRA9TVsSAnZWagAAvhoP/2O9TGyGr8qkq7uyA0SD\na2OntxBjnCs6AJiEdXlsfKTc5Z5NWmVH7KlqR8BKsL4AaNA7YE2wscfPs1Qd\nx4UYG41aFGmYGkSJUWYv2Q6SVQRsXbyHCD97Yf7VbWv6+SrZSQlCnkxiFOmE\nWmAHnh0ZAzP8rvGfjoyHqynrlTJrHCJ2vrSGluBkmrnYorgDtnaVylrKeyZd\n/qovV2F0BkaOeR8O7iUM0GEG7YSVZabjIyW69qntRA8KkmwcPqYXDOsxouv6\nfn+fiTasGwtsSRNozUakSu6//3amFj34VH5hbsDx9pPvlzECRuVDgx7FD2/Z\niCuCeAqh6vaeS4IdvgPUW4Nw3LcVx5WARucUviQbOcFEotl+okPpkh0v+3mv\nGmo5dGL2CwZrRpPo2F9ooPULvp7eT91aRVLn2sp0OcGh1GPVP2gDTGfVHGZZ\nyLzl+cd+SRSC1KssVNeqmIH/nd0h89J3wMq5JtvzQrGvm1uL8szQWbZrWbnz\nY2ULa6m5piVEwzIci7/NFoIOxiPhRQg9fD2tYmYtad3WXqzG3c+I1oAfayoh\nsud3Nc8iHQ5nGf9qKxByLzQy0YbOvPRgs4tuQnsBzVBenVGwQYjCiyKK6dhc\nANVj7bYRp4+55Tic232JwOaVp74VtmX5D4IbIj9DQhOVSg0uVXM0cUa37O6V\nCqdq\r\n=rqTe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeAFtSDgaCCd5I+uNuQcxrIX9adi4B8e89G/pnJ1zBUQIhAJAz56nXB1569R7ZgFuAoSx36IGX9a9nTHHPgc8Xze4B"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190206133811_1549460560826_0.2925903081036121"},"_hasShrinkwrap":false},"1.3.0-master.20190206192652":{"name":"@atomist/automation-client","version":"1.3.0-master.20190206192652","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3d2721ff4d26e5b23afd2d7859d3f9ff8a2366ca","_id":"@atomist/automation-client@1.3.0-master.20190206192652","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-r0MmUgwOLKr+L49Wx9c4RhaVIBi89xpjuhRrq36uZAvx3TxjCWxzjfcbHOZQzziYsJ0H2p2l/tDWCbCOuzJTsg==","shasum":"a7aeb14f19dac691bed2c556a653bdb272744fba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190206192652.tgz","fileCount":608,"unpackedSize":4977142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWzXbCRA9TVsSAnZWagAAuqMP/08MpJz3rVsMjdpJL/b8\nJnE0YReUwOsZYa3TVSe6Bp1YCL7xjMkLNoCt2enQOsy6A2NMCzmrlpg7TMq0\npBhTb+Iquff6snyRanq4khAzk6l5OkQDCD6VYfKsGiu/Wo6RYahWLnw/1cax\nkT2K9mGLqLFBOyR6R4+sN0vgNxRmzU7IkmSeyr1esBIF+zXXrXIsa9KQH/gH\nZPn4Pz2WNwfVieH3rXPLdsaIkyRCmnDq0Vx4h2I5EYMy1piLwknzB+XKMB4Y\n1HjLGc6xBKP0AHdmZlcx9mTPsV2jVrlQZdZFZsP37rUErxebuFpfe4lbJGDM\nV2DpV8V33ZJt7wDX3aYGbI1T4M5mKPkmLMtdgm/MXa83/YhBG40hpQh6t5Cr\nCphEVSSAt6GROO+oK1NiLPSQCqGcuXqZeYo2UH5spirLCEFjOOqws0GrnAt4\nJ483geb5hsuAdpiOx0WaRFB3sE8iUQxedmYI/bTsbjkR2FzBjO0YhijnUBCr\nKubb8jwjcUhwfZmQJ4TfM+GSvEfR22UhIg2oYPlVB8aAxckxMOEh3V8u8fop\nliv+xd8BuVq42ywDMqK5p4ANFfnmS1JazZzX2ssXgO0IDtYqjLWtnmT3Bgul\ngDP7gJSMMvqTT/JS0INqXb92rNIYPXAqPGiacMr4hBJsCBizSqmiC6Osg/JV\n1fld\r\n=DTeT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC1i+GARuGpMeZS6SDbTjjQtao8+DCfTmpEKmiXyBaFQIhAMG+4uD/2k96gOn0r2A9jZKZ2V/X4PcDBKssBCKZD5hO"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190206192652_1549481432785_0.9481597652029305"},"_hasShrinkwrap":false},"1.3.0-nortissej.one-test.20190208231626":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.one-test.20190208231626","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"29084c7a0e866fe16c57fd737d105130db80bb58","_id":"@atomist/automation-client@1.3.0-nortissej.one-test.20190208231626","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JIHsG/7R6aN70+ifp1+rdjOh+NzcaZ1vD8fMh/m5nTcrTdKxh6PJptWc/hv2bCrJlvQbQh5myZIjbPRzGB2iRA==","shasum":"642a553b565feafe012b6220d425e6d2efbac1ba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.one-test.20190208231626.tgz","fileCount":608,"unpackedSize":4977154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXg6QCRA9TVsSAnZWagAAMhIP/305KS02IOQ3vDt1kCYd\nza388d1iRrIDCrIBCP+GWRXRiNA84X7lav8Uw0EN+Y8BxEY2En18ox+T4fWR\nI3f6My3MSdEoxQU2GPAtpSERqnT1305S+o32JOu+c7izkPebfDuK3ssWBbOs\nlmM4uTDOkCNVeHGz3HlJJ444y5Bo3fKoQUOfOCBsT5u3YZWK9Lq9WgCr44P7\n516P1lEV8rdZfDWu5csGYeX22dYBDrnXyoomqO+IOWmcMxwyx04aShiRHdJw\nQwHchiWc9tqLqquFSG0C0JaOu6nxhaQRXsraX39KQ3PU99TmOyoWvW8avcSY\nlY9kxG+QELRwfoXijPmWfmVoUI9qG7fDFXS1EB8V/HMO90G9v/20Lgd2oySZ\n7HMeGc/r40Q2SYgrkwYDrgNqXwjDxFDohRScdbWnHrP9eyFjX4gB3Q/a1VYd\nE7nW1aPV2Bfmc/o8WytbYLQpTq4Tz4LwwPt4lE4AJGvz+6eXRRWlHco9MUZB\nMCa2fAJvAjN+T/57e0cP9GM5UHfh3mVuiP+G5meY05/G6F3u0RoZSAClz9m6\nXwUgrJaOCvf3bWbrnqvSI7DzAp4xVSfDO+1hsI7GfbfFToLZZMIlijNKNjCu\n7Q9yxn0wNuMXYDJiy6nfyJ0e52Z2xvcDHhn1gLqCvzWC3fyp2EWIs2yiOqK3\nZXGL\r\n=K4pF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICAGjWK/b16XTrMu+pUZLUNmr8+iyz3sUOxob94OnJshAiAHTztHYFIAuc5OSR9WoK65B/X2kNr8ez4FiYE237y01w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.one-test.20190208231626_1549667983313_0.1714616403721767"},"_hasShrinkwrap":false},"1.3.0-what-is-running.20190209103805":{"name":"@atomist/automation-client","version":"1.3.0-what-is-running.20190209103805","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","why-is-node-running":"^2.0.3","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16ee68fc8069c70555e888463da9f6747c670ea1","_id":"@atomist/automation-client@1.3.0-what-is-running.20190209103805","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JNYufpDZuyBjbFXaU3WMZpcOxEWwiQm72E01c3w2cG0PCeb9+LBWMVXYqmhJ+urO0UzaFAeMGFq5p3wLdQUGFg==","shasum":"435489eed32b3812146b3ea5c3a2048262654614","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-what-is-running.20190209103805.tgz","fileCount":608,"unpackedSize":4977461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXq5ACRA9TVsSAnZWagAAq4wP/0vX0Io0lUXyzCg5Ggxo\nA0fgJ7QKSKNxf6L9oGM4cuVLGqyJRsTq5i/PSXpMRwNPAZ7cJVpDFBKJnGq2\nSj+W7531hICcRHbfuLroqHFFilH8mivtIb0CHCr6lIR9S4fIpORlhI/ZzjcZ\nFD8annSyMljLGFEMyLSKQzD0aLdU5URC55XkcWqaIevJKAifP1ALw3zcxoTB\nmvXTIPSIXMpcobylQw8+h0q7Sj/haXkbKyT8eiY2Gr8gwMRyeCup5HksrvaC\nP5Fyo9Ful7XEDBkQojh3sSClDJbFjZ5gxa2euEqZz5pOiVw5KB+N/RwMAQVt\nWtz93Bt5dacL5SFjvrPpjuq12LNXEfcMXXOT7Lif4M439aEp6DmyGEmRC8oc\nqujF8qBAbpw219nTekxQ8y3zgSqrg7sMmSXQvOkpBBkagnXbnY1o4IJ3ZBxL\nQrCjX3PjaYfj3TSngkZYKuslXsMApvTFH9lR1hsuwsQBseICmRb1VSXJZUzu\nfghhEF7enfZlNLJSubp0D77BrRjZSs+65DSVMeHsApBMRpA/npq7I8IzJyVK\nruNJg5BuHdPGebL6s7sRgxPc8ruBC4QG0vrREmuESokVwGLrgUAa8TNkpbCw\n3h6JLayowD4yurSbu5f0bQP2MuFLlMpRRcutHE24AglrqNaNJr614bwb6jcY\nMz9I\r\n=dB1s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNqjPScIVfd73S3BVaqmJ3y1koVkAWGPexsj5m1kHQdgIgL+uBIRw/dzwJKBm7WkFFgrK5bQnpEggNt5OCXxbCxbo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-what-is-running.20190209103805_1549708864072_0.3707335200354467"},"_hasShrinkwrap":false},"1.3.0-merge-axios-gitlab.20190209142833":{"name":"@atomist/automation-client","version":"1.3.0-merge-axios-gitlab.20190209142833","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"53d604d58549ee196f0657f8cceec39addbffcf1","_id":"@atomist/automation-client@1.3.0-merge-axios-gitlab.20190209142833","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-GXmUDWZ1aFC03LvUJHUrjmB8rQt9vsZ+7cWBGFAw0IeLOx1f8hsD3/C1LxdP83oIwkChPY3Uh1iXtmPdZ1cMJA==","shasum":"f635fd275b8fe49b1fb293946f61c220375cd373","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-merge-axios-gitlab.20190209142833.tgz","fileCount":608,"unpackedSize":4979492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXuRNCRA9TVsSAnZWagAAwL4P/Akq5YG9WQ9ExIokaJfQ\ndgEj2Fsr8zUGXFYT+9tkzvCyQbISlz01RFfOFREVxr1TgQ0WkjfDMWKIYuJs\n4qk0doEJmNOY6NlzzC8qNKfERQdApd09hbf9kgHMjN3+BIqt5vNXypxZlknX\nTqqJUmtDp+5KSl7L54TkmVThvpi1DgpkWqHfFFURwv4SYMW6h2Xmj1eZkQe+\ntvZ7IaHU8X00nZclFtewdkgrBcCcn58/3cEvrWwXY1Em8XKj8AyOop9MriSR\nKKFYyExWDMByJLoT/Dl7dAFk9VV3o+b5nUWSS8HV96OgW03geBCkI7shM3M7\nRTNzlsn4nK6LqfCOme3r6vJ6TpGGJDpgW/F8dPLA//+O9NmU42U2d6GxVC4E\n0UuG/jfNp44XLYfZiqMSPnBGtzCYiVuNnlUPfnJmyMfBOeK2S9BdYfDH3Mxo\n11eJNh1GzM0XXlaPw70KNzu7HEXbExrvAXXn7CP9YSmIaQ8rSC/+7IsLEio9\nPULgty2csie394bAuRyX+riu1HwNTnbjLkXedI+0IRAQ/dkc4A6DlV6YzXEY\n8cQdm/ja5GUAvns2RXF3Ik3TVBFPgtRnaTsmBC43uAs3IpL/HeeC7GAxcUOx\nCaXMDS8t1RPSULqcWmMX+DIBPO45i52J3P6sQf1pctR9gYV2gXajN1BVhgjS\n1zDA\r\n=i5iX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7Ke+C5h2UxjpN4LmzWnKRFj7EQH8nVzf9tRBE7/z9pAiEA3b1k6RAZ65+JBxkHYDiBrqblzge0HVYbyK5KYof7rTw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-merge-axios-gitlab.20190209142833_1549722700629_0.2085132527396989"},"_hasShrinkwrap":false},"1.3.0-master.20190209143849":{"name":"@atomist/automation-client","version":"1.3.0-master.20190209143849","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2e64ec4e0172782c27266813c9de80a840cc2723","_id":"@atomist/automation-client@1.3.0-master.20190209143849","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lmB8VIlxp9MYxSaN2lblpw1gmS9RYbww/ontlmgUSHWR7DJU4jG7OwVHJfSSGegtOlqfCXgzPboY3le7e3aEOQ==","shasum":"4ecc9ab41eee2be1c2206ee88468b99570fc263c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190209143849.tgz","fileCount":608,"unpackedSize":4977163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXuamCRA9TVsSAnZWagAAngQP/ixWjtg7E/R9RwNCLADY\nJ7edFXgsCzqBONA6AEgSPNTRFsWkcCcO88xOe+qHDnIxKSgv82PJuzMu8LF/\nqy4qtnCnaZSqFrFQPTMqvpBAALu7NViiBhFX53ykSQsbdOYfhT9uJnClk6Me\nF+nGWitwdA9pq6AqFmUjJGjFSG4moakDnV+PELT2q7yeaYyUmsgVjRgzktAy\nwkPooxmPybEioh3RdhK1k27DXkw/3obtWVT791SSRkJXH9VY6OgFss/ozCaS\nK/7o+N7ENfiMIVjLdRcMMTDZ2r/GOp+ccj165AV3yzk34zqKFxjjdciGTgwv\nTMZRy3vQiF1VE5NGQuen3CK0ic1LP5x2eGxJ9xz0crQV9OVeb+DXLbjhb6eD\ns2J6TgsB+4yw1AZo/mOMuxcbC+wQyq70veDbAY98of2g8nAs0umT1GkbxAtb\nZBQFgXzQxka/T1ZeweertbofhnTTMG6LgHp5RrMnbP6wAWlg9muPlI/GMzhH\n9noO1zl2s8LjV9cTxd4q8Ciy8lAtyCVyYOwMzAWAV6kck25s+BA8y1Lfyp9/\nD4PIOTBZ0vLwo73nq98sPHDXw8yB02gRaLo8ykE6Qb2SyY3vcgeoHAyCOUP5\nWzhuDzVW8dzOgOVJZpYnvBth2sbwPhImSYBVvkcE6B993Uq4FAc02jDNMjAR\nnk70\r\n=nZvy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB90r/h0cL4F2nsDVnbCT6cXHdfRvvcuSsbC/R3qjxmQAiBUIfEl4NXaOdZN0dY8I039beYyyeuFbjcuT8XoenO2QA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190209143849_1549723301540_0.9119533037337879"},"_hasShrinkwrap":false},"1.3.0-merge-axios-gitlab.20190209160853":{"name":"@atomist/automation-client","version":"1.3.0-merge-axios-gitlab.20190209160853","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.21","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.3","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"^14.1.1","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.10.1","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.1","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"621746c19f6cf59c808c26943bc7afde589af0ee","_id":"@atomist/automation-client@1.3.0-merge-axios-gitlab.20190209160853","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-M2AKyQBy7R57srqfSZ0xYOAlTv3Ffcp6AvDcR8psVVhUZ0ovdcM1Vuq812UhiqBgUlXXd9LGxfA7UFEsTeYcpA==","shasum":"2a0c7149e2747deeac389c1b30828a6ab1d75620","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-merge-axios-gitlab.20190209160853.tgz","fileCount":608,"unpackedSize":4979432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXvvGCRA9TVsSAnZWagAArpoP/3dRUgzTnqmXDPOh7B0a\nYjDE34oNdrD8D2jLdr5WGDzRHzUPS4P9PTwEJkFydolpZBYqDCdUiDq1sPBn\nTTi1sM7SXo0JedPLbgoaQ8qc3PIRzSvweZ1TH/apNvh+arkP+xNTQgAxLLwF\nxLClsIBSivC6vSrXuGaXVpzCgv7nY2hk2HhhJ6np/HUu/zx4Zwy/k6j2Fay7\nSIjcsetvOFkj4cualgtf7F7fAEZPQegoexd8RGkN70bdNv3JHOMUMuROyqxD\nVteAbs2UD+M26XjMVAdeqpbhiP4F7nm5YWktwU+75fK6VCIZxW1OOcuEB+Tv\n4eBGcMfYtZAEWNQvDMFOnO9zAGX0w20OuxAIXIkpsB329lUkmuSSSj69NLaS\nh0iA1rgrbXiQLFZ4UlWKr0mNI+ZCt/+5KduHucCTe9zNii65SpZI2kBtmZUQ\nIubJWFIJQsfuuFMyBmIAJAKzs8YJgOyPt108NmpeiBnqoaAV2G/GpdfMGs8n\noAJTu1334JTT8uJUpzgXZVgGR+SwpsWMDMFZ6lmqrUm36MOL7L6ZBuNTMOlU\nmoMi/Vzgkf9PZG0/2Nky2yx19c11v7hDObFxboL2sL6odsqZW8UNcSVlVpT6\nlyOuG5OI+OcoeKo1eA1qYxpAK25UeTOBq53Kpt3FPbQ5Tt79Xch3ysJnpkNK\nfzHv\r\n=m2IJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADBAY8Ol5YWlR2pttlLNxPU/TL4S3HKGxpq+7I/IJu4AiBci165gdzPrrc/RZWG3B1xcS2O0Bc1Fz2y4U6qHDnYnw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-merge-axios-gitlab.20190209160853_1549728709643_0.5230399033566264"},"_hasShrinkwrap":false},"1.3.0-master.20190211141235":{"name":"@atomist/automation-client","version":"1.3.0-master.20190211141235","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3e226fd14a39ae78fe9e476ba96a85e91011cc27","_id":"@atomist/automation-client@1.3.0-master.20190211141235","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VKLrwhqXx/dajwD+NSIWfXpZgEUNT6JfRfKxBu8j5r4/YlGJRO94ELl5MfqUuGvO75nAB1+OXsw+nLOoMA/oHQ==","shasum":"5a0f7aa8c40536df4e051d0e8ad9ef51ad2067ae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190211141235.tgz","fileCount":608,"unpackedSize":4979589,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYYOhCRA9TVsSAnZWagAAzZcP/iowPw5Z8mqUZ3wImHW0\n+FZIPt3GOj+MCiewZfo3K5k6os/76uycy581z9kVlvJjehdXg+sFQ32dGUBb\nk25lVzLGM1HSuPVHuUT0RxnV/i1I/1VXKCzpXxSY7Qoxf5XFzDNtFb1O+Y2v\nQSCSIhFZrK4/dh6HEIykJ0i6kCg4wRPbMLBcHEsTmc9cZAtb4eLkpkCcdgo3\nPV0A3AFgZIkV6gkN9T2obk5UsEFPDfFptQAfXt1ZE7TQ0Ko/bIOiQeYeRv5P\nmNNNGQMLuJHYUQrnZwsoHYCDALr6yQh1UUiFAqc2/1QPeLlfsgPgFj+lf0yG\nQmfK1OsVewPRAKbhBGGQMjR5TwqVW176nie8sLAHYIKOqrf2P1ctEG3G7YBN\nfVn52/mkXFrBMPAhCMxK6x1lJ4aeQgjMh47tgb68JVQLvqa930xpgGW2EEeJ\nKAXrNWf40HlusnRNfz6T7ToTMLISVAn+vFHW07JVuu0uMmzEDrQzIpX713ZV\nan1ICXwlLpnwWo0eGOStE5iLtWBpmuBReSTX0jJNif+2SZUL76KT5mugFnqT\n6wSw3vG9R0OnltbtOjHL/H5tKJnX6sWAFVfz3aVxJDsW+vcLMhuxPYoBvjqC\nsiCrvG5XGRcMYICIS0E6YTWghUVc3rsTeveLy0Kv6l5zFtIk1i72QB3xdrm0\n8/rO\r\n=J5VC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICJ5tMG++PyMKHAxDvW+Bbmz0PRx9+fgABzrreEkPW6uAiEA4d407tOc8lUhATd7Rdfc+XckXBA9pKtt32mz5GxYBqs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190211141235_1549894560517_0.7413550152300175"},"_hasShrinkwrap":false},"1.3.0-nortissej.apidoc.20190211185937":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.apidoc.20190211185937","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7284afaea5b2b20fdd07006bd2e0bacf6226a9dc","_id":"@atomist/automation-client@1.3.0-nortissej.apidoc.20190211185937","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mz40qj0U2HZ2PMG2yXM4h+0VzAxtFBm62WyDVJYPpaI+PfrcJB1ZQl1vF+RUnNSO4S62dIyK1HeV+kHOYNDYjg==","shasum":"0a4c4ada3d92419eacb8c5508d7fa33ee981b5ae","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.apidoc.20190211185937.tgz","fileCount":608,"unpackedSize":4980308,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYcbyCRA9TVsSAnZWagAA+SwQAJydiOKZBSIldevIKygz\nptSOyO7mJD+aKsMzvAU7jOUNCjjpAYZGvK8D7uwiss7BKaIpC/Dm/IXoxsau\nnn/TarlynXbhcXC5M79hgwBcDQM435NQjh8KZNrlJZWz6yIUtXH5X7mO8Q+l\n2P7JvfIqDpEKKO4ernJxSrbMYB3WiUa5p0ObjjdQ/GrSVSxLRtM/WpDIJkPm\nsVapB7cj9JhDFdDgVxMAlSvr+j8HVX7c5PGuPPDKahWwcFUk/H8f75SQR0u2\npZdhOPpVJ3XTFhTs1Xqc/NanMOTBaJcDgLuBr2EtBgu18dgvu+UQq20Din8J\nclo3mAYANr80vFdhS7vi8Hl+SI4QPsD2jrfjSZF+0Gho0bWlSMQ4TJDJwpfB\n4MptTKyzZei1IuRSzLO205N6PvkigE5HqdPJC0ANzmGROScrv20Jw1h/xCRw\nqyNjMgrBXoFG8ST2zfttbtMHdWjg2QLWXzwKTwQASOzMLX/TQlvmto59z65L\n0x155RadZGqGfKptWSabi/lgqPpby8Z9sHHYoEzltUcoRrNqR2FnAfhx1Q9q\nzYGkP0Y4oZhBZXpSW+6LSd4JymhRsqVjnSQ7k8QK8y3qi6lvptm1XaSAVEx/\n/rs7p4U2HECi3DrPvTLyGnIfd/6nA9Sux7SdHYp3mwtl3yJccXyhfH5txd7O\nMS81\r\n=WxVc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMXNALRZqupSYrsSh3OW/0WFKTz1ah22//fgRfZGSPwAiB6h7dcuOEn8uKzgrE3Ydj/gmtgVDhfqPQeXffL6HVkaw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.apidoc.20190211185937_1549911793741_0.466415319664772"},"_hasShrinkwrap":false},"1.3.0-nortissej.MatchReport2.20190212043628":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.MatchReport2.20190212043628","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.1.0-MatchReport2.20190211042928","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4332816df852666efc9abea127574579ceb825c1","_id":"@atomist/automation-client@1.3.0-nortissej.MatchReport2.20190212043628","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-E/8GprMInd8soKgf4TMFO/toOmi0evRivs5pkkBuF8xj0AKqpgK3kigYs7ZzXb1GAq6qimLCwiNaIVe0mVxgug==","shasum":"ad3b99a2df247f526ebc366c9f402c68a17a875e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.MatchReport2.20190212043628.tgz","fileCount":608,"unpackedSize":4979633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYk3nCRA9TVsSAnZWagAASJAQAIJ614GmakviOsK34mAQ\nbj/RJa1ONdJGlv+k8u4pm7QDsZPa6MU08GLov4SHIek2w4om+7dTbfNh7Pj3\nlQ+yX/xByfgOjLK8HF5Xdb2ziuoAyYZDJwpensqV8v+pWJSoGTZ1QQ5elIJV\ncs8jPuqLnWCwF6+WPAOSXeyx4iQNn1gE1Z7pnAwYlkIDjt8p2ZgTZKXlJLh1\n5wtA6MdiErh8WXmkYe8PxKm2NUsmM5ENmhF64S8AHVxE2txQvbvc9HP+CrcZ\n4jgZsiXTiC8BVsjWJIvBjWTmr+i2d1vaMOKIT1zP10BtMS7Q9HMTCN6guRF1\nMiEJm/mMjMbueabTPSGVWFz111FD1KTDBtG2qo+EXetlQ2kxN/8Eb6F2/TPJ\nNzXxZShi7EMDkIS8RDEuWX6GJo39Kr67A+Thrp+cGvv0wWOF7tfFVxVlXiyJ\nbUhXGBPcqyZv71MNtfsEg/JZoPuIqesfPT2lLCUwxbHXd2tm0cot1YU0UWbW\nVWlKR/ONZqqlcIirW+b5Wl70dU2zKWtlmvSZ2IQX6b3+sKT9M8Ho79E+NpIH\nTxNZixgqLs6XjrAg4qwaZYnsoMyqNmk9fOmSd7U814soYGT+4IgFlvA3t3Pj\nAisl9TOCGo3w+8D1Z58zSUAbtcGR7Gvz0SIbA8ETThOth6py0YcFoqoFN1mf\n6+1N\r\n=CnyY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBw7HPReT9uy4Hkn3p0jt5f5iHw/81CyDYrOp5f9rq6jAiEA1VfndHDEVBUK3t60+BcbHVz89NOrw4RE1D6ELFgSdwE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.MatchReport2.20190212043628_1549946342207_0.9725383182439278"},"_hasShrinkwrap":false},"1.3.0-master.20190214172210":{"name":"@atomist/automation-client","version":"1.3.0-master.20190214172210","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1f38cd80ee899a69432c765af864d959d10d79b5","_id":"@atomist/automation-client@1.3.0-master.20190214172210","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xepObpN7HiNPSHglCpyHNjSiGRaqqq4NdFzD6mHGj1YqxV9Zy47GMtS7pDktCWtcVQN/xlYuQCedjLc1PBvJ7w==","shasum":"5ff0f9977fd48d6e554cbd2725d654041a8ee192","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190214172210.tgz","fileCount":608,"unpackedSize":4979373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZaSQCRA9TVsSAnZWagAA5eQQAKGHS/1mgQqPBTPVHt89\n3PrQXdvHKUB/v3sO/E3Drjq4PbNYw4aMwhy08lug3IJ1kT6Urxg+JLPpIppV\n7yXz3LQGlanUPDviUxST8GCf8S5UYuRJlnp7UfOtcKQHoPbuXlsRfHAZzKhA\ncp+hMO4BH6QSQMso8F1YFBf9FBSnS0Oqb56IewKQSHmmZ3z7xYb6v8GxVJuz\nXJTd+3DI8GgqT8GFioZflceu0IrrfOtZJ7382uQkGjEYp2CglS19OmBTDbCQ\nNOSdZ9yENLEA4XbKY+/RDaUI68vSSm6t8O2HxCT8rokl3Fu9GFZsWPklMsm/\nqHJ92kmwvpXf2VK/2zscrYg6lkz+pdktbw9b7p/LPnteyFdkZh1zIe/CCoVD\nn/CfPp5uKaitBQyEVUi3q2Zxt7LdxICZEzo4M/JhGI6ysthokIFU8ZDZPkha\nhAbJx19/zSwOQpwyMoCLPMmPpOrQKJLQgjkucW5KiEnFtPwyTj7SmEZ7M7NQ\njQRZmJYG8Q6Xrutu3tqKVVxQkjPcHLbWoeAlri6UdZPCh4DZzsXB+v3E9zjc\nNFxnahhkLW75tvS4CCLpKG9tQByrj1CHQ7KTV3CsAJ4CkXh0wnOaiIfI7cbe\nkm8kud+AnxoJmKcsdkyKl19WVWByBOYscxqsy2xqorbohkcLApajUJmAtQ/N\nIIe4\r\n=8PUm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKsBiS5u3JWwol7jVDlPOyKL/0uuxmozTN0biw/vFcpAiEAsO5M8Nb1oKem5BIhn0Q4Jb6ewkSl0I7vcS6JXVeY7gc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190214172210_1550165135841_0.797993844151426"},"_hasShrinkwrap":false},"1.3.0-update-deps.20190215092634":{"name":"@atomist/automation-client","version":"1.3.0-update-deps.20190215092634","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"0.16.1","graphql-codegen-typescript-common":"0.16.1","graphql-codegen-typescript-server":"0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3f6f46cae9056aa7bfada04813a407c0e103c46d","_id":"@atomist/automation-client@1.3.0-update-deps.20190215092634","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-R1NeCrAe0pnXa2IQGZ+TG3hKmaB7h6KTWIw3fexzyVaE2kVxUjCvVtAcUBmoiRRPGheqdmQoJ1Ch+0GlX4etGw==","shasum":"da0189a1c545d03f6e8e50b9216cbecb09d5d473","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-update-deps.20190215092634.tgz","fileCount":608,"unpackedSize":4978010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZoacCRA9TVsSAnZWagAAb0cP/ij/K12fiPBk2kd6wJL6\nMlr+/khn53VixRSg9OOaMkmAozheDgxIgoSdnwrnP0B2nmbxcTXPyRWWooG7\ngcgRQXJBwyb8l7WTjTjz1+BlNWeoQM69JRznuhOFvYEBYAslJ9WvsgLtqz/D\n9UdYpmo7/PbsYg0P0AKNCbm1ZLWeZo8sFXGcWHQYojDFebFBRjLvNZGZei40\niGKxLzZYL75YV+oks3K7skUJf1TmHoJytuAr3535lB+1RRz1crBuemvHI8L6\n2sSRTz+w9p8pvfHLpp/qfavNmXCALlZBE11Tkg+brfDWWCCupkkuLMxs1X+y\nQe76ZQHcGgs8FhLWucPhJ4XDkF34N34xdBaOsKbwONU/44Eu1ihLIs/C0gUa\n1cmmMuY8/0EERX68Z5iJ6Q/igwkIGYu2ox09gFpHCyNENi6IdsJ2gpghsBH7\nkLH9lNxo5w79CiWZemVtGVV/MvJCbmh6cGC4S0ZhFopSimlcYXnlT1tL3BxR\n4fcDFUOt48V0BT1eexz+731g53CnYIxeqZdrjnTUD38SoYtF5PacQsdhcnH3\n4j9rPOAaR1qglYngzvwmobcvluq3pA9h14vX0u1m5P8j4jJJ6oa9sJgL0e/F\nzYxNFohNXfuVq9qZvRwHT8ZiQMXlPxAoEt91wL+DsE8xlDuj3lSPI/GZ+0iX\nQDys\r\n=oXnS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAL/GGOOqjn7y8M28xgJ/UsQ7/yg/Qw3L0RbZ2HDXTg9AiEA0opUqp4aNtT2YighoMnyQsVQmHbbdWsBrDrlhONuhL8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-update-deps.20190215092634_1550223003900_0.6683627889731734"},"_hasShrinkwrap":false},"1.3.0-update-deps.20190215100321":{"name":"@atomist/automation-client","version":"1.3.0-update-deps.20190215100321","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"18659892dc1499a220a0cc67f6f7d657e28e4cbc","_id":"@atomist/automation-client@1.3.0-update-deps.20190215100321","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Brqv+qbwGQPI1k0riD4Jppbv49iPx2+sX2qHK2RMvNLiS1ArH2I0t6KOV1ZWaJ1USjvlagepRa2C4F+VFiuZ5Q==","shasum":"bb4e4d4f98098266a18035bff92161f473071b17","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-update-deps.20190215100321.tgz","fileCount":608,"unpackedSize":4978335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZo8tCRA9TVsSAnZWagAAwx4P/0Ok1kZKyLVSOZkMPgPE\n2UsLtxCx8l9Cypn3jLxsBeWJ9hzdH0mZcGWGM89ZTtVPrfG6whFzujPmjrQ/\neU01pf2ciDmlZKTsCpIr2O664oSKw7kFtR+sHctOhoGU77DgVSJPP2sdoSBg\njf06Zb7xRqBmKp61+86CwuEDI4VSEmgbjybMSDCH3EEGhX4q3OWrNPmdgi6O\nN9SAfbJ6l3phM/osPWIlyhPh26wFDIHSBenHy05QnW+R8RkOC1126RirFIQY\nFbafCnCtt4lSn43psAlK2hDouhMAHkoZfN5A40n39sOqm6WHwH/LyjUSXy0C\nPJ6fK6DYnYUotvYDZtx/VvO74PmrYeyj/3FrjPxVzQUPKrI0TBFCPm+TAuRX\nTSnDZmZ1bWAadNkT+pXIe0UyQzi27jK2Rf9KOrY/FKmxPNQqEAsdJwmSB+Ur\nQ7gJ3CYDZiUblnsq+hnfj5Ptp1e5CN1495N9qvu26Z52jQ2QV4YzwnkXGprQ\ns5eiACxstygRrtUJUGFeRx702jLRu+8iQvOYTdQsLpXaMceqAXYJLgnk6c8Y\ncwS2bR3iVzoYMFfFfdJMsW3wJ6ftruK2OQvU6qVT9pOuk3amGwEhJI2etetB\nEvYTtAUlvdrMNT2wSj8dtukfTkhzFabWQFeUqho+0LX0rBWSLBCz6EGUeqSZ\nSOE/\r\n=xj3H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkX01cjbuXI61ulWO89yj0zIomNsMnyks6/a8QSs0OPAiAgVGf5vCU5xjBU3Rz4C2fnHB3uWqj+jsmtg5iGAt8Vkg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-update-deps.20190215100321_1550225196635_0.497387140634026"},"_hasShrinkwrap":false},"1.3.0-master.20190215142843":{"name":"@atomist/automation-client","version":"1.3.0-master.20190215142843","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"49be6037d9f42e189357981bb39c055a93ad51d3","_id":"@atomist/automation-client@1.3.0-master.20190215142843","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-uVNyycTqonaTPeygjWHbQjtriL1gftC13LXgfS7ivKL8a7HoghQP/fk6m6KUfyVVCUzkgDsi9XSlyucN6laA2g==","shasum":"9b73f356de6a8dbfff278ebbfbb87bf7d7e236d5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190215142843.tgz","fileCount":608,"unpackedSize":4979381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZs1lCRA9TVsSAnZWagAA47QP/3lMOqmGCtGU58umfrtB\nbkcU97m3WzsGMLI87sNY4huPHWogtQc1uYym+a/VijuC4E/oMoE9scUjTk9/\ndS/njLkGgitnJmCqw7AN/xzSbCXPFJXHSM36b1Tp92XbtuOSI71/C7+0aHLp\nSSjiS+XfnVXdwUYE+Qx3PCuOHTgkAsG0qjw/GaPrKJnlujMjG1sY0mge+CkS\nAsrEE1l3RuJ+BOPv8bxCqHGnp2t2h16kmvXq38oxT5qcQD175BpMTkoNleIy\nho+NrCnTTa+oPm2/qXaS2lpd7xKjECicQcBNwtkT1nwOyv+fUVcJG2qoyUhs\ndDEJAtyVii5h8d5Udj7cvXnjow8qN+QzxgzmB/1Ytplah71RdE3I3cLB3cx9\nWdARQubrZs04QLdHmOFO4fp0wyuSmeY6BUeaNMPcy2jfPf3runvJp66xTDwT\nlCIKCU5PC8/BDsrzUVZVPsh0MWaZQnciEGCIUUreutIVBH166IzuZariZ7sy\nU1eKFkbAHkb7ZplcFJ36gVdAMVotD2rZahOXZLaC4EbUt8wxs2WK00gZDWQy\nZnP1K4Tw+cjYDmoghYbkPta49n9Xddi1YATJKXZT5S/Y2DwwEwhFYTsGmHTd\nDAj3d+sAe9CXK7M72w/ChaPmxZ4dYkts5KhISbLXlq2ib+nu99d/iMna4tpb\nBYTm\r\n=walS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5OQbNrTocv8tcqEdRBsD5tuce3ZfShVudvlyfgKuRlAIhAIcmQi2K2cFDy9j6/ooW55Nh090T013527hjkuP11LJ1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190215142843_1550241124853_0.7958581179371971"},"_hasShrinkwrap":false},"1.3.0-master.20190215144219":{"name":"@atomist/automation-client","version":"1.3.0-master.20190215144219","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"69003ce8f4966b8a89c541e3171747f07f557daf","_id":"@atomist/automation-client@1.3.0-master.20190215144219","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-cj7ECJ+w+SCKPbyOWDR9ui0Zjx6+Z/5t/D8oFZnwJNAQUkZi/lx/SZ8SU3vJkkCu5Nb5mqNWyoDd/4p5SgN+0Q==","shasum":"bf5431ec768f139f100ba895ef865778dfdac015","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190215144219.tgz","fileCount":608,"unpackedSize":4980176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZtClCRA9TVsSAnZWagAAsToP/3tGVQmrHF27keT1jRtu\nfFP3S+RRra0c53O+baleySu6saGMttKK+LC3KqbXrcbHBEwaKx7u7jLGyVc0\n8R1EwFVUpBDjnWny6Ysxq05sdGOc2B0L3tnBL8hqLQDUfwVHIQxrbbqdNsaW\n22N7vXVvcn1b9FNL9VQR2Gam+glWr5NiTLjyIJEmje6n/d0jkU6/YIJzEqba\nEpxOnezhhY6l7xaIFyHsdqcfMo2S1uyYKOwMxxIDUlNnueH+QhH7KEDr39st\nMIuBa0pz2RBHcnygnJ7DMjl8FPBWkcwT6LJEAorp8ByGGuRh7hhMs8PCw0dC\nULDgB1CUwHAkbOVDBpjwgvaR+OJAEpFEY0Qc6tcPUs19Fj8MIeBHUCcxQD2u\nUu3IUNLUe+cbyZtSsKY9whbVB+HTL+p4noaNIU37ffCo4DRt6CfvWNowf4I8\nOx5hJls+40IS4/Bi5iEVpLRDOsfZ0RfbRt/QuLElmN/itCQx+BP1Kd7bQL4R\nJaljsQdkf9xLskFLzN/XyDn1ikG0W9BakGD8bEwhgyXkI64EvOZHJ1kddr8b\nQ49pMF88Kj4mO+3C+TbS2B/4Xl86rh0AEfK3bkjItvHysbKuabTVfL+RY3gA\nJktf29zBcgbCkONbEuHurA6T6AY26NF6HvuYXfPQ45qMMEz0wOq9ycgKztO5\nS1fU\r\n=F6Ir\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGuwLZnUtIhmznDGimrZ1kwX7mF43oRGSpGvtgE1d17gIgEvmTZ693frdyTg/Ni0jNOijTiJk8/ROjeJBIvPUdRhk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190215144219_1550241957231_0.784572006088945"},"_hasShrinkwrap":false},"1.3.0-update-deps.20190215163810":{"name":"@atomist/automation-client","version":"1.3.0-update-deps.20190215163810","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5ef08382197c22f0a9834a43553494193e94ee9c","_id":"@atomist/automation-client@1.3.0-update-deps.20190215163810","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-7RTDmJSAS/JQFecJwWfL2HLGkcYRVR9Il1GJlyaDHsddqNUTal6mHMgNY0vZJJ7+vpmjyUMBHLZO4W1HJ13QcQ==","shasum":"eaca4fdcbfc2246643fe825d83148e9691b64451","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-update-deps.20190215163810.tgz","fileCount":608,"unpackedSize":4979244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZux6CRA9TVsSAnZWagAAVeEP/2mphQiduAZfr5ZETg5m\nRsp9rJ/NE/Y0AmSZHJCBho8ZvQw6IoPpTqsl+LEcgirw1MfdZEGDCXFBnUQX\ndZceEAdVyRsCkGSrlvHKIpbcZiD7KSJw+DPIkT/H4+AvJLxif83IMjhv87g3\nz+lH84bN0bYWqF+Zs5s/PMAIBEEu2DWjmwEaRCIg9EjITK8yG+TfcnWtDXQY\nJkJUk+mjY1Ag3Brvwie0MBrKA1rxhAh6cuHBG5t508avDgQ1qOUMXspZbCO0\nIFuaK8UzN655rQy2T4j0uEkPRNIbfDy9Yhn7YA4BIaeCkW2ZkAj33+0fipkZ\nMwLSluAzEvs5CFoR98dOGu9y3W9Iskz1Tb8pktWFXmWDeWMes85UCSNDSvQS\n5ObFbIMlo0S5vJrAz00JyBJ64OX8wnf4MQysduDsBGKx3c72pT5R18BtI8U9\nEs0G1manClRasEcnYI4HGjVvzJI3yxwIBbsj9xxlKsbIhUPLvpzBCH/lA82M\n/+qBTz/8lVR1Dbw1pbV5XJ3nZFe312BQ3FivYAQvSrM/UInaCKVH7qHWtiuW\nQf/5XEedpxyFqaJqcVr0VTQQOBwHGN3mTgx/qZhfoo4eoz23+P13eSQk4kMV\nqA3wPl46YHliOenSY2Ef/aiE/Xa+9ox2GXY+ZTuXdj6oRPtXBYC2ze9grNwN\nVyQW\r\n=GGoC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+Fb2P/YbMtJiUCmir1PhFq9aOmnebMRREyzKuLk8zOgIhAO9u6zP3P54xKgZHqUlawvCksHwC56mD4ttOd3iMLUGC"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-update-deps.20190215163810_1550249081227_0.8150138556842597"},"_hasShrinkwrap":false},"1.3.0-update-deps.20190217191510":{"name":"@atomist/automation-client","version":"1.3.0-update-deps.20190217191510","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c042e7a19d3dabe8a5435af42c4fdca1cc1ff89f","_id":"@atomist/automation-client@1.3.0-update-deps.20190217191510","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rK1s9daU0d2MXuAf4v65Ox3RK2F2khv9CkUbEZf5gqpfTRXapZyTE+R1tDnu8YCDdN4TEa4hc3FqHs6g4o+Lgw==","shasum":"bc25a95baeb50a517c0106464777032134b1aa69","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-update-deps.20190217191510.tgz","fileCount":608,"unpackedSize":4980022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcabOUCRA9TVsSAnZWagAAttgP/2UfsFss6qfjy2N/FXB7\nYkClJNBJXzSx4RCTb5fyEC43M41eN2+iIOtpyWR6WDllOp0bwgRU/qR0rzzk\nZ+XJbJ9S3fuFdaX1MFWBI2ELTXuVAr4HR8Pza/pkl/OJu5tD3tarjyGK5sZx\nd9BiF58QHdVxV5w1gRcOgjuBDu2NBXn5kD1ityF3/bBhmh+nfiTZjdRE8Biv\nB/9zQTW8dTgRwS6OFmuQZRRQH3SV4JYgNw8ylnvV3NSLDNHVeuodct1FsP0n\nFhwS9JXB4+Tn8+JCQ/qrVg97AJLGLllHrD22qBtqzU2GPR2fHQuITbpusrO7\no6PYHAk3Ss1KffAPnZDAPjj6c/UXq/ATJp2d/CQp1PBtOwSnJI6+KTn3m0k+\nm5Ff/1o7dWp2Ltgahh6Kr4O1QQjiGg0iw/VCo90mxYsQA7pj0QJLEHCCwqlD\nLqVioynmNOmQc471jD9YIfVTrnZLkHbwcauTvBHGeSXFHQvHFlOosK5GRR9j\nyb0SWKpQZQaVCbAipKS5zJzOh5oxwyGn5uSQjHC6SQeEFl0POIAEakMoSgsQ\nyO6StcYyrd0QpWfmE0PFICc56eLbNzc1UGpkubyv6JgPcSv47zSFFzkzv9cb\nVRPNprLkSjqa0sWO2J8bcArUO5lga4UNS6DT7z1ENaZ/Pq+We1k7nG7p8K21\nnaJR\r\n=FSio\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbcSVm+Lk7s8XNPVDGtTnbS6K6vPlsYiXE+dbrJWIRQAiEA07mrd89p+w+9jP0H4uvMe5fxQ9xd+82POXRzvXS6jwI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-update-deps.20190217191510_1550431124023_0.22485748604160016"},"_hasShrinkwrap":false},"1.3.0-nortissej.typoOfDoom.20190218215149":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.typoOfDoom.20190218215149","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"21fec4ce6189f53e04729b1c50eb7dd3f61fafb9","_id":"@atomist/automation-client@1.3.0-nortissej.typoOfDoom.20190218215149","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gNeOxwjT4DO/EttMhkTvGCy1fYW8hVDkvmr0nHk4SkBigmj+Taywu5TPG6i7l94LzrnQ7/MFgXoubIKGHaW6fA==","shasum":"384bc2fd9426f12e80cc673b28c1c80b5bfeaf27","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.typoOfDoom.20190218215149.tgz","fileCount":608,"unpackedSize":4979603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaym/CRA9TVsSAnZWagAAlLsP/3AvEcT2Z6bf18I+Mwt0\ne1P4YcqV0d9L7dLtyyX7rW1jM4b2vh8+Gkh8pSfCcgSZtpJff3YHVC1uY6hS\nhBheNuPdK3Nl9Y9OBEea+IgReBXn8cwt/vm2hejOS+3ho5n5Us4/OxVXBjlQ\n7diVRKjd/v5wew/8OsGVFHY/FmCf8vOqdmqhBPQU/fNG2NeXDwe/S2k3zr2q\nX/QeE1ebzYCSnPH7ykPcJvKh/0B/8u4BFW4KjPmFIdmox9qZyGwsQjwulO/H\nJR5WYRSvJ3LqHCfLmQKnM7AveBzitUrImzyue8uAAubIo+LuO6QV3FGFZDP4\nH2MDrJkoiHCqKUBnL8wIOtGQrISG4q1CbWDGfcNiVOc7TWjNLLfUC4C3M2zz\nsj5ihZnOgs4QSGPUNo3TmwbV9bmBCVlh0f4Wdifx6yNJS1o2K28hbcStLzNL\nngwBd+Ayc5HVUHpKbWCXjzNX+AxEJPSP044ywKXQckeTnybleCqVPeCVX1iA\no2ZKClg3q6FoBn9G/3HiLpZWc+dD4zmrS5ka8mNt3RxCmKHf9xjUv3mflB2T\n8hQnUfiU96F7RlrFyTp/7GCgGi20DgAZwOHuDFkD3uHLTXCYANeHAx7T4at/\nZm/I5rXM3cnOYCjkhfNyzQLw0MExsmIp/3ZdRiKjVSuOgEsCNKAJsY/v+juu\nkYao\r\n=R97j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOw8EvlM0NUCNZViwbc+un4H2S7cnMFuzHOWPCwhut7QIgdydT40oS38cXxbTxRlNudRBUN2ryRomO0vi/nlrlYIQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.typoOfDoom.20190218215149_1550526910370_0.4634695660796284"},"_hasShrinkwrap":false},"1.3.0-master.20190219082917":{"name":"@atomist/automation-client","version":"1.3.0-master.20190219082917","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0ff7f35fe6a07009bb4ce861a3557a0035658e55","_id":"@atomist/automation-client@1.3.0-master.20190219082917","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-yUCgQmW23NGh0/naZTx4eJO0vQw4l4X4l1RSGqe3n9hTiJb8mBH+qGynTSYxhtVYprxXfZl8zaIZMZIPC5gD+A==","shasum":"3e6eec131fecf1233aedaa704d481358fb7b8046","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190219082917.tgz","fileCount":608,"unpackedSize":4980270,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJca79dCRA9TVsSAnZWagAAr7IP/jQK6FsSDV/x1o+f0rRh\nP1jfH+82DanhIAoT8g8YGuc8ZksNLIZXjUhqvVMq7rBiOhXjxGLSSYwi9pnN\n7PPlUVS+RGxt1CQlH+J/WdSLYhriILkOWdq2bEq32f7F2PyP4OVfFITQUw+n\nkIMmOiav+Rz9nRQtb/VI0ozD4MG/rlWQK49FT/096KGOUPQV7lw9ZuEHvRso\nhMhRYsaMNBULr3xuSkeGOos5CaTEWdjI553PYO66r+uQid6amgqqEJPMsgvG\nN3QmvtXMX27RBGwl9usE3sGh9J59x/Tn6gqa8bD7EBZVRUucjEY8iBOyxo/e\nPwUHuiIiNEM8R1JCMEjk6Mx3xvDg9g+d96Ky0mTvQCILB0/xsG0aWfzvkezE\nNP09I+UO+vQ49sWgNl5zrobhG0E4jVrfq4hFC8oF7GhuZn3z8NnuA4TRIKH2\nlgQn6++1WoiZzf0j2AyC+cvAynR5RtHH8J1ZU7e5B7dtE2AKty5bF8Rw3ek1\nxByYPc6V0lcdhV7qK7uQgN+kXLcr06fmGDqIKS9D3IEJs/o5jv7G0/Ym263o\nWih1wcjS/4Wcu4xACusSSOeMnOvHeMLUrwqIwiMnLrUPQAVlPC9vfb9Xtb37\nQ374hScieq1ud4MqIek4R6DGGXC3qnqFoqipg9TjhI5Lw/WcC3mJr9fMYNOb\nChyj\r\n=2+Qa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb4/F9T2bIjNSt9AOjxIXCLTo81RB3OMt/bk2ddysgQAiBFYqI/FCCXT1AIz9wvMKo+tU0ZvNbgkX/51ee1HIHkxA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190219082917_1550565212623_0.08877597714375662"},"_hasShrinkwrap":false},"1.3.0-update-deps.20190221091453":{"name":"@atomist/automation-client","version":"1.3.0-update-deps.20190221091453","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e25169b387c107b8eeee15d25417f4a0b48e5804","_id":"@atomist/automation-client@1.3.0-update-deps.20190221091453","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-c80wYyVGj/NqGOIv6MmBkor1e3aGsxn28FyQwyu1p59+ADGsrfGiEnvuYQPPUeASkNfK1GWwBJ53oQVUW7hfMQ==","shasum":"124dea285923b94517f53fa0377efbe440df155a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-update-deps.20190221091453.tgz","fileCount":608,"unpackedSize":4980188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbmzsCRA9TVsSAnZWagAA6ksQAKOJ5h5zLSvZZLq5L8Fd\nMSQZT2rR5bkfqAKej01BaMzc7igM6sZlsWwjKaN/3rqdMlgnxnaOo8brZdGJ\nHilLcShrz5B1BYrtRpjm9Do7WYxnbOS8qYLlRoemjGxKBPdVIupJxB8DODU0\nadnh602G+blTwtM0xhaY0ZORws5xs0vtUxZEFnxUdlVMGagsSdPM5fOUpAGu\nj9m79CsVvm+i27yspfomiUrwZhxJ9Gyi6w4Ps8gD6u2RpANAC3v1TM4sJw9z\n8mz5W7GKTeQ5kwvMuVjkQwGAdWpX4dKSH0vF6WZuMEOuIngCPgNc3q0xigYg\neYPAUjDcquI1dudIJ9IyPQ3FjhsZKqs4hxBbgJv86rbMmOhzjvb23sttZB+h\ny0Q9kiuRrRSOuUd4j+LgHrPleXw1LiKKrP3hiyVlTIS2sYtYkMGNQAvnQ/zx\n4fTt+TAiNjVbLWfqWudtlZabukLFLfP0W0qDxN6cRBXYOpPthFWj0T0J3dBT\nGvEw344NJQraPzYN+zlLHa7Xzeld1ycLR+E27Dn2nuXck0Gn4HoRNO1taNq6\nF5997m4wrNWo8x2cfAG5ueVAtESBFtZebuuSt0a1d5ov9n3cd6ex313ByKe7\nyoSWBJ6nxZ9H3CYvvEsA7/rbwejbEa22FY0pJ+7WzaBKEnmIQp+46EveYXbb\n7mLT\r\n=aV5S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1R0YZggeawghImvmi/sAg6xFXYBBfbCaHp711k41TNAIhAJ3qU2ZUHXiqtwO+lb6bGo6gTpgy9N/buLFWxNXXxSVL"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-update-deps.20190221091453_1550740715296_0.14993368219566983"},"_hasShrinkwrap":false},"1.3.0-nortissej.contentBuffer.20190221214446":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.contentBuffer.20190221214446","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2ee435c02f6486ce6113e00b9a1dd318a2fa9793","_id":"@atomist/automation-client@1.3.0-nortissej.contentBuffer.20190221214446","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-rCorY5wmRUsWymgE6GSzrX2gcd9CP+dmX5CL/cSpdEIhLQUrTCBfh36ktTZsmYjCd+UeibFgXbhrIyHU6ppOKg==","shasum":"b4a85bc34fc3fe24a30485c222dfef20f7960025","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.contentBuffer.20190221214446.tgz","fileCount":608,"unpackedSize":4981287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbxyVCRA9TVsSAnZWagAAbZEQAKMROED6emeqgySvypiW\nbShKs3oqT7V2leRlqu/d9P+GVAEZzZvJdX0Vn5gxi3+A0Cg1ILuEYq+du9rN\n2jzUGIAxO5vKVdeJK18KKP3rIu9GfY/XNFm0IVuuRoBSLoyV52OrWL/fhCHV\nLxrDn7H0qd1cYOXMa71h5qPIxCiQsUZS67NDG55v0Dp7zhuSLLIebTV9SJm6\nSHpKPyhg28m6CXalSYLQgQvwpsudVQQrpY9S32KhHmgnTvjtZuFnoNKVQy/b\n8r0+BETibFU7izkDzFx6l5885t363qQomjrSel2vUd9IzJy6JVwwLr+pDXaP\n7BcbPL7slsIQNWts323fK34nVNebmcV/ejfNMs0+t5kIYJqUFkFtMbCmhSz4\nd0xt2zifbdjKzi/G/tKqrCcMalEBvqkSzXn6lhZr3m3mzqU6XQAWJj45831t\nyOx1NUcMHen8HA5kvRSscrivWK4P6lpSAVvwLYWh5c1H9H6vA+S+AcOamQUZ\nbjJks5bjJL/RYoTp58ltAOHR0uyOORsmRC33MwGC8fJ+9tM16eHI4Pchn8xl\naVs/bCLDf3PEyndQHeiSI5aC1VWvRncsH9ejUHqL6abkJCBYvFrDH86Oxw3B\n+Wjn9V7EUGmPZfMVBExXk9i2FT5Yq7oUfHND6DfueRLgXz6SL4+tsJhVWFd8\nJwZD\r\n=jJvB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQveJvsG0EWad7CN6ISFUFcQHsw3HbzzVAyI/XbRE1TAiEAnhYl7fn1TC76rCZIfNYxu7x7lRPQ/5tDqO2s4q5guCU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.contentBuffer.20190221214446_1550785684946_0.23368559558910373"},"_hasShrinkwrap":false},"1.3.0-nortissej.contentBuffer.20190221214853":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.contentBuffer.20190221214853","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2ee435c02f6486ce6113e00b9a1dd318a2fa9793","_id":"@atomist/automation-client@1.3.0-nortissej.contentBuffer.20190221214853","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-32sh0ujgRlEe6veYVBIqGMIulUSUC4Me/aepKwtcPSukR01k/kVAQyFv8d8FBL3v9b+AsxW6NXP9hpF6umny9w==","shasum":"568259b612a14835d98354438736858f3fddc48c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.contentBuffer.20190221214853.tgz","fileCount":608,"unpackedSize":4981287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbx2qCRA9TVsSAnZWagAAalgP/RzVoZjR5utVsz7Kqado\nRjv6i3DgM0pboGmzVhJEvVEIxqPNn2tgk1kZ2p5CnD3M92ykFzgnXy4cH+oK\nPlMOxPzceqn7ZbtCn8Z/24qUuxYgmhx1O/JrPlSMDFukWs1X5yjV21GBHlLX\nCwq438l63JVhZ1AEEAtiMtVjhgekKlYa8OktXZHdjibuSEDU3dfiqLliq8nR\nAtLLpNms5qL7J/d4ZheEpiYLSFQPvTjduwj28kRsvedPTSPoG77Gt3G5dlqT\nUkFRFWpH/PWWEDdQP9kvcoty07uFtwJNWbgoeFb8JQIwVHUvMT4n70xevXMm\nE89bgJF9COyaBaNXRCXfiLnp2o3XBTiFPyfCppvBryfBfYZIbw/5bRDUGwKz\nP3BF4w7pc89mYx91Ir0GV+R69wkFAm2aa02z7L7MUfOTgtn+RwNRKrT6IOfC\ngFIb5NynKgGYL56RLJeNfBMDzKy54D9m/xeObHE/YnbsScBadLe3bVJZ347E\nW6JZQA8f14AJgt5HULgv62kApqVoyuEj0brJtuRFPYFRMhgyb2zIk7zGfha4\nCc8lJuk4eLerhSDsag5c+yYnEQuL5GDWdM5+piQ7SYkO+VsSxFgvz2vdlD3F\ntzRymFCP0zPyeFlm/h1CzOhllUDH5ALhGJg4P2lXsMc/eDA62blGLHQzOiSZ\nSzFa\r\n=rM2T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2uvVJxXpUh9VwBxFh1i7gJSZn217HeOUr4S9ngInCzAiEA42NKJd6owaZdX0BW0DS0cdYU7w1OJO8Vz3ThGlRR0RA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.contentBuffer.20190221214853_1550785961909_0.847218723695248"},"_hasShrinkwrap":false},"1.3.0-master.20190221221959":{"name":"@atomist/automation-client","version":"1.3.0-master.20190221221959","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3c38f19167e2cb4141b80e048a6fa8bb9b5de00c","_id":"@atomist/automation-client@1.3.0-master.20190221221959","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-m4sc/COToc6dUKDTA4lWSrdniRojJA3TtSDbT9edOinbaCfLTM7++OIoyYqL6rqZJGi9W0eW6lSGDVELaf7TxQ==","shasum":"46e3de87cce0e4ece94b9ab8d4a071c0aa3abe5a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190221221959.tgz","fileCount":608,"unpackedSize":4981375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbyTtCRA9TVsSAnZWagAAQvwP/1EtpL2T81PtJvypuIMc\nNvo/k273lha9F6HJ4WB3OKDwC94al6kZS/QRBthlMUxFWo5SwfZKKWICpm9E\nOcbIycisLQFl9zEZcH2iDCmJQigNZR+DX0YcwZXjKUHILjOImpXAFtc/cR9y\n9RLCU+Xoq0BJ8nEYfUVGvDX/9H9H33SODr6p+OjjpP8kN7WnOHoOcdLlLV7M\n/nykM56nAz7CrJ3nx+yTw+NDBYNq847nAma2r4DgVX6RwK1VdkVAdXbME3ir\n6GIWuNlFu+LpBmxdVrcgcaZRRLM8sasLe4Bqc18ZGfjgckxeaWVKS1xdgW5v\n4p7LahFuGgx/MPl2s+XvH7lGbHJI5C4PI/3+sHr6S4OXOdAxT4JtTQCL+/QJ\nMP5eogvDaF7BMBO/Idv8AR3UG0/0xem5X/fI++jw5748pCsipQNIujvEuDOw\nK1N3UT4LjcPiGb4JSGdRiEObNbpPpv9p+/8AJpqHO4AvFzoTB4RUDVHmPDL1\nM8uDs+Qpog4Tc+ev+y9oOvyF5M32+5blf7Yg/WMWUviZ09VnC9BY4kPd8QQ9\nq9sjuJL/BRuD4ApXea9Lha+7VBhCNQ+/COy1rzs8ghKsyBhg9M3c3aAVBDQz\nzfSUxFboLI0vm+D0jCZuyL4QmuPlF+uf0VqPXG8q1Gl8rJxJsmyvHY3V8EzX\nDjoT\r\n=bXsQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxL7EN/T2SytWginXgNsH5/XsYB1ZzhvGifRDV7Qpl7AiEAzdf3sDIMiYrUX+d66NHByVuCsOwizUDNHwJaD2s4Rog="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190221221959_1550787820567_0.14147789755418239"},"_hasShrinkwrap":false},"1.3.0-merge-axios-gitlab.20190227200023":{"name":"@atomist/automation-client","version":"1.3.0-merge-axios-gitlab.20190227200023","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86df2fc7db95a8dbae1ee5808f9249dbe4b0052f","_id":"@atomist/automation-client@1.3.0-merge-axios-gitlab.20190227200023","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-V2+hYuKS57+cemHUm+tFfTktK/8YYIeeKZ6pCkhYFxVavU+TwOoeeoOb7+L9+ouMCg8DnGiUZdhCpEnIJskRwQ==","shasum":"a4e0c9798840d7e2fb2cc78e389feb5c927911a6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-merge-axios-gitlab.20190227200023.tgz","fileCount":608,"unpackedSize":4983665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdu0sCRA9TVsSAnZWagAAPCoP/Ak0yAyp5txjtgYDMxUv\n4XNVBQbTDK0xGifM6d4Rr1O2HQj8w5AUHnGreyO8/zSsE/uyYOolywEQcQ4L\nLDKmc74kKFpHA/qMk7ByXWlhns1o23iP+W/opAajWdhbBlc9DeCYPTcS+1hR\n4XkSrx5ba407+6GpX1pQ/B/R8snHxycRMOTUdK7NuX3WWIlxyTTywzHqEds2\ncqXp8J6P0K2cDXgd4+bC2GSh5HYsnKnPs6L3qCMS9bvAsl4MXqu5OJFoRnPZ\neRntZg85KchsPl9I54Vxj0UxAK6W2l4Ny5S3476oDHreNTwcH0mWqPshFejD\n52OI/j2RopN5Nl4FPt8znoNoV+JkUMz2hjxoGo8EfpZEot4W9AzIMsHtKrdU\ni+bv+0zpe8PkuXZi3ikUXzc/7kwN77PPzKT350elFDf09r/mHU6eexAWMBuV\n01xbeYFNaE8JEHxTu+1IdsZsaZCme14jLhTVKKZqNIX/7WKz0ZVXesdvPOxa\nUWuLA5N4e5K8iuakd9xVa0y+r4e56t++jOA2qGOQJm3yZ7zhBlX/Tex9Gn5d\nDbsKcQDw7u6fNgYnu6i+tEQJu/yVsvMVmUhsrQsXLvoKIhPmXAG8lVH8UiWY\n42KBiPHe/zYlrZGpvoelwRC3wR6gxergSa8rt9/ohPEtxkbinK9vGHihAk5P\ndCC/\r\n=L6Qi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtFnMFTIS5fm/9dy4upjZGAMkQWwBRTp2YEKoM0XODOAiA0w8cDXj9MM1cPB6CRRI3A5Zfv91yYg6SE/QzhXrH9Qg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-merge-axios-gitlab.20190227200023_1551297835603_0.5313128501780902"},"_hasShrinkwrap":false},"1.3.0-master.20190228121715":{"name":"@atomist/automation-client","version":"1.3.0-master.20190228121715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.0.4","@atomist/slack-messages":"1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.2","@types/body-parser":"^1.16.8","@types/cors":"^2.8.3","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"0.0.42","@types/inquirer":"0.0.43","@types/isomorphic-fetch":"0.0.34","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.120","@types/minimatch":"^3.0.3","@types/node":"^10.12.24","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.30","@types/power-assert":"^1.4.29","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.2","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.3","@types/ws":"^6.0.0","apollo":"^2.4.4","apollo-cache-inmemory":"^1.4.2","apollo-client":"^2.4.12","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.0.1","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.0.0","base-64":"^0.1.0","body-parser":"^1.18.2","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.3.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.13.0","graphql-codegen-typescript-template":"^0.13.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.0","hot-shots":"^6.1.1","https-proxy-agent":"^2.1.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.5","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.4.4","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.1","source-map-support":"^0.5.10","sprintf-js":"^1.1.1","stack-trace":"0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.4","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.2.0","winston":"^3.2.1","winston-transport":"^4.2.0","ws":"^6.1.3"},"devDependencies":{"@types/mocha":"^5.2.5","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.0","gc-stats":"^1.2.1","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c916fe479c208a93a26f4412cb89bd6a92fef1f4","_id":"@atomist/automation-client@1.3.0-master.20190228121715","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-LpGCnHEfwl/opZgXm5JZkkuYgcv8spXbvLvtgNl1pHKlVwbxOG7naYO62JIKAs1P7RuWaErx3c3ewqRyZkrSow==","shasum":"257b06efc55dbaf14f5a66dad4509ef068b732ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190228121715.tgz","fileCount":608,"unpackedSize":4981477,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd9IYCRA9TVsSAnZWagAAA84QAIixovvpedmzRI7G6s/O\nXqbNycm0T2tqKSZhYtclko1cGcRqlphGtuc9jZj6wizvgt4sJrVmuz3S6ahh\nitEtO4IEZxTDQGvOaXgXC3+U5g992+zvr8jhgKIFHsOfSjgONxtfpg/6H6aO\nZRz2Bv3XErpkAxWcTQAeHvS6YSA/4P7Nfic78BQ2jM+FlodbEqU165vitmTy\ngPey61hadPoq/gvjJ99BzSjB0Yi6PvcblbquyEjyBvL2NloDW4Gqoiwhoo80\nQsdrLDgqQ+nIgDSCjGWlFwMzRB52DdEVJVbTqTvY64eWsqOp/T9fff0O8Xgu\nMrzL4y7LviXkhXigbNbkErAD9DYx9yD4gePCv3HQeX7Ct622JxsAYNQC4w00\niI08Vg3oHN9GvHOl41H1VHyBFGlD7X+j2uS0MuD4WqdoO9lDmn7BkjeMEHyX\nzQgxHtumYkwMA5lz5n85je97UoiR366rFr2l6TstI/MkzDLl45X5Sc9f3pa+\nz0OoQVJAlZ9QwEk/a4eITSBTOs2NEzDRrSI2m7sGkrQ9DMCNG2zttDsJKEHt\nbXZbk5f6hoIwtnFlt23eqWjDGiJ5B3uAKK0eBxQNmkGPcoZWtUMVl7iW61li\nxrfYMg5kX9gnJmKsEVg98emYcPNN7ZaCSdGNU1XZsVPZ4H6oIAETcN5PXNhA\nWZ4o\r\n=iyH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICa1XVvvfe42/9Efzt1A2z0sUI74UefdgVOoSulEE2knAiEA8bY7fP+WfAAeUvv6z1WGrESZc9BLLdoc+nTcr2tp7U0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190228121715_1551356439593_0.9665007791312812"},"_hasShrinkwrap":false},"1.3.0-master.20190228133353":{"name":"@atomist/automation-client","version":"1.3.0-master.20190228133353","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7763d9dd58ff14cd28377487b559e7ccdde544b3","_id":"@atomist/automation-client@1.3.0-master.20190228133353","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ij+435mERimP7agKmQRgX2KYF7+/AgD8mZeCIT/MqgZUrM0ZvsHjeeJ9kFhzObna3m7yYXiEgGNQXQMo4neUYA==","shasum":"cd44e9a8fcb5d38536614e3f52591d033ddf5d3b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190228133353.tgz","fileCount":608,"unpackedSize":4998536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd+Q/CRA9TVsSAnZWagAAN5MP/2O2qXygsD8kvMa3DSDl\n80JVCogb1oQfkzFljfPgPMGf+u2CORy0eVl8rihzrZMz2LiWCrV6cbH0jNIN\n0/tpXCrToxDsbkiZ7LeXM36SJ5Vea/yarP23w599OU+RgKm+WgMfaahn5fr4\nsZbA2Z64CO2blLcEw3IjUXqxwZC28Ln2ogP6R7+OmTncF5T0taOrA/tPiRsw\nJiGunquPzp1pWa1/xT5rVZyKlus7Nx2TZyWBOllMb6e3Z9xfZNia2IhyLt+/\ndIhKFXMWXa12QXHK9oU6Ek0W5g+PO59lIHO0maNihsS5fMPBKXYlkVsFyXme\nS0WWXinNaR8+BJApJhR7wXxEeImUswDxEk2FJebcyJn4hr6TkDuvia/iWAhr\nc+ZlClUW800voMz2ysFkipBjF2UxpPK1yW2s3mL/o1H6PKEd9DKDC7VwMup+\nVaWY1ejdnAq/7t/CTBsjBSNDiVg0mv/XpF9aMWMZqKQkGzq7dNEV4qb8m2Bi\nAULGSB9HH5wpsaHfb3m8igkEV66FUafjm/99VgFuVcmZmSB8Y7ep5wTSTjQR\ns0rE7p5m4HbNj6nY8oNB104Ac+dWuXIuDXLC0fvNOJpsRq/Jc5nzXlIEmi0q\nDRed36LcMYh/r6cZ1ObPDep5HbK9nKWqYbHA4Ao0fCeY/9zM3huylIkSdsWT\nmw3K\r\n=bwZV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGYzYZ3CWl2W6qSelgUpwAtHAEOBImhtmLJ3cZ9902DQIhAJ10yflkUjJ02SZD/63wC7nEc6n5A9NR5tyt2t9lruBC"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190228133353_1551361086538_0.5896998824920334"},"_hasShrinkwrap":false},"1.3.0-master.20190228133619":{"name":"@atomist/automation-client","version":"1.3.0-master.20190228133619","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7763d9dd58ff14cd28377487b559e7ccdde544b3","_id":"@atomist/automation-client@1.3.0-master.20190228133619","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-mwcSCv38iWGvxDRhaUmre0nva8VqRU8PTxWqxqUXXs96fVERUGgwt+j2b4DPGp7Wfdv9yzr/miz1Y99KKc2S7w==","shasum":"0cc670f3859330e52dc7e44c77dee71f0cf9a0a6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190228133619.tgz","fileCount":608,"unpackedSize":4998536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd+StCRA9TVsSAnZWagAA8RAQAKEp0/Q5b6WF7Fqqc+4B\nuERm5ACnfv/0z3jOyUXOOotEGD4VNBo+R1SmrVLu/Cbf/lXyrOLXSwQA2x5s\nTkRTncvQg6CwafXBMEzlmaGo9NVNKiI5sfYBv5ahmzUfCIlyhppTJYfzdZ+O\nyoMjzt74TH5v+YhETUfCVPKSCDIKFGrN3iSaYKL/AGcwJoPWOkVkeMR31BfQ\nZO7Khjj9YdMNChNLBCeT05WUEwY2obDRi2lxWsI1DxpCgSyCxgOCDtBKh1ad\nSgG8jzzKVfLLX0DnDI6HimYG3dPD+UZmZq/MCiplcCd1wsfaJodYqm0RvcRi\nEq3/BDZ51NX8/8mP3mKlxS3YWreQbeRjGDHffQLxWulP7rP4vHDpfaC6rL7p\noSy52ZrI6pMuvzfzLo/tBZCD7LgPY5u/Puwy/VBg47NjzNJpq/nG1M079/gr\nfXw73ACcbXaq0YRjfha5JPlqN2EAB7duj1bYLmXrRK19GyMlFlf7vssyC/GY\nJm75vD6IKHP8hV9Z5uElhKJceHDgfaLJ0+lmFG1xDJYxco2C1d/v7iS0nqTQ\nptjCs8gho6lJYc8RNXG5YFmXRMEnCH6p9oU6cG4tKMkgcF+RHtlRPs7iKCgJ\nOG+fDjy4qlck1ixK4wPAxMRuyIU0zOjcaq3ZMIaTHZ8RiE5SrPC66NE51uba\nH4KZ\r\n=pflm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/xqgY0sWX47jqGdIdeJSdCOsi+M+j/ev9fPefa24RUAIhAPGTkQrgiI9+AtG/pmglLSPZGes9tGQEXyLqT2xIEhIV"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190228133619_1551361197177_0.2785709952079285"},"_hasShrinkwrap":false},"1.3.0-nortissej.eep.20190228213108":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.eep.20190228213108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"50a47ded79d0d8b398b2ce134a2cd1c2246a0197","_id":"@atomist/automation-client@1.3.0-nortissej.eep.20190228213108","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-tq4KofYz6MPv96kZmyr3xO8sh6JPaTk9R4vpvoiXVbp+DpGLxN3TVmnY0YC+9gN8mei7Yguq+Tbrjd07Yp6KNQ==","shasum":"71c874aaa261e04baa361c48c85cc5918e91df68","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.eep.20190228213108.tgz","fileCount":608,"unpackedSize":4998700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceFP5CRA9TVsSAnZWagAAcJEP/3TyoXhgnmV5GBVZ3dam\nPfunn6+rkF1R0F0/eVMquflTHW5I1JMXRyoXm45BFy9az3mW0Ah94WwMjfv2\nKQsMT5b3CXeXDG9eKLKKLnkzMaP/IfPQLuZuEUFGfSBD6TRdcFeIlzq5mMv4\nNVlJIjX4K5NWR+EwXMsKTLvvtNRJZWttQAvU3KufEE3PPndh2hGg7XD5TFba\npChmHL44VQiEIcJhwP/r5QVKYd07X4Os4CKwRo7SrIsvk0lJ2dB6qx6qPUZR\n8iiOOfh3i8aZLeVLIUiWzMaSsy9BLYh/splcbLMBCgoVyMH5euNUaZ+OKHrt\nKYCkB7w2jkDF1G+VTdLYWeTh9eYTB0vQ2GC8fQHNmtEauRtyptPMZxrrpa/h\n38WDiMNFjyClqqv4VWGvZorEBQYLanhj8OX/j3ymIT3PHcRrkxPLBZzpyu16\n1g3iP95/JOuRETLgK5DNglFxd/7EvUn+NeowpzopMYupnrgsW93bGNABpX6U\nU7mEW4gsJLGIVxMUW0n1sRSTCo4L1PKJpShL3jN73qk1o3CKWxqIAj6rUgN+\nQF9ShSKlfOTXGxAMrJDDibfKE6VH0pPG7JkS9gHfODt2wRCQmFP+YyF/KKbQ\nxClo52nLC/KV8VVUmT4Re52fkjapJxSA8JVMAXGhieDSXBviPZT6fRabetuV\ng3Bm\r\n=Uq9F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyaD/PayMDmg/kZNfCI2JC7kdOmu4EkesbQurmrmXUeAiEA1REQNZWd9XE/W55fghTVCpzCv5c9TYgKH377rklTCU0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.eep.20190228213108_1551389688899_0.8501552636866039"},"_hasShrinkwrap":false},"1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8d741958cd9d4ed54d58ed88bf2fc98ed76cad8b","_id":"@atomist/automation-client@1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-vK8eaiWoLa3DXPPUIqH0jugEg17egwlRRXkKA8DReYnTGaHVzDpZ4i0sfLHn6RiuC7b8IuqfLpqcbtdC77IYvQ==","shasum":"89fc6854c1384b2de861f7b4a3ea52c27c10fd1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518.tgz","fileCount":608,"unpackedSize":5001492,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfZ+lCRA9TVsSAnZWagAAy4kP/RocwilOrmnIMlFE6kTN\nooEfMSOdqgYTf/hbc+j+gAXHA+ipmNC8IVRZ3fvlcrriZ5eyKdpNulhRZSyh\nWn/1r+OcNMgzoBSBvKIOixCc1fBCZ4xCJfjolC4h44FkfsWyO9kWOEdN0iT5\naKvtubhGkZfGAiDvW22z5SOBuZkBfeFeo4C35jVe6dNdblWn4ziR47kJa/jG\nB8arPq/DqQsXOEEb1DHxoV41KDm9MrYXbBKBhFf9eH3qEJbgB+kTNM2qh+lX\nUvLB6OGtJ3TWfXBtrb7NXYhVmKluCwXbSeyEvuJQ6QMKJqsYPWCfIpbcYYcD\nNtIEXz6Zysz56sY/NN3NpQLZNB/mxtqVMNcVlVMRzXfBXy3yCPjGzd3HdP6q\nAERmDGUjNedcUAG6zWq3rTPZtnFbFQKyapCNq/JD0e29DG7h/0f1NCSyAPY6\nI9I5p8Np10zbEDFDMjF76aOdB60NvBuD3CZhdRXDIfnTRDTDGqF0QCuXZf8V\n7TnWS/21UIVW/Z7zPpolAC5poEv0qU5E4TV380UqtzFRRU0zf9Dwx/rotzoD\nYg+nxhijjk4JRlO170ZF6eOLzYLy+hTO3QT8bSM5ZWigNfGCFD20BaY/mmRd\nQF8O7dvI4ZpfSKkcPG630xY5Ha01DIQ94hamL3FTEmf3eTdwM3yF4HQzcctH\nblCk\r\n=6QYQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCio45mRzjDczrXvY6qc/I30VLJBRNtcHXd7t7Hcy7iWAIgOH4hTaNvntnDMz4SDLu2V7iAWHbweGkAOia5OS4n//w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518_1551736741436_0.2817655460662567"},"_hasShrinkwrap":false},"1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fae43e17dd43ab407e77463b37f7e392191367a3","_id":"@atomist/automation-client@1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-O7AgUYbjvaNotTFT+Xb/iu2Syn4GkmfexK8Czv9M9iLlf4I5dqVRnpxDKvgAs077gF5d0Az/LtCpDFYamxk7Bg==","shasum":"0428c06d273915faaaf210204604a65567810181","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037.tgz","fileCount":608,"unpackedSize":5002391,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfafjCRA9TVsSAnZWagAAFhIP/0TgOBvmQgz1tXY08LNM\n4HUZgxuM7tQfU1mtu7Pj1olVgPbVlV2xfuELcCiR/7n8eJ36qasC5NBdj3/G\nfV+SRWJVQwYNObBHJiriI5fjxiIjoxIAuMa+Q6Fk4beHOHI0PwJH53gKTw5n\nAJLRfUKKMAFee/R6AMMM5JxqMVTVtY2gCM/plJG5Km3tt37OhLituaF8LE3A\nIGtXx8+IQ0tmYcCTooAI0OplQOnlcEVWTAP6N+FEubTNacnixGX+IIlJAQVv\nFUF0Bs1/yoxFlNOXIFES9r7L1qGjouX99TGwy81G1V3Kvf/jT40dGbqo+0PY\nuXJD23m2kWEJxO9+e0OPragFx7PC//s9HZhaqwQjHOgfdKy6JCw+/a4FbAVT\nBZ0YOM/v2sPqQHbir/9ksg4lW8FcqRBSAk+eUmD1qtOsn/iVdmWhoo5cya7D\nlHPv72up3ccTvI3uYO33nlVbu3HJJSXGDKAbDn0Qn3tW8aSI/vTBPPTQ2/Ey\nINcDjscfIbcLnbyHZ27kU1R3EjyarIZRQhLgjtKHAKEuDq/RSUfFH/vkk8GX\nsCNl9goMaDWDZeHiosUsguhqNK69iYVmdR+jOjOkYbAiyZJjkW0iK07yZf6E\n2JTobf7Nec/nWepEwbtIDFU2dk/8LZRc5i4j8PP3PDivTQE/iskfY4sbhOvz\nIrph\r\n=jPt6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAda8crygPt+Pe+H3MICr8lbgHg1KuFIkXpF6wpCZmx9AiAE6ZH1eqhCHtHcWOJpsFImXEPt0JHq29wE4FA21y/awg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037_1551738850963_0.43621379578477515"},"_hasShrinkwrap":false},"1.3.0-master.20190306181548":{"name":"@atomist/automation-client","version":"1.3.0-master.20190306181548","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3b01a8bc862d35742586dc67366c0fd7fbf03096","_id":"@atomist/automation-client@1.3.0-master.20190306181548","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-k1IkfcWaSmPZzKf5Ph2SBaAYMwOkCGpVY9oT3feI/9YvXarGW7uq+LXevLW86QpeG27Lv4IMsdB/Fs4VU1JlNQ==","shasum":"4b97b85f5a486c193ced12b22c33effc27d31c74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190306181548.tgz","fileCount":608,"unpackedSize":4998654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgBEACRA9TVsSAnZWagAAwHgQAISUokLNjglwjtkZpZJE\nZKiiOtbpEzTjEJtMMboAM5yzvukzgOr/0tSAKu34aNMh9Q0Fg8qB0Md9TeP3\nTqEQAMxB6kT1xXdqNxSPL662owVYkPIaiizLJXWHcTDDQZ9HBYRYJB2qSWMu\nqR8qEyJkIuBbI6pvocl6BoceSsVPsLBOhxhcQrZPBx8UvjD3xYdvmsTPRyLW\neP0tQbd16DbNk+Ju8ImRx85rvVOPR7pHmtBBu5Do0trVZ29P8Ll/SewrA4th\n4KaLDi2h5UCjJpeM9ROhqTVLWjFH+1ltbuYDV6W5p7FUfKj5Lqg/a1lZexg8\nn7Ov3ZvgGIChow19YtOWmgQq43JlMb1nyd2yt9CjupnkqW370IlFPnwc3wwq\nCaW2mOoFfrltYJH9/tp0s+t6+wR03iIlP5raQQBL37462QuTN/LVlOypkBdF\nuKgsoMEfy+TjwCxTQIk7urP3FYl9wnwFjge/4XZvmvlIp5be582yIGo0YY9q\nMyPYshafK6+A49dfDrixOoWJW1jY+s4HLN480NKRnNScT1NZkDCXwNPAAhCZ\na5q3oBB/DAU5+qu7rOjJxTsgiIKV7F53fDbwE10y6T2qAZIxh2ap2M8T2RLJ\nPDq/9bjnUMAhvrJ7DcsbEhuQiosRPy6FDmwea2WnrziUiw4oZloLxqNsytb2\nyyMB\r\n=91mg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+TiGuG4kpTA52UNibtBLcRYYvcM+30KI+/zHKznu4awIgWSbZPcVryhZHb0CUDCht+hU4NqNFBciPm5w2CDi1WOc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190306181548_1551896832021_0.8109264294509042"},"_hasShrinkwrap":false},"1.3.0-websocket-lifecycle.20190306200217":{"name":"@atomist/automation-client","version":"1.3.0-websocket-lifecycle.20190306200217","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"96b68f54abab4705ec743fe4ae723ebfc3fbe695","_id":"@atomist/automation-client@1.3.0-websocket-lifecycle.20190306200217","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-i0NjmYlKMHSamaeGzKvR82IaMKMlyT8Dj7FfoqTIFeD80pezjiRF4vGfjViWeKqCBJzM3/Y5c3CqO2r+vQiLnQ==","shasum":"d2dba08c89f3f141137ce5d54662ed1fc5f9d83a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-websocket-lifecycle.20190306200217.tgz","fileCount":608,"unpackedSize":4998975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgCguCRA9TVsSAnZWagAAiosP/ju4ySYYGhuh9jPQpQqj\n+CANSkryKnlXZU4/GjqE2AYgGCh9vK9dUsOU6iP9tqoo1EGudJ5U7xxPHr3J\ni/AHVYDPeuk+PKPeAMUSpqKrDOj3hgbIVGNmXU0YeIa2gDNd4bAUxhwZhKjj\nYlHnI6J9XY2RNsWupNPu+nm5uSbL7p9KFUMuvcsB6kV2Ff9qxsV+ZToBVT5X\nWLfdLhEZGVOu7o6Fghgp+jCB3KdN76mg1IXyzvG+VxZjhVrK79qo4YiH8N8t\nMThRAHr/50oS/xyrOHyB69lCyoEixIvSbS1HtjTiLMJBlkTk3n4Z5huxUzNP\nrwxa9hnEZnSAFnx6usVro+BDAM4Ousnuas6f2RQaK2YYu8dsYnkw6N7BY6p0\nYj6I1tB43BQ4jux+qhOB2hZjvJuH9ArDvMj/coghRtVx2nU44PqehkpIIr9w\nozbLjlrgse5aZiceiE9CalnXfvb1Umdr5MRulbIRYLwqzVmR6WI/KLEz1WPN\nSu2lmv1InIvk5GHhzfZnCR131NyKbeUDXzYMQ4oJYQ87S4FEBsWAufi2u7gN\n/4Qynu1e0z3sPwHqri+2CmEuMaN61leG06Z/jHfE/iFg1HVlj71XlSyOfdXo\nRc191MzP8lmLw77mMwNMTQB2EPif1RIMCTlPzp5zs7jmaOeGr8xU0BaY/OiB\nTKyX\r\n=O33c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcjNDGIyK9mcC7ay65yd8vo4KCJig63HWDw9tg3+V+uwIhAJK18KhMmhaxummBRXsY4jrhNgGIUiWXq8apKaKwANbX"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-websocket-lifecycle.20190306200217_1551902765955_0.4131366345542251"},"_hasShrinkwrap":false},"1.3.0-tslint-types-481.20190306201156":{"name":"@atomist/automation-client","version":"1.3.0-tslint-types-481.20190306201156","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a2ecdba1c789143cd77b51d252ccf2b51eba29cf","_id":"@atomist/automation-client@1.3.0-tslint-types-481.20190306201156","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-lIwquq7EnceLM5wE6Gy2TNSQhAkaW9NbWyWVNsLUdCSQyANEliZfooBBLP8ptMQC9cS/Ddxi6DndEewQLyw9ww==","shasum":"c267c1e3c7b49574829f279f1ff98233b8e7ca89","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-tslint-types-481.20190306201156.tgz","fileCount":608,"unpackedSize":4999328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgCp5CRA9TVsSAnZWagAA4sIP/2r6sDO4heQf9KXpiKdp\nipQYVtPa6WTVWhZmsmfKOzNTMakzkgUAQEe1qkjNY76v3VQcp3sy7Vj/5pYQ\nkba8yl6v+37aw19idRckkHwCBDZ8vmAi2Qhh1JsJFYl4Jtf+CYh25TAH2cGF\nRgoxm9xDROrJcwEQR1ExzOhUn0PXrzDxR4o0dC+2zRneZEPt32Ll2c+mWf73\nY5O7ZSZ1AOnu3HywoXp1yKcKv2GFfhNov49/jRFv2/hF6WC8HFbylgHdbsBW\nfiBXds3SBBS+qLuUmY/1XscYRVUXFX6kdCWe9du2ghxRjXJFcYd7aWfFvFJr\njbz1lAjURuG9oVbVh6IWSQZsVuO4gt2GeMfYihR7Ib/h16ozXniWXdFXirLo\n3NRLG8j78vz5vhCAoFPz59suStw1ll8bMGKzTPC89IPH0HQ+zWvf9aV4+ctE\niEHv4yC4b9Ktv4WoFwOHducfM4EZqZfWkVGjoU6Qxuu2GdmCJbW6WCwt3fFM\n0XpzMbehY16MaLiZ379LRS3cTkUTir1z6/M5rEwbnynIdPCA5Tgd4VgvseM+\n8dsjYpuxm/xwu9PzMO85iyL3xj4pWGzXZHw7e3zagV8XrUXJ22FuyIhPIj7m\ndy/fZP4TsVGipfGhakDUACDXKjiM1HOQf5MNSguDTeJSeUARIpPhiK+yazbP\n9c4z\r\n=bifq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFL6dDqIRaUDRpqFJe9sKZ/G/sxyPAPXEavxr0mJPBPgAiEAi70wtcYnButNI2IUvfPVXE+BKJrALab58OCmsZTJ2Xc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-tslint-types-481.20190306201156_1551903352532_0.40581427984214713"},"_hasShrinkwrap":false},"1.3.0-master.20190306202631":{"name":"@atomist/automation-client","version":"1.3.0-master.20190306202631","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"941b78eeb57b02b3e4e84274cd3c17241df10735","_id":"@atomist/automation-client@1.3.0-master.20190306202631","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-AUugLy4WJty/Avo62/++9CEHCp2oYUbtNm9thg7sL2Itw1O5lsG3J3x1ZZigztEe5I3EGPWGco9K+hQ/PJ1UpA==","shasum":"dcfddfda0a40b65ee28cbfcbd537d3b6362667d8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190306202631.tgz","fileCount":608,"unpackedSize":4999078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgC3hCRA9TVsSAnZWagAA1GsQAIDDls9J6GSJT2x3ZGWu\nYRgPN2RtH1e6XyC6baNhShISm2VJJcMEQeMlNk2jD6VJoO+bXWUdV41JnrwH\nu/E4LwFUFvlXhpkQu7srFAbMPLDAd1ilrI96m3pC+A2+HEJFuf8E9qOlCPSA\nmS5BwwssupOhARyKXM/L38IuoCLA11jBJCjnyrKbHllfjKYNbH13QX/1J8gu\nr7bwijWBoMFRv3XVDjzb1iXVDYSpW2yYNxgrUve8fJbdanhFLgwofyvebOwo\nVrVmqmEC8vwo0GVMmIdgfQrh0QfmtsHUR6rZZSiu670HUbwH+G0b8hEyQT6w\nr8y7L7aiTgeDbnhrt7WUMhXbJn5JE0T01aViM9HK74JAq+iBGE72kwv8aSTK\nrhqYTDpagfZnP5iF64x4IyXfh/nSzJ9E2HsDPEvF4lr2mXuSjpBK5Ww4Wnm/\nsBC4+1C/X183LZhjV2zhebXbuKnh++MdBgGNSq0q3RzsSaGx1dgkLkNzuBLI\n74pSqyWbKwcHzNXKS7z+AjCB4Ihzu6p1BDpk4/IxsgLh7DBxy4v2Vh4H71jI\nXRLdDKKTskddOUfCaXbOMjcLfgfWTbaY8iEQm37i4dLPa91IHU9HmGmqa6xO\nSLhrmiRG1TkMKOwNcJUfSBSwTEHcwD6ctgEAGdEkCSwrNhb8xAj4NZx4N+Si\nPz4X\r\n=djIK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTKmuj2QLKqaVI8X6LUuN+T6h40KpZIaGbnGpfVrXhkAIgDpXBTja/9nGpRkvX/AlSC2DWDGw7TEFp01TcfO1evBY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190306202631_1551904224931_0.6801859724310104"},"_hasShrinkwrap":false},"1.3.0-master.20190306204631":{"name":"@atomist/automation-client","version":"1.3.0-master.20190306204631","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"de15d0a3a869c4b48424b363599e93f6edaf59de","_id":"@atomist/automation-client@1.3.0-master.20190306204631","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-K1mviunyTBZnof/78Fn/BIZNWyc7iiic9zLn52DxdnxpCwkrOCjCQvbOzpqxdFAO6s47MBIzZ/O4jRx2pClNmA==","shasum":"53ba4b859b413013ff3dd00d6eb27622440b0703","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190306204631.tgz","fileCount":608,"unpackedSize":4999845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgDKOCRA9TVsSAnZWagAA9YwP/R/d1MWJ+6g4cdylGXY3\nfetRpW08xb0+1BkRu35IgDsCJdZsg9FGDZk3VPyETYHJ2dOFjNScgOk5BQT1\n4TT9pvJYL1kuTN8hEuWa8Gh2WTIAuFz5opmcjpOL0u3IbbvcBYFtK5cTkwAC\nmiOdIndzn8CwlMW/FN8h7Nbwh69/dddjKj8dI0wy7cSYeiqYYThjunwLI4tA\n2v8B/12Tj10O/giuiFRkNlqsHFSrUyrli3wVQSn9Pwln2+CsIA2iK/+EPTaF\nd22K1K1gN3f0XQT70JWzzXeyBw025ao93GKLr1PgzpG2xx2qdN3CaLH7igfT\nM5lhUbPLxAR2J/I/k67EfZkHLXYy7Eo47g/XEiLjRf4zCwNnQLQOvFJKxFWn\nwqU+iz3xiuRVjdFFKjFU+8Z9TsCCV6CrqxAMWyWY2KTeY20WZeE/DX08HUCr\n+aqlv0ZMiZPSJ4L+7CVJsIL7q06mNHMmV300+mqirKXTIdvBb96sxCdulgyd\nHuKNeFIu8J4JkrP0GlPkt/0DkPa6dJmVszWZK5AAouz+nXzLH+68Q2sa61Vd\nQ9STWJ1orRldJVjZIdWOUMqGxa6tD+PD8ACXJKhgKbBmLL5gb3DEEH91SadR\nSrGRRY0K8izAA1d9KwulqZX/GVxF2tddfukxqmNZHVYmveDJFRMnaKyrPq92\nnKU0\r\n=DiL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN8iBsPRlpBzCEoDzW5+r/BrVRo42GrxAVTdq+8nEEvwIhAKAneWUcGRXtpqq/aLXXzjQmkxTvK/sEDG83CJKZH57v"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190306204631_1551905422035_0.5347725456657137"},"_hasShrinkwrap":false},"1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142":{"name":"@atomist/automation-client","version":"1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"78e646e46e206773458599b1efe9c49990a4ec96","_id":"@atomist/automation-client@1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-WsTuUptdY8hChLTb533LMSWInNz4nwNmqg4IQCLcuO89NozCKOdvLChulMQduVnEZ9JMfBlTg9pyOKrczm5w3w==","shasum":"2f68f7614f3fe89791e5af9696f88d35d717476e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142.tgz","fileCount":608,"unpackedSize":5003736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgVRgCRA9TVsSAnZWagAAnIsP/1AGox7VWoqcqKBGF9i7\nUfqL26EbAYghhxu/TCHd/HgZIR/sbCtaN3J6eZEXk4H0uRx9y09DEdRfVVW4\nVXfB38PzlEfA4MgKQIC6Ax7Q/ZWztfNjm6zoftdbHe3+/EWsqnVrkKSLR6eu\ndspyes0pCWIRf534HNm48bfnBlUJhl9bkvL29Nfoca9+BFITDMUxXpZ15JMI\n9b7Tc1LvYCr6PhWXcEKGDZ9L2FcEW3Ng0d1juHDRPl3dkmBPsyh9JoG5Ugq0\nOy7CuPM5ELQiGLpr2q3/8DMv/BI6xL4y9KkBeWUFjn6JsP4MD8nw9yT4mBbS\nj3WuvcvLVGBGbVhoT2z48S5/q4AfWpG64MCXuLZKo3FjoIYCsDOtWzbeivax\n8O4KwrpBD0vslUwOdgMDlXeASZLnqd5uWBIRY0fn49ceyR/NeKEoDJAAd4iB\newN4ltP2uqpHvOLfWVB1B8n4Gqwe/pcmimKdB3FwZmYmQqexlkE/U9c1qbSH\nclp0efIJ75RLkQqO8pqyhovWZkwftzoBM0L3yofGnqkkNZ88iwcvxu8OkrFN\n02/aXKd8y8SxlGatn0WRPIzTs499fYBQ2hM9pctc54sn6cpNvBF6SfDczajV\ndSTNfkM2PwmpCy803OnLs0QP3dvVAmE8+CKaLVeoYtYJrI1QAWtgVXKD17q2\n1E4Z\r\n=PlrA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEwJs0NO4xrmkovGSjtnmN+TCOL/ix1N5K5c/1Gn4s6AiAwOG+O7cHLffbeHx7tCW5NTXH7gNl8NY6F1VBo7vmOew=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142_1551979615447_0.8691879816251891"},"_hasShrinkwrap":false},"1.3.0-master.20190312083947":{"name":"@atomist/automation-client","version":"1.3.0-master.20190312083947","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"738f2b25c9acb7be87a2a467996f4070b1d7b698","_id":"@atomist/automation-client@1.3.0-master.20190312083947","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-OA1mN1XZmAq4WXJHlA1uC6cAyTYY/NVFJziqm+dTb3fHWCTIEfUP1VfWC/aCX9Qpn1+LQhiPy4bETMysfJA7EQ==","shasum":"1b6d01e7a99d1d293eefd02638498dedae98a6e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190312083947.tgz","fileCount":608,"unpackedSize":4999838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch3FECRA9TVsSAnZWagAAxw8P/1x6zBzwfdMxUfV7KgPB\n1KQMYzk9+C/akf/Flvsw6DKXB69j7y0KF8dyicLDbA/NTlQPSThAu+/GFaNf\n/RwSHFJPaK/Zy1f2B7T/nYm3Jk6+NXE9/wSWjjtdy4ltF28aYY4bR/zKMgfD\nR8u6hBjZVCfcJNUjCZAF87ixFSy57bAFFHemwcbCV7YxXg4/jCOzVwagi540\nvE9lc3U0sYa9WUoRZnb4qup6qCINwG/i3dwM32OSLB6EyTIdlPiX7+bOORTU\nZPJSXD8DlqpYigDSMiwVTvOpcrGlscU9tYBgVZjY/3ka3FNci9uoqD06RGbj\nA5pr4q4gsHeEjPqqf46P7sxZIKIfgsZa210ov+rYXmAO1stE4EeyeTmLoXCC\nTRUqjIHVp7A0rQGBQMobD4jok286pEhWXdg8c1fwFJ6dRBKcgjecRbnxfFYz\nU0fQalyFNHIabnz0pasf0aQp1io5XSw9HMMAxklRHRD2ia1jTDrg4BU8aSGJ\nwwOlhO7F51S0OTD22FlSmg7TGTHJFrR709TzxR35Xyn6GtfZC+7CMGdf5F+k\naYTZAnw0tfsCy885VxD5xUNcawfAlEI9PNNvQ8APEikihMQ07e/3YThpM3sy\n8Hl8Yd7MbRUq8DYAAiDlK2T31OcWsiF9cBLq/LT/gDhlr8xmr3Z0Uh6qwATB\nni+p\r\n=2j+d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgHxKC3WEUt+g1nmc5TvzimobwX4BivloHUlL80cw3kAIhAJ4FDY3nklz80ax2qxuGdfk2TqmFc2OJEJv9Vv9HufCS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190312083947_1552380227784_0.5402617407447097"},"_hasShrinkwrap":false},"1.3.0-master.20190313120723":{"name":"@atomist/automation-client","version":"1.3.0-master.20190313120723","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"85017bb60ae1eed1713f4fd5f6bc28fc2c9616c0","_id":"@atomist/automation-client@1.3.0-master.20190313120723","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-gc+Y12mENAIHw0XJdPC/tDkGKESgR7tPNWlJj7zOt6jarE9uqL5RqaccMbyja9m1qu7QhaXimOfwBXdaq3ZhiA==","shasum":"bbc15dcf4ecd033994e154651ee805e907936d2d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190313120723.tgz","fileCount":608,"unpackedSize":2898772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciPNKCRA9TVsSAnZWagAAvgkP/3UEfPdv/8pPTstBvaqW\nYOctTtsOcp02CRzPajabuOh9ftMvdEc5ALgkMGKhW709LGQC2a54aeFIRA7B\nHo5JIDmbNcQT32VEuuhx96O7Rzjdh8ZxVkFH+qnBg8ujNOAdnvSbWqVuXISs\nyZe6ejzEIDpO658WiqwZekMa6HSKRy5V2BkDf+uNkHlD+vdq2LZDvwMNIxDB\nsNnPTApWOk90RnojqF0eTh8pQAeVwosmFLurzr2MjcBADevQtxJMef6xQZvl\nh500P3emI54x2ztTEcW6wtGN5KvccpxCQcFiB6P8QW9U8C1yDJV45fPrtpmA\nQXgn6ZDrU2pYCjI/ghZ7RsMrVFZ4tpjMsU3ulZgEjJTHgtfzuYaJ/+u0ZzQW\n86yzuz8fGk/hkagDC8Hlu617vpKzQoLnunveAH2bHs13nqp3LL1QSiNzLQDt\nEALsN7XLaAI+AEIBzx7TXkzFkTluNIF3X64nwuUcHFYsbmRvMJdp8pzR2bwb\npiHXXaBwvo1f/IMbfUaDav/zjDwW9AiDj3LUUuMqHhGigqLAFPE9zbrA47Wl\nMVnx7jj9dCGKAGBOV+u6CrJ/mLuDdtR6pyRBJpQTvmLVOHlvbObKVCpMgHtK\nb4IhsRiOMQi2mcKIuxUpneNKXpI+65709n8txnLRMdEndXybpxFK/LEXpCkJ\nHT0U\r\n=lr3x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnCkYhIAwuX0O49D9gdHHz9/Bi3IFMh/NBNFkcl728fAiEA+vc8daqUZyt6RdAGuHPIl5BfuMiSHa0SymiwDhaGLGM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190313120723_1552479050234_0.3550013838382482"},"_hasShrinkwrap":false},"1.3.0-bitbucket-branch-reporef.20190313131418":{"name":"@atomist/automation-client","version":"1.3.0-bitbucket-branch-reporef.20190313131418","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"34b88c9692dac24b157ca0f9211fe5d229134729","_id":"@atomist/automation-client@1.3.0-bitbucket-branch-reporef.20190313131418","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Iu0QIdu0AZc7cCU2xzGbRWzaTmJpZOIdF02Ojmrnb0sJvgcB8tJuFsjI0Htpb8dt7S8H/Rtenm76f4mAWGggZQ==","shasum":"f158bc3c98174eccad6aa24654a6b916cb2d7b6a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-bitbucket-branch-reporef.20190313131418.tgz","fileCount":608,"unpackedSize":2899053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciQL+CRA9TVsSAnZWagAA+BUP/2hmvBYHyREzTg219amV\nZmkCR5nT3oT4fDdldsKLDH7FSmgZc7b4YovuS3hAqtB236CWonwLe4ph5NhK\ntfOQCXdMu2a93a1KK1ik1+7VliApOWglCJrrR/IEDecMJDcfHmARKL18qfS+\nMIzvTJr0Kkgx8n1xavZWUAbDmwVcr5qJoqds3WQB5nU3274FWKeuaUVbwDTs\nz28CfnDD6yfLvU7/jOxiIs9EftI9lM9K1RsXS2qX4mXCwYgmnK4NQ/0UTs9R\nkeiHdyb1RToSBinV+V2yVM4eG+UOA2usH8BCy2VaSJ0iGlMf1cUq2pLTfW0H\nFm+DR6FIVZJ3NYc4QkQj8MTZuWTkyZZm1OHrskzm4Df9hRnin1Q7gvyP5vk5\n/U3C9hI2FL2BaZt6MpaouqyFI/2CSOot69pyW6aTfbCJw9YbwKj961Xd5Xsy\nGx6pATrBRoAU4Ak7RjxoWmnuysz6V4Uoa402qj8osH+Wf2bq1YmgiSPfuSGn\niSaBElXGJ0B9ySH51BAGm9bOijXbRoBqSqP2kcE5EvFAoSKdUIw/OrIwGdTs\nqAm4x8U7uScGoHYfFhSozhrsV1mRZKrm2t5nBySNkn4lyJXvqRrulYv2wI8j\n8sFIxAmUstN0XW11sirD0vv0KgOuGpitCuwf0m7TUA58OKPh0vkuPK+mx2xx\nVR6r\r\n=do4i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFbriQBcKJTvElp2t+vI7oVwkxLEY36YZw+wTcJ1U71AIhANPsRlyZXZcgJBNfvdms5Be6VVlj7/y4bvnGmzj/NTtZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-bitbucket-branch-reporef.20190313131418_1552483069787_0.9464885307944928"},"_hasShrinkwrap":false},"1.3.0-master.20190313144546":{"name":"@atomist/automation-client","version":"1.3.0-master.20190313144546","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"1.1.0-master.20190208183142","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"1.0.2","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.1.3"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"78e3ba3304842be792e8283f709a17df28ce2beb","_id":"@atomist/automation-client@1.3.0-master.20190313144546","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-b6G0hNlLuQMKeI92c9R5rC8YKroC63fqmkEn0QahiQk/HNYIDr+oJfAPTPI9hGHtrtbsVv6ejwfDrIgU9+XbPQ==","shasum":"f32e5d9eb285f8e7722f3f28545b964ede6f1b95","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190313144546.tgz","fileCount":608,"unpackedSize":2899035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciRiBCRA9TVsSAnZWagAAoq0QAIcotE2qUuoC2X6zL5Qx\nmKqYm5y1wBPqswXzcbuMyJ8WznBzc+9t8/zqylHd3yiWIcbMJsgr0CDXz9t4\n5OfQMiROfzZrhtbsdfuf821entnv0G7DiMAW8oEgCrhrCEM3pOez+KWuUfFG\nYo8cmANBWRDprTfcFyAjhcZc/jZF46vvbIZY1vxE2ujv1ggIG7EivkDUs8I0\ntkR5ACB2zbLW4QD/UeZl8sED0yg0lh7bpFxMgeMxpqYY3Tbaxd2jLHl1JNx/\nMIxGJXZ0M+JEgan1VsgpOAd6CDA+Dnp1n87esjsv+gSK7zDJ/C16ITc9AmbC\nAFE/tR+ZMXk0AXf2kpQxrciKBBn+adxngizdVoMofy4rDwMWCSfXU54Lt4dm\nnsxuFoT+9I1amZf+I707uwq7Dz/leKljsUq1juT6AlB41FUbq+RX0Fz9imI2\nkKlbyNW0zNgdZxF3riCA5FdshK4z7zDnbczofxKnOd2AujWqd4KfZpkITtRx\nAEMVTHNjEjGTH+d68we5FKtw+jj1g7Bjfgzg4QyZJmi22dq6dVi+XjXS3JV/\ny425fttO6WNGWmO3q9a3UCX32/6luQPClY6mQt5piekTJn6bfqW50PGMszf4\nhb1n1iLj2jmUvshxowCGJfd59Qv8q3dp+MQpoXLYdSU3RzpQGlJyeJUSWAMz\nImUB\r\n=TNkY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFRYGHTCqFw9dVcjjbUL8lNjeUTvXxc4Dub82CTePvecAiEA7gfXEGKeeOkuUI4MCw6fANXPKvSr64hDjpk4ClLCMg4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190313144546_1552488576703_0.3923476933801977"},"_hasShrinkwrap":false},"1.3.0-master.20190314230553":{"name":"@atomist/automation-client","version":"1.3.0-master.20190314230553","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8dc5861f5c484b7aa21111f9bcb6627dd73bccee","_id":"@atomist/automation-client@1.3.0-master.20190314230553","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-A9o51Vil+jQpXBCG2SfhCpgeWciKz/wrpihX1cJA02fBYbAt1ZwbP7VJ348uC8rFuaqlth8lcHKQfj29XsOmeA==","shasum":"ce8a4e0a4db7aa87350b396f7819406da86c3401","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190314230553.tgz","fileCount":608,"unpackedSize":2901628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcit9WCRA9TVsSAnZWagAAGwoQAJfhK/3CFzazyleHCTAE\n04XVc9Jde8uNgSUW5C8Dvsyfiw7MnpvlbbTHx/d2E7Zye4cpDO5Z9RBmaJvp\nAetHhfKXy7COv1v52oTFpgiI7P8L+4+Ni5xfi5aaNK7FXADFwIu2J4S0mKfY\n5VUw6nwsr+ggnYGRxbuwJlVRyQFYxr1fBBacuo1XtX2S4AWDKI889xjdaR0g\n4RBtQpea/PaP69IZ0iXwsVdJJ1jbU+Oq6uBiLc2LZe+5GsqqVaJ4fCU8Iyce\n/Zm2kD3JiN7Syp9n6kHpRR0hyN/URAsZP8isCDl7+fqIwiRZUJlxKwFd05Iz\n3Mg7fuH8zvoxWffu7Q7ZI3qeCEogDB3YMnTi+D1CHVc5NTKQxdM80qWH+1cM\nj+WIjphNrslGaAY5ri4gJ7YEngZJjyJGm9fsp1DymfkGIqbjKtwO7/f3V2ue\nzg4/9FK7BZ7hAaFrdZ8eoFL/B9TYobVNT5Yd6xf8g+pVshPbp2oCOGKpdDtg\n+mKU4ITGkt2WcqF2d7j5TB/fAx0n7LrpTwnXEdz8s+QlpQE+708yl6a7NpvW\nQDg8vKX3Zw8DjVzeDXAlehpV3aW9YiuLAro3EggdkzoRQ2X+4TaRBBcO7B9N\naiptLyPsAUSCCVIG7GHcqfuzMZvScCXrGKyZugrIdiUkMx8rWbotwPlTVY2L\n2rUB\r\n=jcOY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbK/gFdHNBxPKhAdLUruQWTxB4/dV2nWo9ZyHqNSeVUAiBtclPScZEdPxjId6JykVu1eJNQe+a4FQNutpLBi3WHsw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190314230553_1552605014018_0.6981028786003431"},"_hasShrinkwrap":false},"1.3.0-master.20190314230900":{"name":"@atomist/automation-client","version":"1.3.0-master.20190314230900","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8dc5861f5c484b7aa21111f9bcb6627dd73bccee","_id":"@atomist/automation-client@1.3.0-master.20190314230900","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-K3aUaFBvt/zAnJDkjCQuZSFFsxOrpiWFSbmcyMbbtpQVHQQtIRi8EHu3gC5OqiGYCoRcVDjtKxEqrb3Qoxqwhg==","shasum":"b2d9ccb21c15736cedcfce1efd0a341a651ade70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0-master.20190314230900.tgz","fileCount":608,"unpackedSize":2901628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcit/3CRA9TVsSAnZWagAA208P/1LYy9H7A6JJJqQC6h/O\nYgfJ8UpydIt8j3VRbi9k5o1/CcTP9xEzxUChs1ZKpRhoGh3iT45U/0ocaaEF\nISawJS5a2s53gotfofVowoGX/yheCrYStju91sMlIqBrJpURWzydPNdZiRJC\nrWdRtRMsjLEw/K0xNvm7yPfAtt7FWkzf7Wn1LdmL/fpdZi1QMXkdjeLV63VO\nCUJCHGWfia0SYsoNZ/oeq8ziRgQ0fr1GII/i0/QG3utFB/8aBjyU3IRAA3U5\ng4+gdHAKpzZVRJqw8KZ0Spd/4a8y6dLh8v+R0xHwfwffEtRvm3f/kix7uImd\n4v6UKhsnQyy94eqQIQ3VjhAePvxLmoeI6Zlf3GWm41LhVnc35BNRbR4N/8fB\nEGfdZbUTq3mDRKSCCPCtKch+IgWhoXy6AfxHsUu72TBpRdwBhjYVKdu+uM+/\nApr5gOhhu0hLp5SbmHNFQ2Ghbuq/YA6EcrT4BrNlaHuZ8Bm5zZv9HjtphMQE\n7nbDVJ+sJAMUBLeX9KdneejFWSu/rvIgrqigShdNGNB37o5+x2EgMpI5VnSZ\n8N/eO37o6GLtIs44pXuEn8tRnZAD6RlGmJXAZJGtSAB02gMOVG4xsNiN6D3D\n9JDiKAe14Xs0rfSd7ThoohPPw7fUHFlVYhCxHKxu6iTd3hJz/vIdy9FLibQL\ntY1G\r\n=oRRq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZtqAhHFGy99TmsGJpSERmRj6Fa6YTN3b5ZFwH6zR5IwIgI4QE8qPVAryTjMvhprqhGFRS81UnZPkyUMIGIRGFg18="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0-master.20190314230900_1552605174167_0.8700066808572353"},"_hasShrinkwrap":false},"1.3.0":{"name":"@atomist/automation-client","version":"1.3.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"0ec98ad6edaf3e65bcb6d8a7fc9daabf35a73991","_id":"@atomist/automation-client@1.3.0","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-w/qwJASDXkYafzFmBVA/3LHycxKxeHjW2ftmaJwIsJt1yolWB3z33bk2ywIctPwW9bihB2arIyHo8WEdCw0xrw==","shasum":"bb4c6a842ead5ed8cd9f6720cec19af17db0066e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.0.tgz","fileCount":608,"unpackedSize":2901606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciuCVCRA9TVsSAnZWagAAvVAP/j7BfoA5UGJHxNYVX+29\n6GjGHsL8phbqudRlZX6hvign52Be4MrYPOMGV8xp2iDvX0AKKcXG4txQMp8J\nlWLnLobJHXY1oDUCeSlPLhzX8gfUU+D8LJIrCSF3FOScXjQsmqaRHzhrL8MY\nASn4+d0/6MCg+Nq/nk/nBnPhXGxDqPRvT9Evs0AXPZrHB+due4B0yyFFrI++\nttp+j0nCTMePVH4cEGPV+oYPr9z8ftsbCI0mm7xj1SGZdJb+UWmnTmP1MwA/\n5bAD4WIxWI76HBfDeQfGSLCGc0noj2+t4M9aUrilZ1lnTFy8nGyloKadNTG6\nrDTD00i+mFB2Ry69g1CSjKnazmPmhqEdU187HaahTfUzJZow2Nl0qZ/XfzAq\niFGmewVqnmFEFw+OM9Mxu4Lx7SSwwQA7dWyic8Jc5/5gwqW/2crW3evH348Y\nI4JUPUXzHk8beWHU8rdgqf4FKqWdWq2/uusu/Chp9PnvdfVkuwqrryMLbiBB\niCyOz7mjrAhXLQy0HK8O11pnD/fC9ixLhhbQW9T6WeAHSPuBV0lII1Z28aCQ\nLuf2K9JeMas8L/FAz2TDcowlv23h7Kj2SpWcqCZPqqzok15tjRhaylgVX4GS\nVJYaZaxFC9YLKB091QFhiIrqpEWOdieieetVbThOLKrGK9gIa8Xvd8LEs0J9\njugA\r\n=pytr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjsVw2dQ49G6gyMGO7u2LSGxqRMkSRh41stj0I1FVHFAiEA4l6X/90YvkpWGoDp1NQpNa5ect1SLMjjRjKWG32JdrU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.0_1552605332644_0.5567235772912631"},"_hasShrinkwrap":false},"1.3.1-master.20190319111921":{"name":"@atomist/automation-client","version":"1.3.1-master.20190319111921","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9832b9333885f0648c8fed3ed06e0dd8d8a8034f","_id":"@atomist/automation-client@1.3.1-master.20190319111921","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-flC7v8Ul3uSE9IKy95Q55heq4hzwmPUfWG0Ud5fs/Bqlw8G9QPf4pmAeJYR/845QzvAKV5NJ1o/QzbQejb39aA==","shasum":"fc7ec66cfaa9ccf6c4c35b7894edfe1170569428","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190319111921.tgz","fileCount":608,"unpackedSize":2901724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckNErCRA9TVsSAnZWagAAkDQP/3vOIoW6OYm1QislKShD\nTRNmDMm5jd0UZyUUbggCa0503k1EAKxCgLn20D1pn7htu42lvLhNB1yQiTk7\nr1sR6z5HcxUXFdphZnmhRYL2+ImZ5ySWTFw/6RKQcgxUSze/Qs98cq8lPORk\nLJrLYqgLwzS6EzDvuEgdyoTfKRAgH6yz0KNzekdT4xR+lDkMj7fId4HUJ/W9\nEscTLaoi1OEOgzN/a2nSWNS3DJA+QM+3vTkvBT+NWX3Igk/Qt8KSY9O+BlGl\nGE8ohTVrASHse/Ru+VRCGtToiZ6wmoET9S6H26qwq/EZG8a32KfpGpwSy++G\nSUWtvCDQ77wdIob6Q7xPjnRKDX81BEdCJzxpWbTOgWM3etComUcXwvkTgPiQ\n2TgZFpNtEahPd5KTGMYabQlFPVqqJKtVDnlKVWd2y6M1hiKChEfmI1bVbSg8\nXfze8IrjBZH6XrfN6Q1HRjIj6CQ/twyyKUHdZFi9imsW9S5vnU75o3ikyT6w\nsOeJt2guocttbuXeQhUjoik6w4BGPsnxCwXfqi6jK89ZC1dtsRCMk3O/SRYK\nJQgjYpKzBBzvesc7PZkVmFl3lI3IHIFuAe/D5vu2W7uMvMCeOlHHawyP9buG\nb7DlP0Rb06wWPpe5NwAiGGILWrnGIpGoVPTaohsQwIF+6RWvWs9n8shXD2oT\nqk/l\r\n=t9tS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF0zEtStdUnbd8xcuyWai2W/oICeGuTwQzUN0kTZyktAIgI1/yXP84GaN8XgoFIvVI7DwrEoXbnBbs48XHMAVqn/k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190319111921_1552994602404_0.7426272626317696"},"_hasShrinkwrap":false},"1.3.1-find-files-with-glob.20190319112356":{"name":"@atomist/automation-client","version":"1.3.1-find-files-with-glob.20190319112356","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e138d37eba6e51fe66a4b40d0a921652c16c51f7","_id":"@atomist/automation-client@1.3.1-find-files-with-glob.20190319112356","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-crCAkR3n1F01r6NgkTH3uNeGO9yMSENPn/xCIM59gr8cqaHqpO7JSXl00JKz8wiuwsoDRzT58B8gbByepoEr/Q==","shasum":"7d65479375ff45fd9e838632addc0d1da5caab90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-find-files-with-glob.20190319112356.tgz","fileCount":608,"unpackedSize":2902884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckNJLCRA9TVsSAnZWagAAnvYP/39Wq7wOPLwEyKVLJhid\nl0TSQAnzpzLJh0zEEEkAc6YATf9yU9lyEVS+frkxtH3sVw5SYUp8fHJtmWTj\nTGPfy8cXZbqDhKR6/wYfM140rziJ+iyyrkl40Rjz5KnKroT8u4sQg/SLGwSZ\n+I4OraAJbokZjFEiWyL+TfMf/2Gi4EQvirl69ZOM279rlJDfdS1JwDjphHFt\nU7+GZUYL5j8nxVEHRpUvmxi7mhSsz9w/1dnqdCDvD22QPO+RRu9BPpxLF1Ir\nqMDf1CnoqoenSO3oX77jozve0PL8nI4QkLAE+NAUKyOsNicX4P6yQcEwnGJK\nhaIxABoQq7SbgCXZwnieCnezUi+xSRQiwuDDFBeZv83ln+2/qlNrlBMI8dsa\nBd8iRD/BcxXmdRdUkCIMIhBi7rKtgdmADAOwWnYo+7+sh7oucnk1KoXqyYtQ\n0LWvn7k5shNwC64q9AbIgT+/p8aPSFNWwU5wKnAZYUjYmMx9l5cPRx+6gYmX\n/IG2GRT7BQWYJYS4/G8Zo/nJic9lG3c+xzlzbRxZy8SHMrV7k0vIE92Gbz/E\ncbc42OBGRRUzwgiVSD/96NsffJHNPS+nv3JGmyADvrwXBZJhT2VXnsfdzpFc\nYL6axc4uTWHI9luoDf4vANTLh+fBpYuL7LxZXoqaNTgWtxKgLOsJ94UYe7vO\nvjb/\r\n=5irT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDa0V11CG1JgyJrnJIa/2jVHViS0/P+UxkK7EDVn0WttQIgefrjYbMZfdjcg/yj3uCHPxTL+mIFjDUFrOYluEAezfg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-find-files-with-glob.20190319112356_1552994890669_0.9937032710421145"},"_hasShrinkwrap":false},"1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833":{"name":"@atomist/automation-client","version":"1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6d3b4a6895bd12ad15eb12232df6e64742cc2fb9","_id":"@atomist/automation-client@1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Znf2LDA8WigrvtkUN1YPl0LG/VDoHOqKo4Pw6FT8IxKFBCMCWmkT7goYA24RZA97ufhS6fMfHQmrPfDWEDSheQ==","shasum":"9b8b160a2e832c8142e9a53f5fad86f0cbf08347","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833.tgz","fileCount":608,"unpackedSize":2905615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckWThCRA9TVsSAnZWagAAzQQP/2r/G7bsDOahT4vtxq/0\n7VYZE8yeUby/gcuFq8dBr6fcIwA59O4cRCb73TrF1diEJd2W7BbLQr1BLqYo\n8g2QPO1hzW4RfYDumWVHUe4dBsDHDelWqzDag9ySCfYYTZP2Z+c2MuTqSNll\nSojXXyi1rkMOaC2TybQ9/Sy7wxUAFNSEDHzHN28pZ+oJNweE1GXl4KxrQDjD\nMZWXg8eSwyI9Nlhv99gRMrhWYofl1TowhoJefGhu57IKMLeMasCaIcb1gxFP\nvgN14C5o/ztnU5Cg1W0jcBO29nIVrgjqIBfakkuHOicIPrTIrmk9hJgP4JLS\ncfdsA21KSa6b4OjQ/s1HB6BmWeeov6sphR4PR4cg8FzSui5U2+qyIqNTTsyV\nQsnE5Qv6die8MU7hhQh9YRNc2d7VKV32ncPPXVWxDSaXmUzYCuEO5s7kiEP8\n7zTgucaGJKDvK8mKVNl03k54OmVsAuJXlLOkuT/KlEIrU8/dENtQjki3Fuxe\njQIqUmAJk12r9OsD1uIEgHHZZ3j3ahmiWKMRgYbVSrteR8tYpFQPevsV6cqd\nD9ZwqjJh0fwTSzeBmSrnxQSSq8cuqvJVFCYGoZZAHfbVHswpGoEKADHvz7tP\n+JQwx9zASVlAtCQV4eZIlN50nCbuUuciwwrZyZQXz34PG/tk//aRVBMcCwe8\nC7le\r\n=+m6+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHPsB9n+U8GkStrt9soz4BCL9xUKV/c5NS7Ep7bm0ZKqAiAMY34PqmXCfb10v2xjqlavbzV6nkeCt+ZXGROsN3xJLQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833_1553032416664_0.6597284225930844"},"_hasShrinkwrap":false},"1.3.1-master.20190320034126":{"name":"@atomist/automation-client","version":"1.3.1-master.20190320034126","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9f7af806ea1bcc7b4600f1c0daf8195cff7cb61b","_id":"@atomist/automation-client@1.3.1-master.20190320034126","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-iLkn7/3PcuVP40srt9/GN9O45d/Bqh5+sEPyqYkYCfRKfuhDdBT5zcgpafw85KikesCsNdAPqt13kfKDyO/Qhw==","shasum":"081d9ebc2f30a5da4c0686b2d71d454fca9b8561","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190320034126.tgz","fileCount":608,"unpackedSize":2905590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckbcqCRA9TVsSAnZWagAAKKAQAIjkmqiM3r+GNvmjmshf\nlca2iGkYPsfI/39b6AkjIkQrOdK00DlRzhppfL72G0rnY062WVygBojqGrWM\nE3t1vrafoj9Z9z0u9aUDMxrHu7sXMzHWZd86IAMOOUnOE28hxqXB6X3XynYj\np08jorrhLY/Jrl55YQTAe//5e997aK5zzTqnaX2YkS24Y2y5AUeijgxb4vIv\nUiz2CZcevaEQzUNZZU0yqrTN/dRMM/vxwDWoBkEXCqs9AT9FqUnl3mxxeMb3\n4bJkbeqK2Tc7/gIVRITDv9IFubN+J9yD2xB+8EV9ePSBT3UADOIwYgUXfyX1\nYbdYs9JMk+lC6+EOzDHXiSmE/Pn1hcn/M9TrWXwUwYFo04r8RTTohMu+lfuf\nzvXYGDiC+GAl2eLc1PPVYFLof9TkTfjHe6FEK8Pk+gOm5yltR/QHPN8f9Q07\n0mjrHC38v2CLjxSixBOGlVrvYRSzbFoG8YsOP6cM2pGznG7PoZBS2CdN09Cf\nvqJ3WHmzYgyPzt9fkoLAlhl4J6S/mnUn0WsUDWYM4PVoHDXjS6TIcuygohC8\nRxPJuPte9R/Xo2uJu5qS/IVsdIkT140cApeR9VQWhj+D4F+VCx/atAvRpxxp\nAfnyyCCuJRnZblewT5Xj/4KAd+Hhqn7zeQjgPwqep2VFFSr4L3CBmZ/3BlLn\nQoZY\r\n=+4L9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlit4MJ+Hc5IKz+ZrxfCgTSfCtsIK8q9zM6BzAqvdWbwIgerMkueXSC9kH9bnHUQ6E4NzggZFr4EQqBcTxpZl/+U0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190320034126_1553053481932_0.8631378457327517"},"_hasShrinkwrap":false},"1.3.1-master.20190322210808":{"name":"@atomist/automation-client","version":"1.3.1-master.20190322210808","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.6.2","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.18.0","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5a9b5f5ccc7d08e4e4d1ca342ab94e77af6942d0","_id":"@atomist/automation-client@1.3.1-master.20190322210808","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-BTAo2vnldO0e7q93HflpiuYliGdcn/5gdYrAYeZxgAMPCEG64GBP9J3p1AZencu+FZtxlKq4up9PFSNKa5rB9Q==","shasum":"3db07b28e7f5e2ad9f5762623595f9108a973713","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190322210808.tgz","fileCount":608,"unpackedSize":2910322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclU/UCRA9TVsSAnZWagAAbfMP/2rmailKBydkan4dJtNp\ngDdqXEV9c4a1k+CiCdNxAT1YNOiiidS07QRmVhFMXWPHKE8xd7kjB7vuYBcs\nX2ngIdKpPcyPwRwxpyRzK3Ramz5+kr0s7vdZc8aGcxP8l6jIhuGl8YiqkDWx\n4qjLKYteE23DSLyRvgZqDaDuZMJVtUrRLKigzFMSrOlZb0mKb0nJ+qjo36jl\nYUgzRLyArJGum9p+TiwjIhh9TjYwfy79vV1pUhDr+Udb5fUa3AjWF+X72OIg\n4HX/icC7g8RWKliIWYNRdMj61CwlUXgo6ADjIOlNk7VFoJmgnKSllprQMiPc\ntRQDkdSUC8+lPjmp/IGvgPTS6R6WRv8B/YUBOm0iza/Zj/qxipahDn170Wgj\n3Q6lLFhNXcuILUepadPCt30Lol+/cStUvMeW2CyNesQfU4+ReaE/jjXerNxg\n8yrUEEzrVR1i25bRrXlxqjvv6Qd9y+5e/J89wW/LwrAzI30dvws7N2CbklaM\nmuNPjCmxwajaxCgwn2ujJx4eEvtZXj4yFz4q8imK0XEwmWOrRUUKSMXcDpDJ\nw6OP/nWJzIkKC8t/jJujJqp0bhUaXuWq+XPVe6bH8fUNBAfilcLkwW6pefR5\n9AdlxCc/YsEGI05YfiTQ7zNk8PVsY5KqHYlNbmN1goCZYOPo0c8Vw+uKmVEn\na63W\r\n=YnfR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM8weG5iL5ceQnpVkBqCLrH7lFMlChxWGK8+Slggsg1gIgL3n/hlN9UhugZlRD3zlOx0dHhavRhC+Xh99npBJRRmM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190322210808_1553289171058_0.6643824403062402"},"_hasShrinkwrap":false},"1.3.1-master.20190322214944":{"name":"@atomist/automation-client","version":"1.3.1-master.20190322214944","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5997db859bac1bf4f722dd214a3a078b9e8e25d9","_id":"@atomist/automation-client@1.3.1-master.20190322214944","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-0pNmVJTwQGMm2Q4A9Dsf/Mio6RuXX+D2JpqhQwz3KiAdTppjDVxGUmP453WHZay3OzWl+ZMoltkadI365B/BsQ==","shasum":"6c3c7694be730b50e9d3aac601a81ea2f057aa1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190322214944.tgz","fileCount":608,"unpackedSize":2909642,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclVkqCRA9TVsSAnZWagAAFSQP/1QuLT47sepWriScL2tB\n/WQETXo62yCl35t7W9xeEp9FOGOZNHpWdR7i06j5cNl2/4qmlVyrsNh1Yh3G\nggXV7fTlbz4rpRkT8ePG6z+F8Pm15yVWNeMH0qDACN1xoFgQTwQCCJRnjnM7\nkIbRoTku9537xMQHLz80BZ2P3CLCUCOT+wkfQ//zj9awjJ7qwdWBuBlGbRPO\nnFta18XRmjuo1McBhANYPzW1r3bAM4O9DQQ2B/bBAmJu9EAMy0vXZgjbzVDn\n656PI8IHzRi4Db+w9z5hEDhhlotWoKu7/X2DNE7xUg1h+dvAilAKkRyHyxFK\nF76hNJD7GfRtyhfAHx3QCD1zSQOuQooclJKT/ObRUr1Dflzt7MhPGNZkOGVx\nYJ56mOD5ainYBpy0i5YvRY72YVIriXQcyQ3VrDwXef5SCUrfpEwzcSmpWioA\nRQiVgylz8ERpDh9K+dpryi3w3JFt+fPNYWhFg8lTuEBjjR9Da1Rwd442mStH\nHuxSID03AwXvWUmvc3wfH/d0cxwY+VygYKs0HST1G5f8zlOVnsiCcqbWNZvg\nhxh0s7+GUB/J5STk/Jb68vV+CoIliVU9CmSkJF7sBfUOgLqfN1tzEZyvRNlH\nHYBy6EeVWJrRe3/2JbiHGJNKJbnQPbfPKij82RcE75riYfXiE7OTSKgdyuHf\nivV3\r\n=AVyO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFGIy/IB4Tgt/Ky4wSJM2Nu80qo6mmV3qsd2EeT6gB2iAiB2jOYSAf7r8k6CoBeeWTZ9uk2VAfgarN2IzPNtUiY4HQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190322214944_1553291561491_0.3961508717529303"},"_hasShrinkwrap":false},"1.3.1-nortissej.generator-target-description.20190325195408":{"name":"@atomist/automation-client","version":"1.3.1-nortissej.generator-target-description.20190325195408","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.0","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c85afd5a16feaf57282f4d9935312e739cf5b1a5","_id":"@atomist/automation-client@1.3.1-nortissej.generator-target-description.20190325195408","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-+EcmyP+w5Rx1WvVJozLOxnWzPLG6TD+FEZcQqGbSxoc0vzxMMyNcDQhlOx1K6TVm07tahWNsYuSGWMAvtfUA5g==","shasum":"4a4262e74f9766fb01aa0a5865aad5c5eef3f3c4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-nortissej.generator-target-description.20190325195408.tgz","fileCount":608,"unpackedSize":2901750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmURfCRA9TVsSAnZWagAABdkP/2DBr5cAV271Co02kJas\nY027Di6S+CorfJ5GrYxIfrjZmCM3h0EVbvZh7yLiilUNXcx6eIqGHTgKfNqo\nF0KNX3OiNzUSar6llDYU6Z+OWnNGdwTrDMyNuUuMJ4LoOK2+nXh3myiFq/4l\nnrfvalEYZ60FDdJZk/8z34hkfVk6qLb/wYnmqO2l+nfQ9otyFeZ9NC77VjsV\nec0LrBdDrrdeQA1/Sb4iv+UNPoBrB7NkC1ZZVJceNynx/XWhH8L2pOz7ovMd\ncoL0zncLn6E6XQdK8mULmMq2dYbJvSEziifBoEl60Uu505StuF8k23iZi3Ki\nmsALnxzykrNZXPNA0vTROT0ok1lW2pUvLy76wioUOR6QOM7U/4sjy+5EK6eQ\nA+FWaVz41nNpwv088qQamy0rJikuO47+m4hXPeyVXJ/ennR60fM2UVslAfQY\nWuT/kTSY13eTtXLHtlG9b+ltTOcQrQfUw1rqsGqqEr6Ea5VEwqAy8kMYlVhu\nlgBA4w/VZru9h6JIWWj6SJDaNxbQOwer2Gts0znBnPoFE9kiZ5ulNG212nOs\nfWZH517V3LOz1o721zeltNeBC8xtquk25X7J6y34jkIvGr/YqIk/uT6kZulS\nDcjnAvxGIQhzporuPCyjRqJ5LayJ2NVNdLu6dKnKFbACKJQ8JFj4hdClB9zK\n7LMF\r\n=Yrlc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFDvVyJjC2YyYiItRAWOEFqW34mwhpbkKsBTlAgUDddPAiA5BOjgBxxwtgZArogYeDmYxnOjbphgYkl+kBizGG3ZDg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-nortissej.generator-target-description.20190325195408_1553548382295_0.559311407429476"},"_hasShrinkwrap":false},"1.3.1-master.20190326043055":{"name":"@atomist/automation-client","version":"1.3.1-master.20190326043055","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e630b4b0720417b4a80a0e10718a89c95f6b12bd","_id":"@atomist/automation-client@1.3.1-master.20190326043055","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-GwzWKKiDsEPdDpWzKZeRoXv13KtnQXCKlIjqRZ9YSOfUJTW9uWfjl4yRBADyc7XRFN8mNkAdADJkDTxaoLWIJg==","shasum":"20163498e19b946c4448e95ac6f394e750980e9a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190326043055.tgz","fileCount":608,"unpackedSize":2909763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmauwCRA9TVsSAnZWagAAiisP/2qCnKVsbaPPmlU6RjPq\nBvPi/Iw4lojEQ7R6SxfwkfZI6KL8vFVKmjZTMkJAlH9ChfV5PVysd/WAJ56i\ne3qKNP+jS/AmcFJtkshAwaJHBV04od/H30xc9/txbe9C9VCZEA4GNaftrbkl\nwu3b64bjGDhkGzdXq8pPbNRgWFggrohWKVm3CO3WHv/DbQm5Fyg9KeD+5/4P\nIp9qhi8ziT6XF9eWZxzSWKofqEVSeB1akuNq7g/GL0gvCQvjrOIselVAUMs7\n7c9RcUwDozR/FBWRiLYd2q5q6heObJSaVbeHJV2T+pR1F4Iw/hPP9/G36Tm4\nJzlOr8BYF4Cz/io+bnFOMZePmrSY+hOukM4U8x0WV1dTgqZ+YUKGIu32dUrB\nh+xIsg0fV1o96I0YZLh6Ha1LUTigt/E2rk2Se27idMw9ERtivH5lyMUWgsEc\nNncUPzf5W8/XxJxMXnJEfWkLGBjA7a+ZOWspcrBBv+jGx+mH7MDl+TvcjVGu\nlNc1AhS4wBFxvQCiXIuQaTD3k3vECPBtXWC4ZBbksLiueh4pgQEtLjxaI88r\naWS8orN7vU7hktNYHWfiOw062s4giWCvN4+Zu7x52av0wHTsU6z+T+LWZMh5\n2ZYnO4qn+ZZBiTn8PlSkGeWyyOXDadXLgIhqbJLYA3RVaMamKbPdOAMa3PMe\nuZaH\r\n=+0mh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrvX8044CMAWrdiXB25tlYYnAGx60CBzWKZohg9/j0sgIgZnauFQ9FdhoYxFpMHx7HZTkNdOBW1TlPbgFFi8+DElY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190326043055_1553574831749_0.972979546158347"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190326110017":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190326110017","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.18.0","graphql-codegen-core":"^0.18.0","graphql-codegen-typescript-client":"^0.18.0","graphql-codegen-typescript-common":"^0.18.0","graphql-codegen-typescript-server":"^0.18.0","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5304fe0815a3f4ef9880e2cee22dfe34450e80f2","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190326110017","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-uCJMzU9AaaG1ze/DzRosZDhgJ9JIh02SMfajCbdEkq2eAdh/ynY9wboztanGNXrWBEIl3y0raFB9HWtZ/4BXuQ==","shasum":"5acad241dd10333c754265e8ec99018ffae3d907","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190326110017.tgz","fileCount":608,"unpackedSize":2909772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmgcnCRA9TVsSAnZWagAAehMP/19NlmYzTcsfZtA8u0NV\nyXMXQj1HxFNjuPDHPuNICh3ExqokUZXCIf+tZU9XavX/eXZn4wdistI0yury\nIMetEzQWcY2BhL2Y60Jw+sjJEogzB0L0Xp/N+fyFMgYd+p1en6Dt+7iTExlU\nKygxwy2Ps5mFtSqjzA39SuXo0hzyIkprtMeBU1yWxiVBNjAgYgiINZvEH71c\n1tJYxScnbX/FBnZr/Cl3JfPGloZoepliW3H+0FaZTYACEZBuWLSXol3T2/eo\nbhz8Hv2UN2jOUofxkJqEWNg3+cpBcBv2fYnw6lA2v65zQgLqsjFzn+h6nNdq\niLIhYxqTJ2DMd6xdjHuMruLcp3OKwhxTQ1RaUYTY20fb5Qg+TwYkx9w1+4Co\nRKEyLAjB5ywqxtcGhqw4jyHMYKP19gUzxHSGUUd/vduvCuEUpEyfQzkQTAMm\nnts83xPgYltAEgADyqFtksI9doZB73pzcs5efx1PQTR52iNNJIojzhraaSC3\nZc4/C3BeOq770otjiU72Pe+S5oP9A7vljznOYc10NooExfgnFux7KM67sSu6\nKFBSnWSTwfFYHB9ciGct3DCi4R706y8jGrIUGMvWuXXfrLUyBneB+bT/jGyn\n9rACjUradP0JWojoHCFAjr4noue8vEaiBi9Jx6Fw617KR+Iqv0WS7RC0bLmj\nTZ7s\r\n=ZoLt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGbNXj6K7St/iv4QS+93TtXGqpO15yGO9QkgWnfqfVEAIgUqtVJaNEKDTXKCrrQKnlUns3TBhW6Pgs/3OHuDyuFsw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190326110017_1553598246510_0.659260286990579"},"_hasShrinkwrap":false},"1.3.1-master.20190402070516":{"name":"@atomist/automation-client","version":"1.3.1-master.20190402070516","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"337f921dd5b5f5945870f2f5933f3e7b72e0dac5","_id":"@atomist/automation-client@1.3.1-master.20190402070516","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-z0iU5AEq1CrZpBIimm9nKYyLaWOjUr+ic3/YoCFPAsHk302ofW8/CJjSzaCzFrvDbGZazQPKoXOdnHsfLHA4BQ==","shasum":"d432d5ab059701ca0aff44f903e414adc6d0abe2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190402070516.tgz","fileCount":608,"unpackedSize":2910244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcowpVCRA9TVsSAnZWagAAST8QAJZd9Ojq6Pv2RyXJ1Ei+\nRvJyCUWQ77DU78X/uQXuyws+ZSzwcm0NBSFO9IUHThn7Xj+ZrNS9Beb5u+90\nSZ4RUkXXurkZxxtWkxnUDlCAYIKBAvpwi2xIPd9O4gMNZMyyYDtNU0nhnQtB\nweBRdlViaOOIzzBbeW+cGXH/vJ/GoeVCB347YobcJQASflDS7l06qmaNTNMT\nyV8y//LCHLuJX2wg7/A40o0mZWpGgXyNzsA4KVrbpM32HvS8Jw/ZYiHE3GJV\nLxNNFnATeC15CAEJWzHVsHWYbiiq0lSO9j6RiKx54zRzeMUPvW3+gqRqO/xp\n0XkuYfE0O/TNGYiMqYU7awTJVrLPtNUn9c0rkx/c9KWLUXKjraHw/xUVpHzb\nqeNs0EGsOPyf145bSPhQW0XRR8bk6zPFhn/45jMUmx3RIwL3AenAOtF18Frw\n19FTe0spuy3UCKK0NwWZHPrikbN7dNWbkRfLAQZ8kWpwySKjo9y4XUosG40g\n0ebdOszUZJLmNl2nuND/eK0BCEdJ7bYw63l1493Qps8/cHAhmOqo5A5b7479\ncac9RzK+5BGSxdiUvLnJOsujjGFbX92f4BpTjqHZXS02chTf/40fI9OU8oRz\nJn5Htq/+AYhjcOunSmoAHt1/4Ftuw2kZoHdwdyGl684Wdt+OUNjGzC+BG0dd\njc0/\r\n=JDLG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdO50As9RQe0VO4rer7Wmf84coamWxMpvsXzODlYqgfgIhAMauxsrZntb4QJoTpWGlFSEcFblT3HU/jiLU9fSHIMMh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190402070516_1554188884438_0.4375645212344359"},"_hasShrinkwrap":false},"1.3.1-command-request-enhancement.20190403081050":{"name":"@atomist/automation-client","version":"1.3.1-command-request-enhancement.20190403081050","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8e2b4283080422491d908d6b989b87a5fbda3522","_id":"@atomist/automation-client@1.3.1-command-request-enhancement.20190403081050","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-HWnWj7IGyWX9MW8+WWavVqku0SxsI0XhaBep4OrWqGR9OhQnm21bSV+CUzqd0S4CctnXQjrMgh3zJG5vd3YwcA==","shasum":"fef901a38a3913fd693505a6184ff074aeaeb029","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-command-request-enhancement.20190403081050.tgz","fileCount":608,"unpackedSize":2910783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpGssCRA9TVsSAnZWagAA//sP/jTsYhDjrQYdbCeuMZUA\n+laOgVNNRQ36it1gvvdgim84jIyz00nght1avKIHGMcB6cq8+BfD6xyZAjyR\nXMCC5jwMutt6dTqRP4ri02OyW5cmoydfTWwlEkCBSjr0fRLbvTfOwIcvrBsH\nRqqoxQs1FdhE74zbhc3+pno7Xp/YzLYsYpIEVSeBDiT+Gk0nB69n+vA5qobU\nrjcl2YfWeMYlrgJpquTCmZ/2V9TPR3E4JkenBbayflhp91qqFSQLgey+zyT9\nOJTHhFsZndtZxR1pVS1qNDf6ICOI4IRqw/EsWoi13zTue9dwvdrBrGwt4MhX\nVY55sHDbKtm5Pie3bN9Bu/e708CEV0Xc0ZDHdBX/AQIl7IHLH0SjRIGV9Nhe\nG52DANAtjbVezqLjb8unNN/USA7O1/5RcWFg3yRa5FH418oDhayev5vchLmF\n3SwjwGY8yMZzZvk0o+Z/Axrbpd2fh59VWNIobyOKwn7kKP6lUBLRNBbkTW9z\nFlADa1X99RParKrPZFlHTLarXTb9IqDdIh+0Zyo9oKbbihUvXydA1tXJCOUK\nSHu2F1uKDn2SkkfkSg/kZ5/xDouF4TqtnYpGEIZnc7tE29Yk7pv7qErt434N\nIVT/+jFDoaVU5ncz05uQhQJQngKC8PxHMDo79I/3t8qhpjEQvAaaYw5t8zBb\nSgP8\r\n=WQY/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEe+vUcpsmyaVzQFEheI5welWuYHAkTKhXoUKZg52qugIgdTVZ0wv78ONqH/pGPlxZSjFzcGMhYQqYsIj4ON3/w3s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-command-request-enhancement.20190403081050_1554279211713_0.1615700194012375"},"_hasShrinkwrap":false},"1.3.1-master.20190403105521":{"name":"@atomist/automation-client","version":"1.3.1-master.20190403105521","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ad317ac8a440f6173bc1128f518b39c0b42fb1cf","_id":"@atomist/automation-client@1.3.1-master.20190403105521","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-qfkQtTXKVU3zQmOeJvqcoPTliDkcGlaiC5LgdEC4lmM1lgc7GRRBsF4JfYf/wvDEZ4DDKw426flvbHn1/tqbzw==","shasum":"a372cd54e56bc363851552e0006b1aa4834c9c22","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190403105521.tgz","fileCount":608,"unpackedSize":2911007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpJHTCRA9TVsSAnZWagAAdwoP/RCcJbV8U8d/lCSlFeIk\n2+bLclT5UDyOHlB5ydaDr4flNdEh1ctw985HaGIehL5rQ0S5eXBRkV5YskJz\n6lpsDHI3ztw/kSAyZvre4Ujrfubn0+CNG1B6mea/i1miMbPuwafdfjtQ4aEd\ndaReNSisZCBM2whrxG9dz1sAr1I8sm/xgJEnIRNAMHUBi4YFZ8Q//7BCcybs\nAnd1xNly06O4pWRyFA2IzSdnc61fNK4rAnWOqZ+e5N9VzATXd1gRf2n4thGM\nP0+zUR8dXE/sAIsdomzwqMh3xpbFM9aNnW/NRl53Q9GZtrJVW8/+CjdaKvm4\nHP/4KKaOWyS04mPcLofWwPtGiOLjrFkmAzk7WsFaz9TNLWyj62Xyx35dvEd2\nyCvdGo+qNJOCjzpfk3UV4mEzExzNdioL3d9pv4beVUWd3EtMpb+oXXr/oyW4\n7QCI0OUk2vfq9zNdG2B7rOFNMxiI258v5BHEb7nXvS70Q1tC+xQdphmEMTH0\niKyHMVivfI+N3ABZ876kh1fEfc1oB5UIgJyOvXk5gz/JwXDWheaOroiAxKv/\nkA1hoslmIFv4uBRyJR7kKq0wb8iDyjDeRM7RNDmVo40K0/Hrw7mqniGuQzhR\nckEJ9FOsyQNwALGFTCcPZkvaRwV9cQXr9d3FiE3X+zysb4hZhuG1yfd5Vec6\nFril\r\n=HjJq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCziccTNPrfqz6sqarvxJrWjZaygMbXrVL9Fp+F5q+gTgIge23E4f9DPqBLKLL7oMaWHIGfAgwi+fnkMtoLM/DI7Tk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190403105521_1554289106566_0.33344862985215684"},"_hasShrinkwrap":false},"1.3.1-master.20190404214250":{"name":"@atomist/automation-client","version":"1.3.1-master.20190404214250","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c295ea7cf8f5e68d8194357afab08b0e7c67004b","_id":"@atomist/automation-client@1.3.1-master.20190404214250","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yKAjsGOtplXl5XSjdEbemZSieoV+t8KjfPfEh/5hoZQvEyC8Ms64Lib2ksrEw4prv4AyxRaz65LFyCfXuvFw/A==","shasum":"399e34aacd447d8c4bdc89298b2ef710e0f71709","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190404214250.tgz","fileCount":608,"unpackedSize":2911007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpnsKCRA9TVsSAnZWagAAuLUP/AgOBo383pa5DStyejgB\n2DAcpGzmukWUOCFkkJfN4375svkcPnycQsgzbjbL4JebwWzMEbjMOG7iThld\nf6g14sWDPnxdx1Z6uDVB2QB0EgKKo2OrPIoPuqi2dRvgBSCFQKa2Z0amtTjB\nQmaa2b9WB5rEd0h7onLTtuapnMz0ltJAaqhCECxA+Epk/NSx9S6qJgvLJQDw\nPoJFnuHMlKRz3UvymrKNFN4QCCRNIZNuWhVGwk1Ju7YQ/U6pdaAIJLeb5J7D\nuT/CaJhcttm+XZ9QF9c/ZNJkNCCKR5Qc8EDXvdA8fAjOHoVfF7XaOI4+ZFUO\nGZSiuFeZDrfLk9gVVaWUaggLmRjISpbl4pF3PT71VPYXOFOrfHVLf0imqbq4\nITM3ohLi/DJkP1c/7iha1Ig13ImOp+mEePXlPVHHX9Ti5gC4QeDwlObZ+6Q1\nR/l55bySZ2Z+ATyjX+q3kFIJOeewlGcpqokbLevNjyiQUvKZKYSV6u3/hkAS\nQnymYGfrIPCoKyzM0lP5wt5mDpxxNuH1JaJ3F17JcEAh2FqKUlUWuURsmLkH\nPdHF7UvQXY2BPvSWyZ3Yt0MmLruJmmL1F8KXU7hg1tUhSAA21/19soz0N/2X\n3Yy+WHNYWOcBMUh5/71jOmHk5R8e3xGCgUckoVbWkyuRdVS6FXJ2dez+nR06\ncUPo\r\n=HHEo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwD5tFDkb3JbG5g0XRsr78Cd6ISZY4wmGpX2ficKYAKAiEAkcTuiN0g171Ea/fHISrD1pfbAfOD6voIXyWgulgDlHY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190404214250_1554414346086_0.12122515456572525"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190405153013":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190405153013","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.0.6","@graphql-codegen/plugin-helpers":"^1.0.6","@graphql-codegen/typescript":"^1.0.6","@graphql-codegen/typescript-operations":"^1.0.6","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"902e2c73dd92aca88d7232a8dccc3af3e0d922e2","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190405153013","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-UOXKyFqi6gNAsEOc7F8LCvE3LJrBx/4v66wBBFbb4nu7SxMpP4Crn/Ka2YsGNVcxTMjnYiMoVMZfLvXd6dITPg==","shasum":"986cee6983b10aaeb09200bbdee56cf14c2f08a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190405153013.tgz","fileCount":608,"unpackedSize":2909299,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp3WZCRA9TVsSAnZWagAAChgP/jzC6IT35hMBPGbb4sM1\nkJ+VydlT14ggw8HBgGAOCv/boznHbzhLX5vu7mn+zk+hvNk6h/XEMQg5h1L2\nv0l7igIlR+M1Mng1/DooBH23RhVdJdvJ/zOy/omQr5XAsW70tTjNJYNK0l22\n4/VQ+ppVhfPZU/TkElIjcXbJzNnbnJFTaVrfA35KEIdIJhwZ5QHJwdPT0WHg\nsbHL9QU+4c4M7e1da/xr9zEtc6CyCGGUWwqYmBxzPc1aA5dX1Wp6+NX9FdLu\nfH1vcQ5oUqy/okPSKySCTd0F04Z7bHe0F4PPXhXWVVkICJiVoaRfCaKsgphn\nJsxeRvFAejky7a9NfXF3sXLh0nEet5N4lw8nreYvnF1GePIAa6H5lRVDqlUS\n7H3JhHo0fCMR79YwS/FZ86qLb8m7mKoZ8IcdghzNqrvTym67/YOLq9jOKJdZ\nIgtbVRguBR0xN99Ssqo/8OuH2tK6+sdQgJOraPcRHYI0L5kzmy9tFf2RFtCm\nUvIqzHI1ZEcBrt/PTlB5gnnk4wAGQZ59DFsfC/i6HniNLBFQ+LHxR7b6OUfx\nxDNWLSmYenp0CDIRoLnLF3SS7lnXuVMo1WJum0DOo+7QABMczXieH02zPHhS\n6gXPwZCMNfLlwtYPGwHk73io/KwG49PqxKM7y75bQjMcQL0Mm71exKbeV87l\nqOLu\r\n=BKHr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqSJsvvaljjPrv3gFQTM+8BdX7R141+EaJX4J7qpRKdgIgJEzuEQwDNhLjIBnOakqBQX8conzel8wJHb4DBgIlScU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190405153013_1554478488547_0.6472927938886526"},"_hasShrinkwrap":false},"1.3.1-master.20190405154411":{"name":"@atomist/automation-client","version":"1.3.1-master.20190405154411","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.0.6","@graphql-codegen/plugin-helpers":"^1.0.6","@graphql-codegen/typescript":"^1.0.6","@graphql-codegen/typescript-operations":"^1.0.6","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"553b6ac14134d67cdb4372ead82762e1304548a6","_id":"@atomist/automation-client@1.3.1-master.20190405154411","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-tBgQfUmiWj1qRufA7gd2SIXMAYx9BuDalt/Yz2d9Lc1qcefnzVP0bxZeWGuXheVTcG1D7W0QpJN4c3nTDZwYJg==","shasum":"225e4a7b53060bdbe0ea7f3e2da06714a0bb7669","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190405154411.tgz","fileCount":608,"unpackedSize":2910373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp3ilCRA9TVsSAnZWagAA980QAI8bH/eMq46Pa7PXmUo9\nQMOUui98v4HvWwdaQjeL0GN6ZPL4rA6Qsh0m64kTTIDjOJX1kMg8k4LEYEcQ\nl5DKawmhdbWfP8uuro+vfZWodEnsSWlcitRLritSnyhWbrDu3MYXm9nQmJvH\nzElnz8+jydtd4iZGec3E6ywQLYS1THx7ZPfv6UC4yg5nDRS5cERshIPeAEoG\nhgOtBqVrpmadHhmXvVKp4CumbRrAgfCKH38Xbj9ahSKHRlmSwx5+fisWdCU5\nyXyAGZ2KH27MsqGLs1P7IBSduY5XjJ5oFK9oAKUf/DfBsOfoDrCVuBZcpAeu\ns85omDTgCNTPzYDMct7h+TAJGCfiyQ9cLep32hKjJ4SuT7t6ukJqzbQ2YPAx\nm8tpFVhOkuaZKi2ZZ7DqWiw9GlE3Tdq05tQDEpfVEdnT7cSTUC22LobwKF6q\n8nEQKQyFGUCnhYseeZ9HyKV6HTxErRzY5vn4SSIZwm/NUdIaHuVbP+Ptiw7/\ngElEo2Ssk4SbratI3syN8Apa0Q6n+gnVedMAbBku5GKq/cLtQ6DAt4CoXYgg\nQ9PoByGngR9GshJLyPhqRdeLMIYPqVK+xRFR/F7L8GBq6bEnaxTtdhLSteNo\n6tqk/cke7O64jwo1u7E8njDE/WWWovoZ9oyMutjsFshXzbFV/ASZFNMAqI8S\ntaiG\r\n=jHf8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID85INqxJLKBqNsV0nCDK02k86L6APhEWdskkhn9djkOAiEA85A7wrJxUvUIf3I8sDPhlAm1JFCF+esuRSoI3emmOwo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190405154411_1554479268951_0.29719917165898213"},"_hasShrinkwrap":false},"1.3.1-master.20190405154619":{"name":"@atomist/automation-client","version":"1.3.1-master.20190405154619","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.0.6","@graphql-codegen/plugin-helpers":"^1.0.6","@graphql-codegen/typescript":"^1.0.6","@graphql-codegen/typescript-operations":"^1.0.6","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"553b6ac14134d67cdb4372ead82762e1304548a6","_id":"@atomist/automation-client@1.3.1-master.20190405154619","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-lVEhrqcGZKL7/Enp9bScjrdgSMZK++WdA3NeWaYbFTZcxKHfLxJMJHhrf73vnVEX5q/h1ZC7oW0YCHuAp2yh6Q==","shasum":"f4395b525c744eaddd95443aabd4852a5fb46074","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190405154619.tgz","fileCount":608,"unpackedSize":2910373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp3kHCRA9TVsSAnZWagAASooP/RC+rkQ3C1QiejZLdFUg\n673XWFCY5oUf6p3DDin1K1/KSE/Jm68LlqDaZBNd+hIIBk2KTD1wZ6O3O86J\nstTXDTBnVJwFOawIQ94qHkbBjOeDPmJKVrtpNNp6Z3MdN8bVhtdTycaiUj7f\nTV1t4MDF26g251g+/IC6kCI8ywndPFz+g9hE9pF8U55Y0AlOUdnFXeo5rVa8\nLvH84Fuv/ptNb5pX/ilpZkO85ODfAumKeT5ZLQvv12xiklLi371Smc8urVER\nHkQWObqXNUIFQplbyjg1i4dPgqxRHjjf7peAmIVfnyZh5UiGIPgX4J8TQDji\n3oj4n7D4am2qE0YMR8YTf5AqI+zm/e/oP14easabo9SZk8C1PWtc1/loH4q5\nv9IfjocNhW/xatYOFAKvPD0U6iVHs8FnJkqyu6gz0IjeXNPwHsGreG496/A9\nOruyjj0G5nMXI0EddyDKe1akHOJrV5apq2zeuArNIleP2CRn5AZ1hdQj0hVJ\nF+h6meGDHJ5MWwbntwtOhmrqgnRBpkcT76ev/F6wYM4ZItptmSbQAcfaEcj3\nZHxNvXMDP8rDX8W1LXXYDJKzhzHXPjKU93iMQFXPgH/xqyOn+0z4Tw8QqgzE\nVj8Rz6mjTJTl+8svsHb++5bl2GCxcKEiSWFSYsefs9SmXyZtGtgSXsRZ4RZ6\njTCL\r\n=brBj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNJPXTXMDhh9+2c7xURU8eX9dWGSzatB8Q8oHf6xcxOwIgVcz6DGnf4PgL9QinX4AkVzt6cDEkkmnKyk0IIhuyAsM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190405154619_1554479366088_0.6394659592751191"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190405162356":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190405162356","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.0.6","@graphql-codegen/plugin-helpers":"^1.0.6","@graphql-codegen/typescript":"^1.0.6","@graphql-codegen/typescript-operations":"^1.0.6","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"902e2c73dd92aca88d7232a8dccc3af3e0d922e2","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190405162356","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-CVH0O8skAbpRRz4EAWZzcbrr0E1LzIQ7qBpUaizfjBg9PVOZluf2e1W3xObGH9M42IvvTQ36Dpv7ue42za15wA==","shasum":"8b1104747d32281cb44f16ce26ab821c345ac590","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190405162356.tgz","fileCount":608,"unpackedSize":2909299,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp4HqCRA9TVsSAnZWagAAdYcP/1vH7fQf6LzP31PnO23N\nO1iWqJlJ2qZgTcit/+WaVCJDVGwigESxK6+g23DyyB8ZrFicD3Z5UhaJH3Rr\ndjgYYtD8GBCY/h37ePFM03MhesRz9LEJmbTzI2IOSwe91umPOVeFSGdN3YDI\n6AwbhlEQpHZfEt4ybq+w9f1upUTEB1Tay//dZWXBdr96A8zRt6jxMrDZW7Qx\nUnok6nd/CIpjVQh4eo0m2+ZE+FM/i1lSfqxCkAkv2LZjqUDTXB9xI6JPhmS5\nnl0ocie9/6/LrwoCBlU1KTQor/k8+q0NkrYNh/sUplYckzZZ8Fza3TD44vO+\nYqA3x4ut+xzRtFcF/gsZJGD743t2IHivvLkUZqZKMmwUJrzmnDxRpXEgfTgB\nxSxUfdYigcUWSDThlFnKZ6TIrN04BM6bnqz7yzge2NK8Hp8WKO7Gm7qU9epH\nxpKlRQP1WzzmERXSHnxkBrcw1CIINl2zEYZt3jWpeNcDgQc+Qcwra6orjHbp\nWsiBY6GggdKWchntFIif+11omuXseEJIOLLVKQykUsoNSwQeE7MeiqG0hc9W\nY6Sz6eLn/aszsoczHA4e9P/Ruj2QAnGI/79hx5y2C+WQIbfhCaysNCXwDixj\nhO8XVqOUslSYKsIEFWNWY7ZaVu8/t4PGfvuS5H7oKbNIHphX3OWCSRY40i4E\nt2MO\r\n=nMw9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTr42P+ehOUTRSxMT4xIn5hX+/LsDw3AyizX0Y7PbN0wIhAIjr1mZs/moUe0RkzLSEgZ3HsJ3qV9TastUnEBve3aY5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190405162356_1554481641956_0.6175159280305953"},"_hasShrinkwrap":false},"1.3.1-revert-graphql-codegen.20190405162608":{"name":"@atomist/automation-client","version":"1.3.1-revert-graphql-codegen.20190405162608","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1412a09d90eba6232fac0300abeb9819943d133b","_id":"@atomist/automation-client@1.3.1-revert-graphql-codegen.20190405162608","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-GOLFOQoE7m2yTM03AP+RQJZ9PplkG2fPnEK2IN1x3b3spelAzKKur1cBuMTP8e5AwMZ/RTg8WI0Qo4MEPlBJrQ==","shasum":"b9c99e89586d434ad3208f0c1f07885db1f6d25d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-revert-graphql-codegen.20190405162608.tgz","fileCount":608,"unpackedSize":2911863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp4JgCRA9TVsSAnZWagAADh0P/RZnLS+YFYBKGOlGIZVa\nwrzzGXat4G4pNxwQfEpTYivG6JBBe8M+9ZbW6kyMIjiqY5Eb7MxKNTFYp19h\nOdnU2Nhn2l4qHGmebbD7eOy1inOkP5Ecg9SMcOel3K2SbnWZrhIdUf1FEyRh\nbf+prW1Y95KsbDa/dH/rteOA7zS8t+t4h5UYEviHYcANsqCKu0RsUjy9Nzwh\nM1ahl3/DNNyWLGNH7lbZ13rQ3Feb3LRz7Q5hGPorOhtHlmK9Kmz7Tz0po5Fw\nrKSFzGaBO8bjE5zPPo6d7ojGavpBwjTX1mY7fg+NiLua9BnWUPK8NnopBFpD\nCOf6AM4v3qlpJeO6q2LXL5hvp80BOKsWSB4tdcwnYJoGoPLdEvLDSRkoDpBq\nnW0nzvf9hjSSExgtOOvNZBDMHBzG9rLvehCSEf0fLzj1ZNHTnrspz67oT9te\nHe5V5ZBntG/S2SOAphV3dd2WDD63dBVJ6LoA8/V10hm1RI0Dqk2c5TKUijb9\nTITZeAbjyzXYnftUDHmkLFjRmAgIYrAp6kOrob9wB9WsVoD1ySayeHKQAG/A\nMOJDvm2Q/5huRyPGcDdQ3RVaSQ6mB2afh6buW30D9dGXSdS9eZDTv668GyhS\nTNpv5d+DZjFlr2vRJIwM4iIRDYCH0y1cuLeXih/1yDN8LSSR4bI/bgU05Gtd\nySgG\r\n=4rTX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzW6jwN/sG3wbBZjS8GOaXfxN95yC3pUTFDsDRrU8WpQIgIblRvaq5dYAiDeYSmByRKnAh5OFPhrZwgN1dLQmQFXM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-revert-graphql-codegen.20190405162608_1554481759625_0.5084477839892458"},"_hasShrinkwrap":false},"1.3.1-master.20190405174432":{"name":"@atomist/automation-client","version":"1.3.1-master.20190405174432","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"19cab247aa3f4f72849123859b5edb7f803fd8a3","_id":"@atomist/automation-client@1.3.1-master.20190405174432","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-N6oB1hXXCG4ftK/Ji7pfKiKjnVVAoqPpSEuYzctgH5BQsUyhOY1jZLELijEDiJ1H68A/LHuBtvf2XwtsfF0o8w==","shasum":"e46ff796c9b6abf7871b40aa58f31c3114e4267e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190405174432.tgz","fileCount":608,"unpackedSize":2911007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp5SsCRA9TVsSAnZWagAAOf0P/2FI2DuU5/2Rkv8oqRnh\niBtPSssChcm07HZhGPSvN8NToeKYXC9OM2Y9IZTFAX8ilm60ZBn9d9EgvjD7\nIba4y1oCQm1rH40dYftRis872tOYEQemPqgNIhad6XjqRIdSt1POdyAFbeip\nI9dYDElaVaEJQYs2CQ9H4Dg9fH9fq79sXuEs/n5kKk13+bto7P+k7C6FRF5p\nPUPIhrR2FAnQZsq+/DyZ79bS2sjzzzTL/d873nnVoUdxLK/bx+JhWnHlMu80\nUxzazcx9uLcer3g+C4whIdbYQE2PrHNecWfZScw5EJi6iUBCuytV9O5QpkvF\nSkfPjNu5eozZ3xxc5vrjy20vk7jPUYFc0WE1bJN+xHuWufkiq47oHP4ofIX1\nF/wG1PkaFvxsYhigp637ZKTQvSdxEvIUHhh7gb87v/FIkPOiUm/AVWa8T5zd\nTtbTWS2Gp9cSB8WT3M/eyfo4Wcjytb2DPwhxbQmJX5c1Hx9w5zVW0pCA4gkG\nbQocja8hhxk17YrFj7O/UghFq44yHBsNPBbJXyW4SaHAW3g6dVWq9W0SRzMu\nNR3uSRAYSUEeu189plf5QBGJxC/t0gq72q14wKTuEJ8w+xgifFIuJRfHgyEt\noCnNA4HbjDO440nBs0CdTgjcp5vL3OKYwKkc9BEnxdC8F0DKEwc2QS11eUzt\nVxRK\r\n=idhU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbHvvBBigSaDFgOG33hA/pc4d5NTVvH5JCGHortiiNawIhAN3lim7lq2m/U9FLuCri7VNQ8l2dUlQskzESEoADQWJD"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190405174432_1554486443514_0.37623457581648667"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190408093222":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190408093222","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.0.8-alpha-17b4b74e.9","@graphql-codegen/plugin-helpers":"^1.0.8-alpha-17b4b74e.9","@graphql-codegen/typescript":"^1.0.8-alpha-17b4b74e.9","@graphql-codegen/typescript-operations":"^1.0.8-alpha-17b4b74e.9","@graphql-codegen/typescript-compatibility":"^1.0.8-alpha-17b4b74e.9","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"345e39cf269640870ebd6b29c9ca0a0ed7c44a93","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190408093222","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-LFzJ555nU1d/eaF7yPmWXe7Ut+wj7tAIsV/Zv4NwcRYnPZMvEO9B/5qOl03lv2KqPNTjwU0OYVuWR94BYZ+BKg==","shasum":"3384a62ec4b6549f0ff1c4aaa3c0dbaac51ff147","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190408093222.tgz","fileCount":608,"unpackedSize":2909513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqxYQCRA9TVsSAnZWagAANLIP/RY4mSoKMXZ1U+CGut2G\n6xKbqRxcQuAtSSsizo3Lq+H+RQvN9I39vh6zq2yL4fjkmqt+Y6Z/EDdN503X\nM0gTrrpNT8xC3Mby6NNJ/srBQWPaHP+7rqV8ArUexlzC6+PyU2uM2aM0VgOp\ng2topANGR2Aq7xlOYc2ozvDjrGOKQKOrZ6VQ60/K/UKXFL/1ILSOD57wfmSv\nsoYORjXC7Kj9gEPmrkXbB2cceILecbcvm1hleP4/99T6bAu6R3uEqLWQi/5f\nzd55TOdyEZ/QujhDkd8CIDkoEsJi2ZmXxkXWkItJJtIQrmj5T8Cs54bAgQWU\nmYPK1zhIbNe3oA1M0Y0uQSmHmKWhdZ3YXxREBG+HtKHIq3hAz93Q/7dP108C\nA5rMG0xoCMPY4fQsL70H6S2yWu5T7zl2ZApZbejLvBcn43Ux58KS28t1JIrL\nqnY8V0/rOsWyTZ6UtD8m12ZXCxdoyp9X49fwUIQsoj2nk0jMWa6mZ6emBYex\nq/c8COsTpG6UV1h455X5DkcdkjvEG5cV+fh9o+BR9Fp/wVAJw1Pk84QCc6YK\nfQqtfuCQUDyQGb+6BBaLlRu9pEci19qt4J5jeSYxhrm77eJ9Ak5xIkUkTAtN\nLrnB86VC7NnRsCUgKsd7Ak2k22Wza0GE1msRcGt9zyEmyvF5O4MsHghoDC+Z\nXY3G\r\n=lGcN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHVj9RMHTOP2jM7iFKL8iNrGzhuYbjOVi3NBaLEYrWWAIhAKXkD8tu0h+HcP6ZAewo34fjwY4ACOujZBTRm9vpCSJ8"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190408093222_1554716174852_0.8725054365784128"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190408140727":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190408140727","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","fastpriorityqueue":"^0.6.1","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c5b8bbcf0c8b7e5c189420a1c77d7377e6971eb7","_id":"@atomist/automation-client@1.3.1-event-queue.20190408140727","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-YYMxDQod91ZbuMy/3i3sVA6jDtpsvbvdrtzNN8cO4vy6bXQ6aEly5Qerea33ye1+JGsHsNl2+LRG9LowXZltrA==","shasum":"d6964dae583a122f5f3e0530ff95e0e704265541","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190408140727.tgz","fileCount":608,"unpackedSize":2916894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcq1X6CRA9TVsSAnZWagAARXgP/A9dJb0h6JJlhYsWfcSA\nh7hS6JLC0Ix3Ad3HgVsCpc4HCpLm7gXpupBp3d6vkq5Anh/yYv8QLPcg31aY\nicUCcTOUr2wdUXhczKMknXc4QJZaWvEwSYaaRGQYhUVcdnaTrU9cS86cnahI\nGfuDd/IsIyW7VCzpGySvU53raVXwPSJOj6Wj6VYDWkUhiymbbdWpXWjrZVzr\nzOZTAeq3TZ5HL8ewkInfM5h46IwhTm1YsSuCPlwWsIS6GvEMp6IpFZ3Ttpdl\n4UHRM2dHgVazFFsPuCi6oZKTEdPlsOlqbkUcRrqAPEBHa3yjh2IwSzuKggKS\n2u6XDpW1TQkotrQ4W7mPiNB/IwsadX/gmUzMgRCXGKhvLtLejbbsgWlujZI3\nTu5mcCcdNAR6puScPbeiafAb2czqkMx894MO6OX9NhwoJj5cwLRWDXguq0Cb\n2UXrrxN0ZWCKz6i3wK3lw4gZo27pS3usB31y7TRSmjPBFKgi+kIkaXqIC/fY\nQXVB7JKty0szanXB1VWa7k0NgO3QA87YTNhlQ8lPDe75oQozoC1ExZCHn30d\nHZLjaZ1vTM/nc75uU0YUp4MK1aY5ozSnX15Py49Z0bCe+7q8vY1rsl0ylv0o\n/uN8wP6Vd6DXoyxOpoJv4WkUkXbmiRFlbSQEZQI/uBj9AOk3bTanH4AKDjCJ\nievv\r\n=rjZ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwig7eQB6J4+4z+yjW0HeX7lVAsdY/GBovs+EC8tUlpAiBT05xksqTns7222Vysvu6U0tQx84tFqtneZ/Qbcj2gXw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190408140727_1554732537380_0.5563193248658949"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190408181714":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190408181714","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9d078d477591b958ebd19beb06ffe986c2dd06e2","_id":"@atomist/automation-client@1.3.1-event-queue.20190408181714","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-A2DQi+gX3rDOq2P30QhE3Lr6vNfvC+rkBIEsQ3+iMLDPtsjRO+TWPqxH2HebFEiu+0LA5mH8FKTOTjgJvxZcxw==","shasum":"f19c0c1053f2845a075825a4a09e6d68b574b4a3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190408181714.tgz","fileCount":608,"unpackedSize":2918216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcq5CCCRA9TVsSAnZWagAAWnsP/3WbS6KY0oJEaeTxCFTt\nlXSM7hi8ayWlxV+T3DwYZ5Jnbptvf6S6dT81nAWLKSLkS3iWhTfwWlyQyd4G\n6foZQqxkzfI1iU4KZb22zrDUXTD2PHWxWauVR7fqjWdBi1tdFowBHG+4BjuV\nyjoBk+TAMK7veR25hYnejRxCZcYuRbqyD6nAu4nCdfHgu8u8gMpu7fDo17Ie\nGsRjmR1oOr5vZFeS6i9/s6AvwPzoVd+3BI7O4uCbGz+5ZBwzALscr415fAHc\n2wlnl4IbEE6MYb7AW9bboFp2X5Sxs/rDINNOr7BtOqKbFnxeX3mYu1q5xcI5\nnSDV4p5Z0gwGesliIEatAu35FFzyNQrqkPij8pBdRI/2GlJ1wBeKLlQCT42s\n4GOwVBfuUKBiJ42cSui/lUDUnRp9hPdbLdYxj6/yIb8164x6bD1mWjlYCNlZ\ncAWQLiLBUEHjwd6opvvDtDDKw7g068JDsnTGW23vKwn7ClNfjqZVOEMVkrsI\nADwhfo5y0lYOIJxDi2EexcDjcR8zmfd40/gpmkgEB8Rds+Y387tiBLwvnh3X\nQDUqXAqu7LHBgQdEBjFXoMN8hYrt96OLdAJmks8KimL6pndBUvW+EaoKy5At\ndhqJM6yl55qm4JF4MLmB6ErM82TuOWCWd+a44z/+rsLDgc6QrVjSy5DWRZQL\nehoP\r\n=oqKt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBnQnac+KtVXx8ANqMwftGsMAqv17cwX1ZCXaLn8Yu3gIhAJLrrt02rJllr6t0ny05VftQkKg3vVJ0MZYQtKMfim0o"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190408181714_1554747521642_0.06796298633200948"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190408183933":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190408183933","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4bb5540982670f94316ef9491cb1c630892cf467","_id":"@atomist/automation-client@1.3.1-event-queue.20190408183933","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-0WUFJbFL4K68lz74yUX/l94wHK2+JsmQ6JKotlDbODBq1B9BJrG3dZGoCOWZ/vYXBpU1olCS/b4SItOgT64FHA==","shasum":"95d5152744d4f81d4101bb5e74b956cd4b3a7101","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190408183933.tgz","fileCount":608,"unpackedSize":2918190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcq5YPCRA9TVsSAnZWagAA5uMP/AmSotFwyubx/W+HjLAQ\njJfRWsP6193Sfcj2jOsHiHDG9yZ2S7WyNEFPjg80adEunP0FylDWGoxCeIuj\nNHxEdOxZJOcL86wxjZaO6ojH1JSBb8dKbmpG8NiNoDZ3qZyHw93ch8Sn7eCM\now7ID1QZcVX5V4E12spCb4ZnCujTlyoj0DPpDgm/0cFZ+QETp4b8Vni2zNaO\nvmkwVUVbiqpsFlpACRupRwY9sFY3q+6UyYO5ekaa0NIfaFx0oabH0VRyS2zW\nSQM9otf0aFeAQHosGwQm0GeJre8ydIwRkM+9VaJUc1LHc0fCszTOca4vLYZ2\nNCI9OF9/ltF2OBv8LZBRqy5j6wQT3uCBxH6hArq+SA7Nkhbx8J4cmXrsVzYF\nfuKNC9nUGmLxca8OFUFknSQg47ks61PyD/5D+++cSVIKt6PKu8X6x4JKrbI0\nb+wWCha/o4JS/Cyp2V2tnEDHGbqFfl4TDQRR1sPfZetwzof5b6p6jjiz869W\nioxOErwA0IPO6yUoSo49gHz2ws4LZh4g7foB0+OSWvNU1eL11jW7HRVyryx1\nVt1sfG8oyzG0h70J2VvZ3bNhn3gmWXck6NCLRA4L8A4gjI8yLi5OQcwVL14J\n+k3Q720LcVi24T6fPy6VGHp6da2lKDkYOjLIrysu9+IHctr8iwdmq0YdSxSr\nAHZs\r\n=X9g4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp29uXtNASypYbRi2pzjhEoptS5hRPUZAcwYA7pb+/dwIhAOsYStqtqmz4mKPG6PyZCKwvXdrTN+kYXGssCad4Hpli"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190408183933_1554748943246_0.636917324265512"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190408202611":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190408202611","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f8a7e3e2f930f67476da5371a7b0d656dfc7d041","_id":"@atomist/automation-client@1.3.1-event-queue.20190408202611","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-VEoyUNnFcGPjftQ8Kaz6xN2Mr5kiKvhw1RngsXyzL4Bmzh93GIa81XBeVA6/vrVk5c2+QTXVRbn1hPMD8nOf+A==","shasum":"43eea40490991b3553239ca891ea50df524dd9c6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190408202611.tgz","fileCount":608,"unpackedSize":2918193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcq68SCRA9TVsSAnZWagAArJMP/1WMjg8bwhVOYO4K4VLu\nAlhiNkB0+GQUPYFcu5A5wM8ez8pN4/Y2F+spXYaoKkox9C3ItWZFS0js9vDJ\nfLZtkoHsZbduS7I1XOZBEuPAUmGuJKokkd0LQdsQVOqquWo6BvtamMW9C3oO\n27SIYW3acSUtZzZmPykutEb7cb9vprPFdehhaNY6Yk10iM0ghrbaISbd8nRA\nPYpWEvwN6GkR/Gaf3sKCXGybjS7pEb4XEQqEYmCTvL1J3OZNsIZAHnuDw3iv\nYtoBMqdNa82TvuNu10EfnIJpLTBk/eRGnodC/aT4nPRY9k1L7h3YA9Hec8aJ\nnz9HczmHPS9go4gVsT7tbeYnrGMF9X1wEq2Uc4NNOTIRsh+rabGxZ6gvfEmF\n4umgLb54ingoc61WRwZ8qhxjfUYPGExDKkvNNd11bVdJLgdNUSRyYWMh46hb\nRCruPOkMFeGQix3h+SBcbaIJeV9hFU4E9eDRnBZ7TRx4hQUZINgAgUi64Wab\n7ht0HSJ8X5kFvjxycSsO237MRqjWm9hbxUgYSo2m/Phu1AtYzA1HCH8V0jMS\n00P6eqgU0a4Dt5PFRquS90drVgbxiu3g/ojGoQVJVvG5bHOJjW7SbMIkJDN+\ngxX+VTk+G2/hA5vYSxT+9QIVndazMlN0G2lDcbeK80eNviqKDVQsil5LuRRQ\ns9er\r\n=Rtqu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqFpTFP1v1l1+zslL/5NoPpdnDYZbLHvMDlGatCI6KmQIgZ7F4daXj+WPYDBoKxLy96Nd2Q4TJT/alhT7xfxXEa8g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190408202611_1554755345753_0.5124882717533787"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190409083428":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190409083428","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f6797f6f2124d308cfe82196102feb95344103b5","_id":"@atomist/automation-client@1.3.1-event-queue.20190409083428","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-hP8ALjYCD13aetmGS3YBDJMfQpz37P2W841NWZriPEygogVWEH1QZVED/ZqMY1VFbD0PgGUrYzVk9PZpjus95g==","shasum":"6b11779dc20a2869d8ae230f422763c8fa64ca01","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190409083428.tgz","fileCount":608,"unpackedSize":2918504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrFm0CRA9TVsSAnZWagAAJrYQAI7znS/kH/Va9Uz86oHX\nJ2Evrk/XYt4e7MuCAoR5jMXjhO2l4GG15a7ZOQRobCG6qhYm9DMDqj4aMyt2\n3lBh15wp2H6XeEqCmhTk+PTlfyMKl1YS/CjFu/54BVa1FPUhKnHi6ZZTEblK\nKjeVfrP4tdYQNvLSD0yf6j8Y/Haw/aKN6tj6SRbFiK4BpvtmvxskI8of7SLs\nuUnxEQ5sW0sOQXa0xwFfJg73EoLMXN8FTFYlYbz5/djJ9fcl5+UXiHxUXavQ\noGkU/PhowBYd1uM0VWB3z8WzDInKXTL2YgcGtp/lTD1vkhO3bDWvbAlB8Kgv\nsV8Gga1Ba/DRyFRwQlF6DSPHum7ipNWfDoce4a2RpFPht/TgGj+T5EBlbIos\nXHU3/4aPsR9PMCKTzM/JDayvJwophDqrj0xFyP/UHDmSW4FP3X98NOy4RS+R\nICnO6AI2MH41lX+jkJWlt58RYsdjqhkBESBtNh9ewDM9tPYRzLjw9N4bFSTd\nd87+RogJwrWxKl1kgNhOMzZZPvLTKs+buBAh9mStMMBDMYPDkDjYFjG3k79M\ntZ0M2TmNwf/5TcrGUKB2GGrzt7KASUvuEoWnXuHnF54EEHljAy9CNJm1RZ9m\nuSPKqNCu9DIz0cCF2JB+nzg+CrXTPFQd5Va5FMGnOqTpYrFBnVHryHQWI5SR\nvJJL\r\n=voPY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsIknO99zrc9PM44Nh0IXgObe4ZqobBH64nMdyCjA8igIhAOLltxd4vbUSFAYaMy1u/CmzUxk7XnvrBLtpmV3t501f"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190409083428_1554799027813_0.6278901908254058"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190410100822":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190410100822","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"1.0.8-alpha-57e0304d.7","@graphql-codegen/plugin-helpers":"1.0.8-alpha-57e0304d.7","@graphql-codegen/typescript":"1.0.8-alpha-57e0304d.7","@graphql-codegen/typescript-operations":"1.0.8-alpha-57e0304d.7","@graphql-codegen/typescript-compatibility":"1.0.8-alpha-57e0304d.7","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"693cde2876c15e62a7d2152f3c68f45f95fd68b2","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190410100822","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-N/cbTdOUyxVvk1eSCj9PezPIolILCXvIsZEElnmnsmlU6QyQdruCQeDwLWpHKX42m8QvF55sMEZ+cnk2uBgc7Q==","shasum":"977fe3d10a60f0db752df986f1ff47f795d0ba3a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190410100822.tgz","fileCount":608,"unpackedSize":2909700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrcFSCRA9TVsSAnZWagAAejYQAIINLALqYkPPrn3dilTn\nIfyqUms+uhEEAZ7nXMH2MOJdc/PEWw1F+XVljcsl1x6YeG6ihliPCKXFcZQm\nESc0ea/K8MhSDrrFC3CSJOef1Mg/UqbauKH9uXgE08vOj7CD3F8mEsTo04JL\ns2IsBAn+bI2yyQcFhLXU4q4u+7VsMcy3OdP2Q6PZllgRX7q9amHoWa5tXyXe\nPd2uFSFYBwhPFcslwgBkXNVkBfZHiS9Msx1JLin80n7pLSiABnOXgL+EL8U0\nR2w7y36vdCPNoQ+B5V+GXE6AJ6829UDvO8JveYHSmpU846i7Ef5nlEFEhJJt\n/Wr5CMtsagUN0ibUeMMOoEC0qSF3Bg+Svb4FcMFzTzz4R/KpX6IlrazaxQdt\nVamkgMIwsi521rqpPh03/hE7/kb5Mh8eaVzp4ELY+tDkI2+DtrXcXkGGVnqF\nkrAhZpc0Jd90vY7wEZY7zWFpedh8eX5qQfEHamLPSk6ONxo0OKx/hy7EzwAM\n9IWJzKdHqHohTjpVYElkrOEpbi/ah5pJJUFnNtF7JyKazelfH7TvuWPL1sOx\nPII79+kyS4dJStjVLAgEgykD54X7vuVtL4SztbbuHVGHaNxlfCLXEDmkQzKy\nV64P6jvlkoXzZeSNTiGzPtw2sEnouDTNIWSYwKiTcUdzQ5h5YeLuGr3vei/L\ny9zE\r\n=slj2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+dkxIkJtjQmnWhz1mAto96z576a0zoeFJo9MJOV/qkAiEA228QJVN7KacFdobb2fwayQUdyKisHeQIqAPzHXrJE24="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190410100822_1554891089816_0.20098827958746535"},"_hasShrinkwrap":false},"1.3.1-master.20190411075431":{"name":"@atomist/automation-client","version":"1.3.1-master.20190411075431","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fd834d0abf564067e8f7a5d103702176413f58c9","_id":"@atomist/automation-client@1.3.1-master.20190411075431","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-wVfZA2I5uz1BE9fzamIm+2kXdF4AAGYCiQWnVjdmBX064Xjv658RdqsbA1a8DizvBkdCKegHv3rXjS6Rm3gPUQ==","shasum":"222228409383995dacb353e4601bc7a55c0364d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190411075431.tgz","fileCount":608,"unpackedSize":2912179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrvN/CRA9TVsSAnZWagAAk+AP/RiJKCYqnOLJ5/XCI9J8\ni+8KC00ZDX3o7gGdfHWCvCdmpbuzqSyAEk0u97nUKvSGQP21A8mgqB8Be3MS\nSbIOp4gwP8AKwzISC25Gx5xW2el0x/cos2DHqxPwsQa2NJwyX3V48Y+SFGkS\n9Iy3pVBTkbjrifeCbMIoyAtUWLqJ52eOSIcwY+x9HrEYEorEwr3g/Rio0Zoj\neSb+9z3LVC0dv5X0ewN96haNU9uXle7HqqbUrr0rts9P+ZogMgaLNkEL/+au\nmYxamIjClw316iCsyuzDX1pQDAERSj0idKyl+hu+jATLgZcsIlAk4lgt8US/\nMFpFb6asnWBdkFVBYpeW1bG9xzm7xfa0WUlzeutUAfahUCX91KcLFjui4shb\nMDavTgzjQipfqNs1pX7kJI3oLYUOV98zMleRn8hPuh4uJbds2eqVxZCkMBo3\nWYf6UuxS1ynA58T9pkorQLQpEQ9H4W0/u3TrbZYJf7hKq5VugSefhlYTqIKz\nqlZvgbfA7AteTMf8WXu2wxmFxxl3sTbbSt3z3zLE2oSfoakoJxgBpkkKtXQe\nheMB5md80o+c6odDyRUDB6hlT/BD+QS8udHX9BK2/ZgS4s0nMoP5ZHQ+JHJS\ntBQ7y6cNQ2W8k41iBcN39EH0yYgauo1EgiIdq/1GG6GCkeRdNrb4Hf5nWpA6\n3CQA\r\n=2n9X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErtpnvd4N08TV+7jxgSd7Ky8c0rlLLbYYYpgsHMsfe/AiBIEQSLJljnxFjr2q8Rer4FyA5a5WMGuVC0COd/LPstwQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190411075431_1554969470531_0.5628058990801479"},"_hasShrinkwrap":false},"1.3.1-master.20190411084059":{"name":"@atomist/automation-client","version":"1.3.1-master.20190411084059","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"^2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1c95547015bb9b5a7f46ac6d0418ab45d4c2be97","_id":"@atomist/automation-client@1.3.1-master.20190411084059","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-iKP/lKL4wGlfYMRC8hrf9rpCMVF6PMOPYjYpZhLKCiLaxT/iOsxKUVL4AhW/ih1Nz52pAMkrtvl744Q0KMZ3sA==","shasum":"8cbc189db62de8d1e9d8b08175a0d50c5d028dd7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-master.20190411084059.tgz","fileCount":608,"unpackedSize":2912400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcrv41CRA9TVsSAnZWagAA9LUP/2yrQX4+9RcLjLYfSknw\nPUtAuoUqhXVGZDqC34/CaE90EH+tfc0gagRrIV2DR+h0BE9POfA9GzCZcnVU\n3LwJC+FyNzGM/yfTEAsHovWHhF84/nipA9sT4CttWngeHpNvRJNXJulH9jA8\nCscMMXtKvsVVZ+xHUkuyo9RKC8xBNi9++Ekehgfr8ewjN+QSeckRQqTCyYCa\nBfQsbcgheWvcbX0q5uLHVJCi8r+225gM1+QZfYOy/f6FDrhxq7NsGMUhpPSA\nYDB6Pq6u6+rXWFEgo08VleC0TtH30txTsj76SrgcFqM75yIVEwIv8S3CrL7p\nuGUR+VEqKmQ1kKmJ6bYf2gtEGSKgfeuXYbF+Sjdhq+r7bqAfMX//uoeZSV9r\nALYF9El/gbxn/0RcHYtt8sl95JDOQI19Nx9+PaV5r1HHZTDvOWy1xzmI+tC+\nbqD7wB5fG2xpykqydxrB1D1PC2HntXcgZH/Of50zKqSHWkod/6HNIoChKvQ/\nsSb9jPQNN6+kFF5rxc7L+PwQBtdwvOGA23fpChHLYM9zgCAs5/rehsqExMrV\nj2Fu7f1++v40dgSJfUbWtcBgDKikvWjiVPJPRjWRbCgHMEoo3dC2Z+bmj5Gn\neNknSRzgNqCHP7IJvS54lYwUNWjsnhs/y5REOsn4Fnuinys0C+Rt7Egf1c3k\nz9QD\r\n=bGNr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcz70cvhyDzsJvzDinoysdJn7iPcYrP2JDjAEMhMt1zAiAH3QWQAGqX1jFLXbyw46YRyosNkN0+oSEt8t0raHB7Mw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-master.20190411084059_1554972212244_0.24759880736064055"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190411155743":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190411155743","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cf1429fe612d1af09681cd9afcf2b986c07b076d","_id":"@atomist/automation-client@1.3.1-event-queue.20190411155743","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-nkuWhxCDET4W0ooOldQfZLaxUIb5RX2AmATq7WzTbVHJbH0ahOypbBI9BngWmVv+kkgwcOjK6SypDdHrul4lsA==","shasum":"4f01494eac4f39e8ca840d84ce11070d55141c46","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190411155743.tgz","fileCount":608,"unpackedSize":2919292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcr2S7CRA9TVsSAnZWagAAH+YP/1CWwQ8Om2Qwzclbj3F2\ncj4Dpxlc7ZeL2jF4WxXN301F5dmcQ8Lvjx1U2ebXmrSM/pN5JWMuvW7wiff+\nun+wwq0NAQwa+e+R1ECKNGYuXai4JbifWRUAT0eB3OFOA6T+RV/tzXFXBEGx\nKWiuWiE0Yf6WVgbRCFoXYwS1QZ8YcVUmwBjUpWcjxiPs7lOwwkP7TfsCSz93\nA97kBFfpkpumyuhXUX2LilBTZAcTFKciBaPo/3bJGF2G0DdyEDQih25ypPVU\nsmP6VhVnOZglvjG2dKSrwSTUY6aanGzxToH96xctqTGWLmZffPID2hb8KgQH\nJHYHy3QAnMNaO1s2oOaCPGoGKqop3k1HmG/MCN3XeyMhtWkSIR9P2IdoK9i8\n/CeTwT+B+ONdVwXKtDpSxIKjByi22wbj7r+Z+qnJqFyoVKj30IizjKp0ipsi\n4F64NT04AYpO+jz+BIKdOKV+ms9PKMJ5bQ34VooHRgTQc1L0DCg1bgLDZo9u\nOhmPvzWOeAh0B5KUtdDlzBobxKKVAnhqkZM1Bylv4YanqtW5HouRI/0Ig+Hi\n7OL2xvMMNPlMyfm2TqZtoRswvXRnlKlRPakBS3gtLLNu3TzvlHWEjAMk2m5W\nEgK0th3gQGKVfensozrYoSAko1QyOVy4vimt7Y1jpnVGSSj8ErlIZVIk3nB+\nY10f\r\n=ueWO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPSxexSza7wniJrgR5wH2tDUPJlkTAuksr8a5oFHPGkAiB3oZGJb1ALQLZxS8kK95kWXx8lG6NZPfIOYT/oG9G6ow=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190411155743_1554998458362_0.19000896017538338"},"_hasShrinkwrap":false},"1.3.1-event-queue.20190411160625":{"name":"@atomist/automation-client","version":"1.3.1-event-queue.20190411160625","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"64cf6b7e4cf31cc3d258d753a7a35c17123d033d","_id":"@atomist/automation-client@1.3.1-event-queue.20190411160625","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-H/26Yp8RTBPDzt46SJngtEmR71EcS9Gm/JeL6iVnyR1zctzpWpxEPvMKTHZ7ljHh/4rf/NO/U8Q6S+X/3lw/tQ==","shasum":"d32e3971dc819a02c5dc0607ecf8d4e9bb80a7bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-event-queue.20190411160625.tgz","fileCount":608,"unpackedSize":2919292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcr2a+CRA9TVsSAnZWagAAarIP/A0YLgsu6xc6bDSgXWRS\n1hn0bM3agM3UASluBYQ4hig5cYLnXM5FXJxgZeRkfJ5OPfEMGsQS6ir6QSyM\nDn/gAgethfhoL3fyspTN5G/U1VxpLxS3UEwh5mvY047K4gJM5fKD/Wt/gUGA\nDVGI1tZJ72DiBngmes15diFOAolZrtQ8UE7VM9NV3VFWFxluHVBe3A8B0Y05\nRaJG1SInrVjh3nYgViIXLrFK0BzlAH5VgkoGi+N9aBd8nJlhalVdkSwvAMew\nBM6ymKyUhQ1GvN6VPDYnVppGuuYC2LK23T0kTSpnuHaG9X7/0+flAmlRoX8q\n9T5/Ex/qR9FME/inPQlroSD8B0V3lnHvF3Hk8T6AyiR22qrESU1g5h2ldy3p\niV0ulblCqBlvX6xZ99ouPKcW5MlV8j+GnCjLz8683I+AfjSh4fYdnjGiM7zM\nhiSd5MKDcH9YDoIeCwt8ERToz+PNAbvoPowHeZ9zEGjmARyb026EYkRrpRpu\nDKU9zUwlpP32qS+EJt8c9Xv6j0sbXxTZlPa0Ii5ceEurU8TFo9toINprFq+3\nugsyRtbSqdo2d4jnpW9JVXha7ATwykeE6Pwa/c3MLwooUuRmGJpHzFHiX75X\nyysvNoJhksUSuWrxQd36iqUTDl5V2h/kn7H8NHfiwfrN3DX0ov9Njx04h/uu\nwh/u\r\n=7msz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCj804YcrpInnMJzplvRrSwcjElUOfZ2eoAIkNvXY0DQIhALqL7iys2veyhJWTINbaz36ojDbpYpbR6GvD2XPzKACh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-event-queue.20190411160625_1554998973523_0.08239693369676182"},"_hasShrinkwrap":false},"1.4.0-master.20190411165304":{"name":"@atomist/automation-client","version":"1.4.0-master.20190411165304","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"52e990ee6cfcfa77ef29c786758e9e85cfde3934","_id":"@atomist/automation-client@1.4.0-master.20190411165304","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-A2S5q25Pu47pRBaza0unxMO1IDMi+4Iy3TAuJGXySmyYCxlzreHJgaM6orWOZkS6EVfkBMy0Otlt51IBML7yLQ==","shasum":"17450f7908a62ad0907bc89ce4381599465bdef1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.0-master.20190411165304.tgz","fileCount":608,"unpackedSize":2920810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcr3GyCRA9TVsSAnZWagAAa3UP/2ZfiFL8wbXaHUNpj+lW\n7MpHvjrRlPsyypDioZoOOy0MrInAEHQQCwdaROcVaEWtfaGZtreeWfil7Tg9\nY/JBELSoQWK0xU/c3OsMSUuZaF6QJia8G+cA4Kz1NSvGGDOecxqtXDakKjbi\nz76REncmScm5a40NQrLJ0NdIOGydAG/e0yMZkeXjBoKSVolLNWcrVJJvSN6i\nciQz4+iAF6BRCIO67Ac69m0IwVydk+O1xhvzfYjnasl+1z88BNrwu/cCmUNf\n7vCALx0O1crUYguJ3etRD7eMjXe7+if0UjCSWmgd/j4sON3Bp/k56ZhNBx0d\n/yjx+pyV7UKK3csL4pRIoRY5sJPpwxee2BDGjAWhePABzL4RTH8x922+Pjaj\nuZrp3reJjdjtyekHIjLl6ZREWGqbP5syhZktN8vfPGN4effgCRnnUSVs4/Gn\nfVZE+eVp92d9E5vXiWAh7wT+xG7wTDyKeM86WAqGjnEEHGV8OwqQ85fraeZk\nxl9qO8VzQiQO8QhghVmwTaBYu+Xp/N6uB5kRHxglocwf0dFEp8Yd65Zdxybe\nn5P3qqWH0FRMDQyFH1WrcnJEOZmEX8ykCFmn8dD3GGiUUrCQTI6Okc+eKIfA\nR+9F1+s2X3neWsdnmsu49ube2sufpJSs3ofGW8qXDpEUFthvhpngPshPLg9E\nYntV\r\n=8f3g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcgVIoPvH3IJvzOm0YR0zG03/SXZxnZgp7nctbHKHfYwIhAOqPCv7jY/2WvQYHWJdXII04f/MR4fNWBQScCSvTRx0O"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.0-master.20190411165304_1555001777911_0.6684664640888769"},"_hasShrinkwrap":false},"1.4.0-remote-repo-ref-from.20190412204940":{"name":"@atomist/automation-client","version":"1.4.0-remote-repo-ref-from.20190412204940","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6140203c75b48cdbc3adfc40368ce547f7aa58a1","_id":"@atomist/automation-client@1.4.0-remote-repo-ref-from.20190412204940","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yjg3Pryls4+dAWQ7EptdC36lEm87tIfKIO4B7W85Ky3U4sGMLeO+Fj++rMIxSxlQa/kJzThc23sXT3AamEYlqA==","shasum":"5452f23cc9138327aa4d0ecedc4f9a7012d96df9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.0-remote-repo-ref-from.20190412204940.tgz","fileCount":611,"unpackedSize":2926211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsPqMCRA9TVsSAnZWagAAgowP/1ham0sSbKRacWsVeQVq\n1+lCk/CLkSOh4uD8ZAzTbXCnTzgm8umvFfBTEXKufuFUilNF7f9uy4uF9XZx\n8rQUghbKI9fbmqTpPVYhaYV7j/59gz+2fz5njcBCclkdqwy1E1Xj9Zx8p8Vj\nHfi8sJgFFG3wGOWcg4RcP6r4oXeN76lHrkkVRkRR3K5Qkzv2/9QaDVUR+7g4\nwEutcvNzz9M44NMLKb4yDGGMHyduF8WWNeFMeCBzEVoeiBwD2KBisLKpvo9e\nbGwJJmtY71soZSUy+A891C2Ycd0Q+UT6sdBSYQf9voO+UHsRhRkChbzRFGeO\nXUxTu8GC8l2RgUAYLuX/dKbvgqfguLx8XrylauWvmJcYj1kxTW8BVPjoDxhf\nEPM3dZ9GtI7KqtOXoYLkmB/QFYlZRrA6CIre7teuAHTZkglkusbl/8ZR5Aq0\n4sxz3QpAKL1Dy+GaJyst9ED0peOilAJNbw478JqnJvyT8m6CskQ7Ao2id1HS\n/jHXVjVTyxN8Ssd9i7ylzL+t9gFWKpMBySjsxOjN9r9eHQ125tm2UdST5ev6\nHI06X0pnXVJCCmSqwBKbxmiNFBGjcV8DuKlUDgxy+qxBB80r7m6WFPCQK9MQ\nzV2lzgubO+4JlZEJbXlSY3s5cDZPUfN4JfswW9gbeXWYe+wQHKko7Fmmzlen\neipz\r\n=WW0O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICtHrsjIMvbPRXCA/GvHzV85Adn3o0q4rprqnJb7/MNVAiAecUpq3ipsoAOCC8e6MwwgrCtvtPGSY81U4Pq4m8MdAQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.0-remote-repo-ref-from.20190412204940_1555102347645_0.7533234712908727"},"_hasShrinkwrap":false},"1.4.0-remote-repo-ref-from.20190413163417":{"name":"@atomist/automation-client","version":"1.4.0-remote-repo-ref-from.20190413163417","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7a3dbc801830b97900356d6043edc88d0606d801","_id":"@atomist/automation-client@1.4.0-remote-repo-ref-from.20190413163417","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jmRrwZbk2pOtSv0UhEiyYYVuRHclePvqEHJ2ESMZYkg3owXR+HsoUiUeISBToUkXdZjt5pMVyoU3/eLIeGQRaQ==","shasum":"249a1ac8538fafb2dfa160b0533d60d9b3987117","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.0-remote-repo-ref-from.20190413163417.tgz","fileCount":611,"unpackedSize":2926649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcshBBCRA9TVsSAnZWagAAPP0P/2VAaC4kjnvEgdE/KAuC\nc9eaB36EWy9CcytRJKokKfdTf9kWGF7BEyFxarPmRbhDAp6mpBUlj8tmbsI1\nSkgHUodzvMSr9F3msCGstExJFhuDfZmiX/wnACgJe1v9IHplpPb827YeG7ld\nKVvusb3gE+RJ1ZUdKiH6N0RC2Q8VfZJRtqM74DO1phbseMWSzhtHNReZe0MY\n5+3RspxiXXCSaIbCjfT9FmTDygMkTK2oNjuvLNNz9cUR+lcE7xygDoZulkRS\nM+7yEkIVnyyF1IJOTLUQXcqaMLz7cZSeiPG4lYj5UkK+cDj8r7i3rNEGRDkk\n7WsOtjl6+sJpM8FSpQPWQ8Yo0Vo4GGfasJNqvSCzXEWa5a4a5XFulYqdi+ZV\nDBxNep68A61/gK4EyyCDVlCbpeJqCypnbtP6g20gD2j9tz0TubJrtPVjyHOq\n6QrvspXNEtN2R1tnWtBtZJ/qgLrO0/eQXAxlynfDdo9JOGCWd6LkdTau9khn\nuaaE/5YCam/Dr7bWUMWjkVHgL/XMZVP4bDhMzsZJYimGwOAXZn8wE9HU3bHn\nnAtclXISa4n+/ByYzBUTnxJwnXxRodxvFlDcDdLofArrRrM2Avc9sO75WBNP\nzz8lkSrrgxXWBTcLlfeayFvk4X0NuAbwfDmliqOxz2z6QURcfdM2f/eZoh0d\nvMaF\r\n=GFjc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKM+++UEJFBW47wWceRbt3vHOnm1TAPVje2E3NNjlZrAiEAp56mAdiIJ+Z47gRE0IVWoqhp3z0Q5np4oVhfVY1ICnY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.0-remote-repo-ref-from.20190413163417_1555173440879_0.61823113126109"},"_hasShrinkwrap":false},"1.4.0-master.20190414192617":{"name":"@atomist/automation-client","version":"1.4.0-master.20190414192617","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8be8f4fb120247a7435300749b62899de4cf5cae","_id":"@atomist/automation-client@1.4.0-master.20190414192617","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-0oqn2O2hJZ2D+N53yQUh9uj/XlF6JpLFkyhC6BbEEVPN/1x9/5hyd/AUln7tkZcRSWhmZ/SX++xrBT+RD37AqA==","shasum":"99702d95b05ac4b763d517da9d566b11baddcab6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.0-master.20190414192617.tgz","fileCount":611,"unpackedSize":2926755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcs4oFCRA9TVsSAnZWagAAVhgP/30Qd0l7Es3u42pOVnqo\nvs37kOzkrWOXdclbP7KFCNqIxTZpegTucFnw0H3Zp/ydkkKd+pDN5WBDdHEq\naU4wh45Vs15Vrzwy0VYkndWdb6D87jQXSJIMfSO0io7nAyZSdUkK7qS9SWrB\nvyPfJwrpTkMsT6vbyeOBrokLMdgDGwdX8W4k7QYPC0aRAW3qEdbnFOHSO2Ye\nJq8hdt7GvW8lsCD9EN4bpXvshkjyTnpVlGosBJx5LFIhn9H3t6MlE1pa9vp/\n6QCnXAPxYfmG9F+OceTjTUdLhQ3N6YMF55qM7bcSEtM8XDemvVxcu6J0sk9r\nAGRyPiO5yeNGkkMCG6DonqZt+WYRm7QOd1bymFYFhMgOHVGd1sF+O2BrHnbp\nfw7GO+W5/5m1fq4ZKnZi5yhuXiSmc5Dy3ZGVvOgCpgu6Z3GENzIdKmTvQ2D0\nDZKsuf388wpufqEbfHYbc1P+K2WRuXdJbTJ9U2YqhRBkQ+WYa63EjrpriTwe\nQzDuglIGhQjXKJDwvn7SAe7wBPQeWEjpVXmZGszoottifhai+hmrhQNjgc16\ngEkrTGCYdawdPqWnyLyj5y0rjrycMgIfzJck921d5BKWnJKwwTwhjslX6zj+\nKIk/2DpkJOKhXg5g5/8C5qfs9nGGUgAsMPmpwchdV6HWYQSyi1ps0KEfL0o/\nnoRN\r\n=p7AW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzQnf6QaBA5SpM9583RgzbmMuE0qJpzLx8am/TwSORrwIhAMxFL8zdB7gY0a4kyX5vrtLliKJr3xhZeq1bHAj8QK2l"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.0-master.20190414192617_1555270148765_0.5573913027761921"},"_hasShrinkwrap":false},"1.4.0":{"name":"@atomist/automation-client","version":"1.4.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"54b8257b52c8ee0f55def8905feac8e115cd2a3f","_id":"@atomist/automation-client@1.4.0","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-Gv5UBovPnvDQh5re30iazuuxFh1YB8JBNk2lUC2CPsQYH+La22vJzoT9JbbPy9KlL8pEg6v9tam9QxBrS2Vrow==","shasum":"47006bb38254aac76b1a581c435bff5e585b895e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.0.tgz","fileCount":611,"unpackedSize":2926733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcs9DACRA9TVsSAnZWagAA4I8P/0te2ivV3ma1R1uNR0eJ\n8SXi1Vit/0wQ4nxC2XO50+1gPrDfK668Gp8mGFhfL+jCBVxgiEEkErvfvKgE\nWThLoCX/C3Ev5mizrAvedbtt25U5T94JaBwgObZDvNZH0jus39tPaHLazc7U\nhdSd9NpQE1V4k/rP2XI7EPseQGL0nMyGP62BvP7EfJGd7Ys4eenU5Afj0Z4a\n3N0z1CKK0o5Hv9kImajhC2KXoR3Wlx/AVZUe7tNhtV3EiEcqGu0s5sAa+ZC2\n9b9vxlMoKAUAFVajqWnv3F1tVcQeBNug3L3IqGaDoAmPqSvaPUMGQSg8VU4d\nLJyARla00vpbb80AYzpEBaOlIQN2ghy3szl8AjD+jaNDP4anhpXCM6CEvEVF\nOvw7QwhtDUqdRDKTU2z6o25SP7Nmvmxn4uElxO2tesXcchGAp06v9rFfXf9j\nQs+Pfnd3nbN2/TcSA4vhD27o0H/MgmLqrz1q7N1df8MILs5L+a8a1WVjI+tu\nQWcXEL5h2wdEGsWsZDF9LQUKG+AnXjRjUbmtNMW4Kx5T98eIfBHo1/pfgjz9\nFn5aL7vTW4bz4JBTfrnsgb/VqYlnSyWPRcFUCopmC32+kYT5VznjEpBMJvmE\n4u4rVCezE2TuqvOFlmfFPhnQ+X1keNWPBRoUTZUyNMT1/6PU+Ifk9UmW77Oi\nqJRK\r\n=vOFj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBnvg++L/6Nik6hoXxfsjwBvJa4r7ZcQ9eO+3Gl9aJxxAiBEfGFOf/UEX7UbhcnE6/PVBPXI951FS1eLmB1NTyenwg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.0_1555288255158_0.42179185181846535"},"_hasShrinkwrap":false},"1.4.1-consolidate-tests-516.20190417134143":{"name":"@atomist/automation-client","version":"1.4.1-consolidate-tests-516.20190417134143","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a6d19d20e323988e5aadcf6349143bf22847f7e0","_id":"@atomist/automation-client@1.4.1-consolidate-tests-516.20190417134143","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-TNjkUiZUk1VQhr7Lho+fNFh0jw/HjT1zVNHE56OOJwCBX8lDMTBR220ZMQp3kDrNAPXIoFlC6sf3jqW7bGvIBg==","shasum":"c57766160cc72351faaacfa74ca5b3c32292a2a2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-consolidate-tests-516.20190417134143.tgz","fileCount":611,"unpackedSize":2926805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcty3zCRA9TVsSAnZWagAAh/oQAJB7Y8i2bsoO6Fl8zOtK\nbW1rvgoys/Bi3N/DptAVx3jl+2PaGFug2qibqj6INtwZ54GH8f3SQ7M9Kvje\nycUe2KL6hTpuBcAzzPg4NCLlzjAKtPVrO1vYCMZmgMZhh3Vn18h1sHlReCz9\nBB1dZpflU7RAj1FouN5PUNeACbR6XywvaZ53GhtBqe6/b387J/65HPk+ujlE\nHIF7q8qxf7nXSi4IFUinXJkSmPqJf3VdSZLLdbTDuMv6lV7S1kCzDilRsPjk\nW+RxqdDa6//3pk2LGHS6id9Rcy83R7ZpnmTDrBVY+kO8QFf7U5P/qP2O2Kj5\nvzTDbpptrdEMKiG/epvrN8IPCuxJDmn+JzYTRNqwijUNPUFzl/J35XeXvOov\nI1/9FT3BXDqu4DzoijpzPlUM/KCegrp+T8DSZW6iB388g0w8p+kn5AMB/NUF\nI+Taqq99wgm/lVwfRUz+BVJ4/71GxOOA91y7dCoQHIkrPLGCaLyjB17B1u18\n2vxdVuFDrMuYPahbOzjpu58aoke4uK2uswzRbbWC05UfD3kuguSpj/vUfFDH\nEFkYaAabUqVa8B+JK0gUigS8ADA3SfvksMX4dhya3THsW/yLgB9Lnk0oCQ7Z\n4Wo1VeKFIRj8ZoH8/Xn0nlYeN+DB2W6QL9DowmE+Ld0vtYltnhNcnpkfaDRb\nSF2a\r\n=RQXm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAublkqo7f8lLAmZk74L6a6usqIaSKut7JX9wqBIvB3LAiArGxDPDpZhFju39LZz/Xcgh+r8g8nqRZMLeZmfVHg+Bg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-consolidate-tests-516.20190417134143_1555508716426_0.42380887449996196"},"_hasShrinkwrap":false},"1.4.1-remove-remote-repo-ref-from.20190417141720":{"name":"@atomist/automation-client","version":"1.4.1-remove-remote-repo-ref-from.20190417141720","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d675b351d164b52371aae6b5b8e88cbad9aec207","_id":"@atomist/automation-client@1.4.1-remove-remote-repo-ref-from.20190417141720","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-gmk2AunYJaPPNVtk4SUZ1NDsY0wFTWjZA0Wzy3u7setNeYXmEkc9scwyru4zgpsQ0xZbGktFE6KKtI2/aJi8Dw==","shasum":"5a6b8fbc52a05b6a5e1dfd9b281513010d2ff0a4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-remove-remote-repo-ref-from.20190417141720.tgz","fileCount":608,"unpackedSize":2921873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctzZNCRA9TVsSAnZWagAA0MIP/R+b4LOkkEeq1rKCbC8C\nvKCl/TF9A4RnO/FC90HDay6fy7P17nIFFNoKgaHMQfzXJ6PJpYREiVSobxM9\nE1uRGy4LjCoV7oTBFkWTnVXXTydMU4Ju9dOpzMLy8yiyHq7wlpdgf9coI51s\n8IbRhwZyHnOLWCiYwtAaTdHdJ/Px/zGAjZHSh7nqPCI+vkRNnrG/rxeLEE/p\noSZTHUXAsvLz7yJIWLC9KTOsAf/AiUFsVJsw8ggG+Ov+cUUkkgSBQ/pXV4FJ\nI3UQi12KZiK91raI1OyfLK4CdN5FFX5ZMw95iOhok/2ecoGuXtQOwhd+qopF\ntInHCxW+QzX8bGGmRy8nE0FeWDSgHnjn6U9kO0z/qdMbwMpK2sI7OYYwEWjX\nFgdtBS+dPvIFy1iPMqtApEfhFzIhHxtQr3SIOoD/pTEOgUlnpIPBAIwAFoJL\nyaKTILIR3tUMiffrB6VMrvL0Fjj64Kuz4xVSygeXPcgYHRpZvMwazawHJoWf\n6x02I99P+cP2oLBsq6avxdrwDYNXKqbZzLmPT3zDOthfftK5Wx4ck87cY4mc\nuoccAW8L7KH/n6CrouKwAHDgEHRSRGJu2mGOvNE+La1DXoqp9/DTWBJzL6l3\n2JNCPoYOQu1ZDKTOeHnIMwzfOI2HOliKXsH0G7ASSugaPzjAVC7v7MyyUo1e\nZrlm\r\n=xpRp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlN1jVB9M1HGj0SEIFr236qo4+Yi+YDumZEuAuGuo2GwIhAMkLVKdh0fM3Bdz1Gdg2DUdGajGSEdAycakkK7HNy+4S"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-remove-remote-repo-ref-from.20190417141720_1555510860994_0.7858403575303614"},"_hasShrinkwrap":false},"1.4.1-master.20190418153447":{"name":"@atomist/automation-client","version":"1.4.1-master.20190418153447","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c219e183f98f89318c7f8cf10b2fc8ce37e4a341","_id":"@atomist/automation-client@1.4.1-master.20190418153447","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-xkvoypYOGoh2wiPRhT1u79s3D4BI4OY6P0oK+tBK5fhCLrcPzboFLPQKiDK55P4LzQFZNqedDjmDGv+HVcTLjQ==","shasum":"344b95d5ff1f0fe2254caeb41c3aab0cdf81e8b5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190418153447.tgz","fileCount":608,"unpackedSize":2927484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcuJoZCRA9TVsSAnZWagAAIV4P/0yc1lQnkHdwG4U4iq9G\nWlPtLriTAnTIa6qcBpYSYbj9rOamPPq8iexRmXuakYx0yLSZzTzj5y66HPbn\nB024M+wW73Q84+m+L/duV2B6tPF3Y9SRRcU8l4nsusiwPMPCfCRxYHRyJ+Ao\n+/ayiogcuNQ6GjgVlk/L7S9ujWSC68eV7kBRd7z/BRv/ZQpP70LeLS4noVjf\nQV9g5S6uUFPGJB7hea5F+2Vhxjq/N9ne1tH6EP6z4iM12IHXNAbXXVelqvdN\n7mDBx0Fbz6HggffL4xdoOvoGGNYLKyFuRfb3M0kqpNrMvPte4P+F2xlvQwh6\nHUE+TrF//koRAXFbiMWrXpfj6xQm0EZHAoCAH6zjqE1MnGMeA1DY3wSdFMFW\nhqOCSkA+sxSvXGShrQnjzdMgcVUOAfYT7aCZfFgU77vLSaDwpUwoXBOwpbTV\nOKRiLl3Ik4NyVCXPfxbaiShNsD7OufriuLfG87WAhTaNRCuyro7n5vRLA+gq\nmvpQ/yAix03LXKh44AKE4ag9HiiV70T4nvbao4Ilv4il2WMMiQEnjmcXe6hY\nvg2TSzlI/uAQPRAGJcLn6SFJ4ebeEQ/YFzPPM9s8nTKFhg2JgvsOzNqcxwsy\nm8DGY0Mh6jI1cbXAZOJ48+wx9Zf3tf6riIkpuiHmHFgIL8PWznZJv5nExu7m\nEiVz\r\n=nA5C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVnWDBR/IuWV5G9qNtocxI1Xrqs5uxZ5c0CXeu8cMcYAiBojNDYk+zKDjhGNLqVYcVfVddUAOxjGv5gpi9NWX8w6A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190418153447_1555601944210_0.25212176211331516"},"_hasShrinkwrap":false},"1.4.1-master.20190418153855":{"name":"@atomist/automation-client","version":"1.4.1-master.20190418153855","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c219e183f98f89318c7f8cf10b2fc8ce37e4a341","_id":"@atomist/automation-client@1.4.1-master.20190418153855","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-SMoLsFjMt/0+1w5e62BzZ22pQbhubE2TG8nuceT6rwbRIxOBgVxm4giarZnxx4tw1/ckGqSZK2K934TmrTYkbA==","shasum":"c313bc4a85dba436c40726c00b288a53be6d2b51","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190418153855.tgz","fileCount":608,"unpackedSize":2927484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcuJsFCRA9TVsSAnZWagAANSYP/iNYeE39A64v6RBjZbLk\nX4+lL0OO4IeOz9fPVG4nDZ8E73ttwt/7/WTlth9VgCiPTjRVceHqCk66vk3m\nPEqfC904bZvmXcGi9opDtl2tk7Ur/j873Hp7meT38bU9P7cQlEZRCyDHiK1T\nlcXA9lk1b6xa8iUSTIPJcbBUhdxR1ejTr+S6uwdwpWdoWfF11i60dZpVeBEP\nRIqjomQk46jVrmVbE2Xw3+FSmDbSYbA+8+nixf79hhCtcLkNLVWJ5QFh/eq8\nfQtmI1boaru8ZYM8iKHjdNFULHykwxsN1d1Ylfp1lwpQYMl+2qzCa7FdB1DC\nZhnguPBm9uV0G82OOea4J4CyHQtQUtq9VmJmNoTwq73Lo3RNBlFesqxa02QE\nDAY4lCfNPglk6q4z0qs+6TVSOHgbedMa0edrIQzBDpXRpvM05R2bSa2DCpID\nMfD7CROIUkZrkxOwbMO5zHjxjhu5YxW7toi2PzWKXsSXaKb/GvXfy0WBl/Gc\niq6emxV9x1loMK0xceyWSPbEXF4had36JvRsfLQDaJlXPFd3sKzYVjjEgKBR\nlIT/LJ+obqcfNwnemwlyjzAaGVHpF7gm7XBvvMWHnIQEZC4s5xgw+wH7dSDX\nLXEES7/EfEzqceG9xadE7tc3Edzq+ePnA8oS2gPGggfGRi6gpqUeN2gQGMGI\nmo9O\r\n=vcaG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTiVUdLBGaIHFbzlL4UUXsjlRrrAMzdgZBwneI1UG2ZwIgIavO6/xkaE3dclu7XX1k8wQBNDHZXf9CVhbTQN7l/AY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190418153855_1555602180919_0.1332826245032006"},"_hasShrinkwrap":false},"1.3.1-update-code-gen.20190423221858":{"name":"@atomist/automation-client","version":"1.3.1-update-code-gen.20190423221858","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@graphql-codegen/cli":"^1.1.1","@graphql-codegen/plugin-helpers":"^1.1.1","@graphql-codegen/typescript":"^1.1.1","@graphql-codegen/typescript-operations":"^1.1.1","@graphql-codegen/typescript-compatibility":"^1.1.1","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test test:api lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/{*est.ts,!(api|benchmark|bitbucket-api)/**/*est.ts}\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*est.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*est.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process clean:benchmark","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/benchmark/**/*est.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*est.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7a3570358f67b3d1e56cacf0834aafa10da994c5","_id":"@atomist/automation-client@1.3.1-update-code-gen.20190423221858","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-JMMrgiFyWdKiCaj4Za2ltxh/BGlLn8vZ8ndQFaQ1QSuziy1egim5CIqbZSX1LQancNHNxbsra8v+1wI8BvUlZA==","shasum":"9e94078e170ddebe8cde073b626257f7e21970f1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.3.1-update-code-gen.20190423221858.tgz","fileCount":608,"unpackedSize":2909963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcv4/kCRA9TVsSAnZWagAAnccP/RsfklNuGboVNWFllle+\n4qoOKhCoeCFnglHW/Nb4fF43l9+za58VhCylSIL2FPXCqs0/NCNrrwnvJbTh\njI/zRbgajOUBm7XrOjgx0WBfoHQGRKXEwJHzMuaLMfCilq4eGGFExDjz4XSN\n/x2FDeO1bmKxEfItrTZfqUOHBLgObNc4+qVmuoj5RbEsCl4ie7HfzPEDPuMR\ndn/um8fB7c7rsPCbTDsSVDWwCv2H/OOtKWDXDWyF3rv8LHJUi01MqQtCj5sg\n8NRdLKiBcsuj4AAevHXZJcljTQmvU2qmQSqdYuPUH2KKXYwCWdQVQeJR4uBH\n1UooiYcgBn5mdngqbDbUUAeqnYUvs3NgN5xPURodDdyn91paFEHQPhiqnCja\nCFIdho+ytVkbZFIMU1XOSwh1UoE89DjhVqBF5xN9pRQ8ZI1wIWfKIk0CrGWm\nT+vUFWdmwMoFoLy21QFkVtgxuzU9gM6nBba/rybTSOQzRj5Rm5utRfA3jJ4E\npVMAbI6PK87SLtUmdc7/m7rbeQmFNsZRCLU0nCDJa5qXeynH/eoNhdjXQ0pP\n0TMKFdo2LzKhfIdM5RmODE55YJa2cFsqmb5HadhXAW7qJGITjDGtHpiNoBJH\n4JylX5APbtiSN0mItCkI4L3kf8Jp42vf/6fdgYtSwnosKDZYA5kDBCRBtoJJ\nhlPt\r\n=G2ll\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/qzDZrY808be5a8oBiEaTWufcz8+GINRQY5FbzPyEIAIhANRt7SEmUelEYg+bkKlFHAWbSmPKX1326xFkdxcr7rLI"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.3.1-update-code-gen.20190423221858_1556058083555_0.10767359506242613"},"_hasShrinkwrap":false},"1.4.1-add-static-bitbucket-reporef-builders.20190426133531":{"name":"@atomist/automation-client","version":"1.4.1-add-static-bitbucket-reporef-builders.20190426133531","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"776942602f531745d0515568d92e5c0a8e99222b","_id":"@atomist/automation-client@1.4.1-add-static-bitbucket-reporef-builders.20190426133531","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-z3e9mXolOEHQmdHUFl4qWdnRr6j0NB6Y9Pg9ipiQax7k0QbRZFd6tSJ0XPegGdywd532XP5GG3xfvfDk2K2AVQ==","shasum":"f2ffd937bb2209f658d2b5e76531f17fd0f0c906","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-add-static-bitbucket-reporef-builders.20190426133531.tgz","fileCount":608,"unpackedSize":2930218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwwoeCRA9TVsSAnZWagAAqIkP/0N+78ZJ3VdobDXpVPqE\n4rv/6/AatHlv9ZIVktC185QrB+sHiaWZ5zj7+p3BDJfkV9Yc29g1E25t+1xl\nt3lpGmBrt6Cokbu+qaxR3nVy3G2ZXDirQbL66pA21ymP2FJUKvx5caEbKeKY\nI7hEV9IwWsfmhOA7Ms1lYK2Wh1EcZRX0YR4yJh67xnRqwYvzF9Y2Hy2M81fo\nx1qdECGg9n/5fMuksnHSRk3lqO683+KeO4Wt303oVAg1nReSHIK986reSQKx\nx65j1ILaxvLqMEgTWy78kJz1A6Lnb15Hefer8pwyDg4bjD+a6rGyzuJIogr1\nEldO7TA4hn59CI31XF0iTFNcG3VgM747L7szmsyxy6FCatBenN4vkOUzRw9m\n5eL+BR6iG1xvzJom50iVmktyFLTt/eRuKiDpNi+LYpOsAciCMEuJxvJPjUC6\nLIkofiTSt/mq/uD8F2NOzrih1s5xlYMPTAs87U9ovitIkjHUWdRGFb1KoK4D\nLwX2f3j2P1UYUWKvltp3Tup/EoFQxf8BeJVggBmrY0KTjqZwDG1k85pU4H34\n+HQdCgTASAG8bdTC5wSY0lyY3h0SBUXNEkwVEAO+bq7AOjCncXoTCaIwhQ0a\nEaMtwfkeVYU0K5p3Zp50iK0UeKduBHAxbXBZXQUiEWyLKwsWCuGJKEWV1w5u\n7zcu\r\n=VTHC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEopm7FRueBo6mIJVW+N/JyJHLc/8L2d/Ic5YfK2ifMAIgfKlQypJ83eibUCmuqfQOqxW3bzvwx5aU7chKq5rR3FQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-add-static-bitbucket-reporef-builders.20190426133531_1556285981709_0.23114605603199623"},"_hasShrinkwrap":false},"1.4.1-add-static-bitbucket-reporef-builders.20190426134327":{"name":"@atomist/automation-client","version":"1.4.1-add-static-bitbucket-reporef-builders.20190426134327","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"776942602f531745d0515568d92e5c0a8e99222b","_id":"@atomist/automation-client@1.4.1-add-static-bitbucket-reporef-builders.20190426134327","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-qGpk/5AECynpnBp1KgaS4ew+ghl7BVgOBsQEiuj8bu3noxdjFCfoDlS4uhBuWS+w6Z7QiIlnbFYQSnjgikfWDA==","shasum":"105765e36122126d900ed193a78dea3df105e8b8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-add-static-bitbucket-reporef-builders.20190426134327.tgz","fileCount":608,"unpackedSize":2930218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwwvwCRA9TVsSAnZWagAA3jMP/R3x5vz6F8IbJhq4XVU4\n7Cz1EaXTjIqM1ftv1mC/6wEHxq7bJN/jxW/VuFWcPQtlRj9foefrJPL2akFP\nrE48LUPKerbWyhPzNojgr0LjQ4ESXDjFjupBixJA2bVjsb8NEnWHlLGS/IpO\nKrPvbyWCPoF6zjkaqQfGDbroBpVqgB0iijT5W13QqDWeWg4bxnm2Osws1a7f\nEkBLOdWyU2CVb4o5paU9bi+ZFB/FuZlTNDigD2SWtLwu5meVwtfbhZAYID2B\njgo9iX7kKkKvrb7X167jOeRXVT3FO3P+YKi16a+dmxbIWylP2QSfLybcXNM7\napVbddDGAnA9RGnWQnDqtm9VbbBJ83LG3Of9gxn7qlSzm6xxveRCULkJ4Jz8\njsNyWIHQg1FlYtCEsMuaO+AqFY8E4KrudOIcjcc0o+S8OspBL5uMOBXCLIJY\nfF3ioywa9y9M/QnCcDAdtaui8Irlcxnh+N/ePQihRDs6tTZZgzMDPH9I8T1D\nHyWxvCA+uR1RFO/CL3iqEWaU++akj46SKegiJZENQEwEgWy32nehgjNooFWe\nw6K6tpeMEHdMOlZY55tieUwOwcuqnewqg6WqFFsaasNuC5t6H8IbHN52A980\nRnu7NG0Cxe38q0H4HCN2x561wgmaZcCE6DOOXAiY5I3lAkSgZ0vjgSKyiK+d\nuvph\r\n=ufDO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZzJgqBAMwLIV/u/M2veho8uQsuazsKGAaYA87Lz+TEgIhALeb8LvEfDNqlmGcbyalGC7iBeJ6VdSV0Kium+1qvrp1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-add-static-bitbucket-reporef-builders.20190426134327_1556286447323_0.9269931699054603"},"_hasShrinkwrap":false},"1.4.1-master.20190427104113":{"name":"@atomist/automation-client","version":"1.4.1-master.20190427104113","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"21e94292fc440519b0f9138d804e2b7a64816ee1","_id":"@atomist/automation-client@1.4.1-master.20190427104113","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-2PZR1fK+nF6F0NryvIx+GVDnwLkLABq9Q0zaRSfpgFPdQtUsux4Wf/7WDJtVtfyBbFPK44W5oXwSfm4z7Qa7uA==","shasum":"97c8314fe0e03eb7c20cb5eb8302f981aae35080","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190427104113.tgz","fileCount":608,"unpackedSize":2927557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxDKgCRA9TVsSAnZWagAAcDkP/3PDYda2RY50rkiwUAEU\nj5NsQQmwofhlVjYX38xGlImOKgZs+Ij3smXCfuJR5vZOHPqMF/SKygHSDSII\njCh+EHz+hd3oaGJ7S5Nnwdp9jnjkh2o/GI5lxlKDl5V7JsNCaDMSMVTAC6lQ\nkv1Z+4Oa++9KJvmTQXh/v1cbiat0BFmCBDJHF3yYIt+eDhcna9neCQJrvv2c\nEtnclxe4iKyUo+6wqh/sIL1ku3jCs66/XG5z0+T/1k5rdspJ+qaMv+W9/nbb\n4DVrV9lx0c8DX6/YWp3XDMK5IWlymbfhPyy9VZoeFdeRrRPY2h2OT+OdpSp/\nJVw/mycTWDqrhbswTAFSQXOeLFUDaieok6i18u3Uu5xAgh2nTceAtoAV0S2P\noLsWFVbDM7vlw/7KIiE1A1a3WKXYVIQCVGv8OzEvG7Rksquc3CAhGw4uMhzO\nywcbAFc8qTBIgWR9T7iS3xmomIh3lKHRYJta6PK4uAURUpyE4P80gZCVeEzP\n4P04hedT+8I1A0sJYL9Wz+AXgTxxj1Mt4zFnU8OWHNrIs7VypSr1vxuHVxDb\nUVqjs9qXbOUNon5RiduwD8v8qEOR5GhJ3paGz4G2jX01uOqG4Q0eCMGrJhAE\nMpggDZHaBnS/Oy7yC/UFP20pR57H8D6OchTNWNfS1c15i1SrLrbhPaF5Zzsu\n7r5t\r\n=b+2w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpe9255+Pm3pFM8H26T28BSZQ/FlmgGRvj9/nbCRRKyAiB87McWau9cmKK03rF/aMqxrerQsTEy1kNqfejLvxB6ow=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190427104113_1556361888021_0.5506488893732431"},"_hasShrinkwrap":false},"1.4.1-master.20190427112851":{"name":"@atomist/automation-client","version":"1.4.1-master.20190427112851","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cab8f8fd4e9e431ed68394d7e613c9aa43a75d55","_id":"@atomist/automation-client@1.4.1-master.20190427112851","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-kZe9K+/WkJs2gx9azCCgemUWEz6PXsZPPp6lXrNX3+73OZve8Dr+daRetKDP2d+vbkPslU/ei/RLvwFUJa0UnQ==","shasum":"b57a63281e7671cfcf0126b9a589fff2f359f3a8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190427112851.tgz","fileCount":608,"unpackedSize":2928432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxD2rCRA9TVsSAnZWagAAQRwP/RJcdBSDt6FCoov3GvtX\nPhjjoYWYLlqHMIl8duRVq8PGBBnEQ7PEC08SCISB5l1Vs4VURw3dR4mCUBSe\nJcqKxI16oWT1aLC/lZ4v3+09ce5gRUgyvIWUBHAtqpsjWh4faGwEPkzou8WA\nxrC4mbpzA4nfxsZ+oL2l1coNR82WlsAvtOPGvREwfARpGIVknCk/V8opFOD3\nqUgCM2Wl3zQ+aIFnAx6DLpu/4ZSCZ1SeP2bXz3WzOuA52fDNh+zV19EavvI+\nwbUncdY+tbu6G7G3y3Dfl9D5Gaa7FyyZ8+CJ6ZqHS5FJJaWICiXXwfon9gyR\nY+qgJKHZkgeFY/FmJAHSercBLtpQwc89Y0ZZZL5fE4TBet8Dt2Zp2QtJOmhc\nsOscUD7yGgSpLJGlkSDJo9QBxlrb+o1J++QQukgoBjC1nGTBeYL0IY00lG91\neBb+7ApvPF5mrc/yQQ1t1RqYzmv2ZzIkFrdwoP/DUKscJHFKYjMISTwdM9jG\n+A2KcZZ53eS84bnGp+B5/mfTPYnSIc/RDCtxT6YoxOLbaDWL+BdikawFSV0B\ndnUWM4MOIXCyP1zZoQKgbUnc5onEd96I9iewrWmgDdOmA0IXzAAFamIwZYtC\nLf/cwcAkIK8hBTklJyCmaHDqWBzm1ERSmZeaESdugL+/1DOh/yB1emzYarGX\n3vYu\r\n=8KWk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID72Z7St2C0A3lxYcTPkQpKvDKRuQwMm5r4CMERlC07BAiBqAvkTO7vkp+HghpRZK8buDiPBDLsGOrHnxk8RG+pucQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190427112851_1556364714787_0.3418762180994692"},"_hasShrinkwrap":false},"1.4.1-master.20190427122159":{"name":"@atomist/automation-client","version":"1.4.1-master.20190427122159","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16ab2a990345210e2a85e8749869e800ef763a92","_id":"@atomist/automation-client@1.4.1-master.20190427122159","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-c+/lWyFVDm90wDlp1n36SGU190wa3+Xde0Lp0YrTr+bXnQAXWbDNMDbrSBzY9jPr8niyD/t8/y4hbUKRwhR0mw==","shasum":"8d9a76a699759a0564aaf9c391aa7c2eefa9525c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190427122159.tgz","fileCount":608,"unpackedSize":2928554,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxEojCRA9TVsSAnZWagAAcfcP/iHTG7X7+SwwPAhb+k0m\noAAhgRoZyLtsUJnxnLQoXFoNJSFI9YrtDTmoFTeMJk6Qx+uSpYn7HFQLz+oO\n2SQ8zxgjHjmcCrT1+/QEP4aio4x308Wr9nfxkJ/z30Om181tJ2nuI71hyRt7\nrMbyoyP21H1zd8gs2lbCcjZZ5T7aWbuVMY2ouuXfDqWQXT3EMU957yGCQ7Na\nNOHpbG4V9hSWY2oH0YhyKXT64+5MOlWkkKSmwZJPLlv0c1Q2yyqAmLKxedFc\nqEOA08fDGEBlZqzqxq+es6ab2itX0AaD4f9/KK8DLrcSzyOdhMPVPjy0vT6G\nO8gG7mFDd1v+jvf/2m22x3/lPQlR/dlHfgkPGgcsXoS1Vn9OJddOJD7aEJql\nArD4/xhF98VwcZyM+nsrXLdGkXDPnRoiuZszPYojWNGns5INSlcx5Pvn8ETt\nzi2ObBNpftr5aiWgO7L6Q1iLox3HkcIN3yW0HLoLhVUo2KRV9C3fImXrj5kT\nON4Q4dH2f2fH5L3qZc4k2xy0ZZz33kzbfKII9Oz0n++8HM4I4mElDMr/9HDP\nQcoMsG2oqEpMW+k4FfZ/RIRyTNCKnZA81HDFqkfRkkBq5E6xGoY6GL3fYDmc\neCGzhy0sQeaWxl9K/U+UuqdqB/S4oYwDjxPuJ9880PeCrEp1k7LIDMIRteTS\nW1WF\r\n=0NgB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGOTSwLCLt7TlxLo7Cqz36qigzNIUJzq8P7YBiLxrv3uAiBE+nUtypyRPi7BsVvQp1OIt7naBwtP9mtzwq3gB44SRA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190427122159_1556367906203_0.4646633882718061"},"_hasShrinkwrap":false},"1.4.1-master.20190429192326":{"name":"@atomist/automation-client","version":"1.4.1-master.20190429192326","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"31c72e9af9d0e0467fc6318b27a09b170f4261aa","_id":"@atomist/automation-client@1.4.1-master.20190429192326","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-wkhBlnO4SguY0zwrJXbT/4xWgg7IroPDWrPqB+KWAZuqn0nrzIDssUbwz+XM47f+rDhO7Y9DEqdJzm7CQk3VKg==","shasum":"1e1c52d7c48c877265af04051d009d7400564810","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190429192326.tgz","fileCount":608,"unpackedSize":2929113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcx1AbCRA9TVsSAnZWagAAXc8P/2+cU3u9FKeB3hbYkaHs\nqabQ9+lNvxVZsG9ZoYfGxx51+aoM2MCAtJq+BERGNrLdxFCWCz8yp0Sz2zVN\nWLQDy7uoZEZ0KNzXhSUcqD+NrGEAKNQAVeYxBkDRJVootL7KznATYrzR9tAa\nm3JpJiTIybCNWAOu1pc6t2gKWSKS7Q8/42vF0LHj61G2x+OSy0nMVbVU2nb5\npVD+U23C6x5xNawoPEjFkoGZcDEJ4JPFTtOVUa3itpASnTcO3PIH9FqOqn6N\niL0SO8H3gGySkLKHOwVixjPUbYah6AjqW/HdOIz5uyzUdwrxzhcoXpQR4AJG\n6aCHtaLhBI2GN5CvxiV1MIoHOO4zcb3Osr8435l41HTsuyHFZS87o286w0bn\nGMo6lLj2/+FjvpCJrW3Hw0B9XfGaunHh+ZguLKrTdtA1X8Ynpx0Ynbo5UuLg\nORZRuuNlYOyCRPcqwBRV9YH2kLzPW8ZPzsuGum3ZY8LW+xEG4OufStEqm/Bw\n7vk9d5S1yaXBUo4Agfrf0mM58e8f1YbjQswg7yA8SbjpWDl2iNogQyEPuOmj\ncXDrdRry6PsxDfQ65vfzOGBwtWucvgzLrVdNKwlrK3gxmhJ3VpfVZtKMZV3D\n6tCGLGwPl1tbzqfYu2lCQcZLyizEPXqnTITnl/bEwyaTFo4uuB/EiLwGeJ7V\nNJ0R\r\n=O3ZT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhTo6hYceCRh26t7YDXtZ1LO5SiN+sYpLCzr0B0z3zGAiBaEVqwHnEES/rNManL6zPzRxngYdqxpj7hJs2danorxw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190429192326_1556566042891_0.9813069113561037"},"_hasShrinkwrap":false},"1.4.1-master.20190429201751":{"name":"@atomist/automation-client","version":"1.4.1-master.20190429201751","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ff98a5266a2e17c2ef87c15b47f0f5118b103006","_id":"@atomist/automation-client@1.4.1-master.20190429201751","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-qWDpi9dQ/OlSDjFOK0G0BS0RHEbuDuxVT7z506IHzywixfR+U2GjXi2VszAtsBcIy8AQYHecGrFt8hDgkH2QgA==","shasum":"24c0a477b25e4eb3f5587d78e770c2e58ddbb3dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190429201751.tgz","fileCount":608,"unpackedSize":2929109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcx1y/CRA9TVsSAnZWagAAA0gQAJfd3Je14rd9gwsq9368\nflJMHeiQeOxJYc3Mg+KQ0HnvwXgmF+vTJ11h162zW0ZbEFePtfadLEnQlZ1c\nuC92Yw55i81z1mGkjkF96Hwg2KGgkRQNcVPpAVT3vf4f0CV/Zx5+5UWdijDd\ncdJ0Qi6CgC/pV4q9M12cw7L5GNZj411HTYlCcyTh1l/otm+Vf2cq6tgSYa4q\nhqr3QhIcmOgiDlnxoj7KQ1onCA4K640uVHypaqHLWzxOJu5HOYmE7MRbfg64\nDJCTaxS0fbt4iSDohWjuB3Tg1oSo2NFo3OxZunrsFseeGB6G1WguQdbAQzt1\nye6gEtG/KsINJ6eU3Y445hwIwzQab2+7tB9UCJgIxIgcDHagOh7eAleN0Qkg\noszAZW0xKosbCNJgqIYMOSeKF+PXnp4kxw+Rb/kMAoL6XZPAAzNpim3grCj4\nE7HTeTYOxJQ/F6Tn64MeH/N/WEe0/gv2+0086ttHWngkQhFwg3UVPKxqaALR\nf98ZD/dyYKxXrMgVzYVMDHdWAvQFfCYdqecpHWgV9K8EnWOhjXiofSyZwpyu\nZ/XeymXEBGdHltdfGGhVO27nwTDiNHE1TpQunBItt4UpakjoGDarXpLu0WvZ\nn2n8NMtjlEO9CSmseCQb/ATEiqQzc9JfICZpgrQ8NJV/geu+IM1UOExo7tq9\nDMCw\r\n=yZHf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHnHTowC+uvqEkpZfO4BO1RdP/+ui3l+raPVZCZ3MpNwIgCYjNWYIT7//N2jU8FtvftZMznojLFUp4DITh9MM2Dig="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190429201751_1556569278301_0.6860784458778677"},"_hasShrinkwrap":false},"1.4.1-master.20190429210955":{"name":"@atomist/automation-client","version":"1.4.1-master.20190429210955","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8284b6303a21f68bc42d61b76607adc6cec0f4d7","_id":"@atomist/automation-client@1.4.1-master.20190429210955","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-AHouu+6Erd5+UK/k/IkB8OrQg0/w7gsacufFQdY0UOC2jf7rIILtUtJG3K54J5+VfW0rhp5g+lhaGtddVAjY2w==","shasum":"3af465448c2a4dc0930553f9fddf8527fedb4f36","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190429210955.tgz","fileCount":608,"unpackedSize":2929479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcx2jrCRA9TVsSAnZWagAAbZ4QAIPgnNJssEQyjXqIw09i\ngNoN04ki3Cp38O5McQLvjwN1tqeUP1uFU/xosViE61BD3Apdyhum7RmJMXgh\nDT2/cHi4/AHIhp3QtEmZe41852O2efzvHGV26BO8t5HPBCXOxgLLpcTjowOv\nrqCTTWCl4DhMXj7qdQu8rFQjT963NmCt1wRIQLsb2tJvLKfAizNK4mmT+8/K\nhHQH1OC7xPPziRgesCIyU2xepY7csBRkerqhjMkK9wfKHRYXTFJJDujm0W15\nTCfRZzttkMsIoJrRhlkjKsLPq2ur7m+AMlr4aftofAlqwHS4eUDzamgszZT9\n5yI/pnyNF2WmwTAMlxd4hl6HyH6MQ4I0UwGMlQz8M1hpuioBsdRf7L4E9vGf\n8DVvgvqF54gaxvt4LG7n6amYcrk19MPZAw2rrgaM5Fi4APc+jY/RF8NGR/Bb\nLSRh5nmm4or0uwFgrfeInZvJhWgz3sQq+AGq4kh/OLjvuNANlQUF7f4SFZSw\nd/5MV7irebDYZaIFu6a8z+fuSxhZFogEWdIW47++V4tOMqCozYax/0pvsZCa\nzFOOd1EaqeVV5h4cBsP/11tDdCWwqlK6D9HYMY52yNgwB56ehJ6ICraw89h5\nPa47DSYyiMKjeRq6Wh4Xxzd88ItyyMQgaISzc8aFS2FtWPL9HVtKuyiYBJcM\nzZTp\r\n=v+hB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCh6DDhSeEC4u/L6UfDzc7A6h9cnAswgWGzJ0D+X0zZgIgQpp5YhLACHe7C3mr2PSa3k/gS2MWpr0HTBWf7775i9s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190429210955_1556572394830_0.9550098090044219"},"_hasShrinkwrap":false},"1.4.1-master.20190430072247":{"name":"@atomist/automation-client","version":"1.4.1-master.20190430072247","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"39f9769c52965629267e32bb6fb16a132576dcef","_id":"@atomist/automation-client@1.4.1-master.20190430072247","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-wjxUhcBDxfPSk2owuQ3e4ZZeI3Ldw2dWojYcHjFDL6B/lKL0SMeWqEQSBlgYvlWEZp1vSZJgyPnbinqWU1JGLg==","shasum":"7500deba124b4761a3706db2ab812f2293dcc273","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190430072247.tgz","fileCount":608,"unpackedSize":2930698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcx/i8CRA9TVsSAnZWagAAyKIP/i4yVDzLAQkTiAh9PlLO\ny4D3GBSmoil7gM8jUMWHx9BgOjBUzkeYAog5l5vu/viQ8HvspsEeFz07dUen\nnKsPNxONmE7UPiaafloIePLfDcpP6ycdBfK06Ti3noA5CEdHzdNuJRa6ouzL\nfPb68nvka8brZw5//KDXFTAXU/jxVZjNFhvAcLGkDTzQC6UM6U0zNo5MT16f\nrxCv/zGNbbE74wZkxWjRftzcLjwOTtQjmgIVjcWOvzObk4Gfs2KOsfdNkJlg\nRtx0eiYVjSMtFjilYmFlOpiwcyoTh+VMasL7ZTMa0OWI8CxFOAuzyUo9dCMw\ndSVZNQCxy1rewHpDDQB6zh/vaofoXaIq+DMqekZ3k5szIYKxYc+1zH7VcCbR\n4XGBgBV/I3z00drcGyaCuZRsz87MvkvKzyb3YwqnJ5OzJtj/qay4FXLX1gxC\nL9VJoVjYBe8s1vWnBszO5/h21c/0PcaIlHzacfWGoy63IVRuoeBmk0U4v/1e\nBvz7CBsCQv7zq/UoDHWAQFnfwuu9DYoLSfmjqmeH73q4xVyVKvGHFnDlAGR3\ngjWqGa9oPNRe0eI+qbQmSxiTmiyA8OcluEeaXpYF208MkSz4b6wCFOUKEXkN\nn1NjqE7MIrpNycQJklBusBrF7xtHrSkI0HhuXQ2gXzGJebGWlQJqYusCvewY\nl4vK\r\n=MV8F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbAHK0hIMQb53KzYePZILRew2DoQ796byqgnejlxzspwIgaHbebIl71vSr2oYhkC1cVEG+Sf/obx1vFbUUSJQjQyc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190430072247_1556609211243_0.6821032607529556"},"_hasShrinkwrap":false},"1.4.1-master.20190430085123":{"name":"@atomist/automation-client","version":"1.4.1-master.20190430085123","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"33b3879fa1b1250b5934283b6adc8083d98123c8","_id":"@atomist/automation-client@1.4.1-master.20190430085123","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-C8aQQ7SLhf6/RocaqYdtu/B2NH5JeddInPA7sKgMjLGN2SG3aSRLRe1fsSuno20ypBC+K30gy1eozSjHSqPxAw==","shasum":"ec27f7d4c03ccd53ede14cf1530e9e5294e00865","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190430085123.tgz","fileCount":611,"unpackedSize":2935494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyA14CRA9TVsSAnZWagAAtn0P/2o0uMqWbGjVDTnx9JnA\nDEgXNc37uSqIEmv81YJ0t9/XPUHLrLPVvJ9KhgnoX9Q+dDcsiiHv+tAbt1VD\ncokdWLCr4HVCJnAyzQCFRbIyNIYshAeQEZco3yvyd3jT4Zu34q2dSkrpKZXV\nxMcZsYlJhqbDVltqplLzh8x8RF1vH9g5QxygdMFtvQoLSVBLq77Ubds2ti/Z\nlbTbiiS5j1w2S0Dc4hBZIK521dUx/kDOgSNfmjgIRIqqFmaYekNGLIihKz6e\nCn16CuH2gF+NtFpkl3GKvf3aV/nzHLN4ReKMXyHagxvt07+YeWYVrY8NIjBh\nLOxQ98t4V4e0lrJZPxFaT2A9S7EpYYTFxBwCYqeTYjYDhW2UGxVnBIK4RwM3\n+UplKTBj2Vcyh5GM09Fh33f4ipng4H3h6Ix6pr6HxLrKNrtbn9adTy+9zOpZ\nCuGjmnGg58fogxsBYMof5EkDd1U4HymTlWTquAggKofJTZ2kzz2AF3pmyZeQ\nKWaQhwj3FnNaGhTCcNX3MO2ld6p+ZCvgSgYy94SGDqJ83EE+OEH7hlsf9NY2\n9+rS027EEOZP0ZSmqUsGDI83dEa+OplRJZW4IVyPt3SDejj7RwaTp858O6Gq\njjK9akrp0TqiL+TGObtO0uIT3RpnBt5DAFwaPgMVameoHwqlj9ZgHh5bXAYn\nq53o\r\n=vE5n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzpiJs4pgoVFDwoYmipRNlD7Ea2K1pEXRHissx/Xg0kAiBM3uJRKyeoJ+BJrW5nHQhTwx1ZBROppJ4rqr0ll0Jniw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190430085123_1556614518566_0.776336313505936"},"_hasShrinkwrap":false},"1.4.1-issue-526.20190430113041":{"name":"@atomist/automation-client","version":"1.4.1-issue-526.20190430113041","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d250c5d0e3ef6c6b12b484c7e60b1770794653df","_id":"@atomist/automation-client@1.4.1-issue-526.20190430113041","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-uFvmX1JbE3ITGv3o1elZ1alLprnoOeri+/m/n99MjvQNpQnGV52pvWE1uE1I1C4+rhyZIIo40HyEZYUFKMVJ9w==","shasum":"4ef7f4bb510f3c2a474a1526308566fbf279dda0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-issue-526.20190430113041.tgz","fileCount":614,"unpackedSize":2940263,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyDLgCRA9TVsSAnZWagAAAEwP/0rTfwByXT5vJWkONyKm\nH/IPVN0lyfSo71Gs2jyZj/GWeX0zRt+LHO4gGveLjzNdVPNuyzMPJiAx2ibW\n4X++ovz/F5gfLnU+5W1MelQ+gPHTkvgPXjZzSPI9H31J8pS2Yn1197DJvdoy\nXtU3pawENB7RLWzXdESTjmfts7rkXkTmJPZv5tMPdZyCAXz3YRdM01EF0kc/\nV1047uTZLd7Rk3vhifSeowneDF8oFodVvRGG41zEgaRZDhrU/tc4VhlWCMbe\nJGKia6GVHWuSRORWk91F5Moi1mDgD096MJJfwcOjHYrlRJxAAWCY8yvvJWZy\nl1KCJRe0jqCWLe4Z0l4qrP+AP6x1DIXgvazsuvcUrc+wA1Piy+NtusythrlX\nY2vDAZ47LntWYrO0AVo7kCK6FFHUHPNYTOlMOau0o/E3UZKcCXl2fR+yilZL\nSm1Wd5K4/tm0E23OhnLlCBCyq6tf43EjiQn3OjVL7ch3szKj1MatRw/Uj2Ah\ngtqcgUwYK0DO3lVy6VaUVortsuzfKaRR225yRDZT/NlSDTLk/t5aII+gd0Y+\nOO5T9aPi1tHbx1glNjQuiy4CKGJM+dYMWVlc4nnT7BzEHktjE6TmeikwTB4n\nUsRuJP39QJ4j/Mfu3l6BYkM57SGIqiW682+sMJbTdBPkhjL0wpaEMCxCgF9y\nbLvt\r\n=/RDf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMfBVmcttoq6w6Xae2ooQIJrs0cQZxCE0rKwcnTQVL9AiA4I1YOujyNdBhuRarndHu+LflhUMYuetoMkyhcyCajTA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-issue-526.20190430113041_1556624095416_0.9591578446814768"},"_hasShrinkwrap":false},"1.4.1-master.20190501152140":{"name":"@atomist/automation-client","version":"1.4.1-master.20190501152140","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"56504457acfd5d60c94b04bd7ea2906457887dea","_id":"@atomist/automation-client@1.4.1-master.20190501152140","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yzMsGFzN5/J8918esyZSr3UGKUa4Iexcoal5mv4XNRSK4e+kFefrTCwZtADKU4ZhmjFk3gj498arGP8Pxt8pRA==","shasum":"0013640b1f24baf7e3e39ee0fa89005cfc669a89","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190501152140.tgz","fileCount":614,"unpackedSize":2940354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcybqVCRA9TVsSAnZWagAAqN4QAJ13DwQOXlU7LkueOOgF\nJyurCTKSlzQAZcNuA6k06ZZrcbNAsqO2mqdxTFre3oDPcnnpGdMAaQyp8xhS\nUaP3lbHCC25m3/VTO0tttHMqXaMT3r5xwpDyDo7OtDWIXJTnhUsbp/Lk/5Uo\nGQFZOfgbG5htgb5RjcQZjbgl1tQHWbxneigultZhP3TRtiExu51xaDo+ym9k\n0ffvgb7+Cl8qe0CRhdjk9GWmUeXBWij+4iqskHIHAnTFKaAXAUkO6RTNE0Hx\nUJITnxcqEYoVttG7R9vs9IiObBM8/6B9r8yeYh80brfZoHpFQAcsBdh1mIgu\no/Kpvb+dHIuWM5bbdqnajL4w5axD8i4dcGICqDtwLPxWheKO/bqTy1DtKzyY\npOwZsuavO7wlciKa6Jz5QYWN083Pj+K3dox0SRfgzOwRlM9rPMEB0QUHIDQ+\nkD/aYROmYAHOWjvF4y7woZ97adKsiS4HVFtT5TpKpSD2v3oNXNswr/b2IpUN\njMK4HMA+RUSCYczuSShXrJG39qx8zJKUTZ8gSdMi/uzkOfxbIbRCWk7sn52A\nuj4v8ShY9880NsiLRUAura3u6wfAiju2pTxjl678QhcWJ7Ck1WbeoYMiCwhB\nvpBcT2/rlpMMhZBNYlkOK3QAx99XBbW1MWIdhaVBwXxY6mtnM/9xDQcx/oa2\nJ2w7\r\n=TFwk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4EPY1n0X9pjYbT++D2h2ZS79XOBxv4QHXbD5DO1PBgAiAX0ed/VmTo7qASibSi2/5rxSQ7vXqvJgR0z4ljT0LoMw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190501152140_1556724372161_0.3435192530397284"},"_hasShrinkwrap":false},"1.4.1-master.20190501154012":{"name":"@atomist/automation-client","version":"1.4.1-master.20190501154012","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c99a2125e9c955adc2f04025c1f01c1296574302","_id":"@atomist/automation-client@1.4.1-master.20190501154012","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-H6GYp1UryRZMDTrlnsR1VYoS0iqlJaP7vi6QxCAcLRIcpDSE2FGvRikjfqumcZUu4LCRvyke+otfe9rCLqeZiA==","shasum":"13898ce4a4fc347ca98a09f1915d6310fa34fe7d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190501154012.tgz","fileCount":614,"unpackedSize":2943069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyb60CRA9TVsSAnZWagAA9oMP/1u7GETtjVMQTAR/5CfI\nSLKHBIZorwkzQE2AgBYGog1F5X6td08iJ2VtUxTS3t1eUFpl9XT3/bG2owQj\nqH8rT09ga39Gb42FfSXlbwIVFIuhejoYLEEsfVChYboZ+plTj/r9Zx9jDCWV\ndhKTBlzjz2OHmIsGRq35NTBYO6PKZz3nzoRDoTw7UUqLwG3FBcvgDY7Q0by+\nu8chjBaMveybawYHk1mqtMs6so6j+kpLkeVc+Zrw4IvSs8B9uPZQC7OiNGNp\n2MJK5vVVipv3FI4LsBYBqF50/BrlXQR3G+J+3R7nIWUkoJApsblo7/fAmjaJ\nZEgHT92un+43GXJpydZr8uMnUChsdhIkfuyNJeNIfbl2196tH0IkTR6WLf2n\ndQ4LlVeHA+1IaOvGgrmU/a4B/IjGh22WK9nKD8680YmpYQpMXttzUzvq8X2T\nh8OR42UG5TswuuwxkbeHK3/DfIGFxhF9LbGE+NCLxtqHDZwV+ojfIh94U0ul\nTjnFmlMmiH/peNrgPFe8X17Tkuqry70eLO0T7fanrlwViyfJRz4ax+iiOzku\nZajsU4V+R70Q40p6qboRd9Uf00EJ7JJEvn/0YjlfUiWs7gcRc/NAwYn18Hz4\nlXEVh3j4l3peeG2Jz5f3jItH59D7Ixalx3f6LhS52GWRcrZocFQOVeJfv810\nWpmd\r\n=qpZU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6AdTTp8Btwf0rPpIbOTCwkWCG4pCe8U8ZU1EL0wwUCAIhANYp1lXZPdfKVDXuDHYOBD9X/IzXUiVGB6fm0o8Hk3WQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190501154012_1556725427325_0.9328955778593178"},"_hasShrinkwrap":false},"1.4.1-master.20190501164912":{"name":"@atomist/automation-client","version":"1.4.1-master.20190501164912","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a8f2175bac01e477f3be84c98a432521b9b7b2af","_id":"@atomist/automation-client@1.4.1-master.20190501164912","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-EQkGnWMs/G08jRSK0+dN9XMzH94g4VO9pjI1bnmRpvLHc9YONLwwRcJA1vCeHJElzW6T4ClX6ViKVGhQH4J7Kw==","shasum":"cba331be11ee7fec7e1143909475b9a568f0cf8d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190501164912.tgz","fileCount":614,"unpackedSize":2944130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcyc7vCRA9TVsSAnZWagAA++AP+QDTGPNxrJE2jU7QO8Kt\nKcO2y8X2gxY1RY/f8x3BnmDxk9jezRNkVaJgn8jijXE7eXqVh3q49bbmZCQt\nyCtwZD2E1s6hPigktvTgFHTKclyOl5sZ6gl5rUw0++h42LpHz2U/SQ52mqOe\nQK9U4oWIKvsIxYW/ajJ5IqiB8botArtjqFgDn/jeumgzwZgq8BIYOf5TlOzs\nr1A8IjbcDhn+hhHrziC3eoNk6Sw0xFeWGPawotSx9ezMhGI/NvQ3A+fUNwYM\nBudbhOFzHb0gsh0QZZpcBwXjQjhNtwEGQ0lOBF25xyzaVSZg//p/fQRdXWsi\n0rifNhcOYIWaSo/Qj7D3p8kwhacy6sKdw8EZ7+kK4aBLKj0WSUu5L/iJ//2c\nqrr/HC4qe4zG6/ziC94lPVWB6ftFYMOGpoFdyAy3EYHmuqaidCIg21Iy7+Jb\n0Qld3Q5hXlN+dCy26b0qjD1eEnY7NwGlkuP8gs2Ub2sa3ZjklVOTt7VsHPSg\nvQLqlMEpfAmUjPRFwrriehQSYbJ7+BfSBEBc7f3ztONzPb2Qmioa4kp9AJA2\npm4aDUWJFnzZFsBpWwJApLNbGGlaIvWRzpGk5zZ6cs3NDSzk5ja0/tBVvcRx\n4fpeXKrs/RpGchstthkq1ppe1mqIn3r1Mq3l2s75lX+Qk9JBWq2jTIdaXGX6\nEN9v\r\n=ISIp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBH1h7kBflKN8ij+UJrwZJ5UAp/H9V1JbsJA8A9mqLUKAiEA0/FE5b+oFYXEO0hEux85c1tm+mvNJpY7FwzQ1O1iZJI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190501164912_1556729582441_0.8913261875491445"},"_hasShrinkwrap":false},"1.4.1-master.20190502192720":{"name":"@atomist/automation-client","version":"1.4.1-master.20190502192720","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d71d615363ca8b0c06679f2d731b939145a349a4","_id":"@atomist/automation-client@1.4.1-master.20190502192720","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-Xr8idfLKFJYBdTCS2jFS2EwGrj+JlVgYGkFoLfSE4YXv1gcIC9TjCSkfXWWafM84jP7yYeEVzvguz3IcRheXhg==","shasum":"ac69f2546d790423da022bae82eceb0aa90c52e0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190502192720.tgz","fileCount":614,"unpackedSize":2944190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcy0V0CRA9TVsSAnZWagAAowcP+QGgPo9+LINquLNI//yc\nitgRX6T/3rtAbW0jNBxM/6VUpmhztRe6qykWkiRuCNb2uphWXTKSFuBRj7h2\nVxgdjn2BMSZNKzHHTeIzT/bYsfRNvlnSia5JiAROdm7x8hx6bj+brdV1afwm\nu8rYFjg8cgx98efzmvFfmTMvzoeRkoIF39umjCM/uuf75cT8zy1hCg79lJcY\nfh925vz0somr4juK9h9BYHdtvtCUFA9ePSEFctJzMskWoX4w5xmjMHWfsGYE\nUimSOFKAbqIqVrhFg7gHpHNKBLEy8fjnAUKOwDH3G+HP+mYHwKKPt+GYCcKq\n43zW/iDcef7CNt1TK7uJ01+OQVmtPhDusPS6LldNkr2gdhKWYENbF5UfXRcQ\nBYQ5CCbU5R6lD0sCSqU4EKQzswC5hgxfBlM4nFt/NaZDIky69SFxzspe/GJW\nHXnCpKALfU1DbQDraG5b1OH0TW861CFSeTtzqIA05vrasO71zOljbl8aGSJN\nIiZAjtMcbST8YWHy0TqrbaLB1w318aZ6WCd+DTlaCcuYGK83umNnvCbew04V\ngAV4sR2ogmZNeQZRChBdAKPyfRY8Wi8i6zyRwRnuI65DYZd6feo426jrb1aT\nT2WO7SWcP7dFBtgOnHTy2kz5C2+Ye152I0A9JfJWypxjA/64CqvoHKOTzhKt\ncMY+\r\n=W5or\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYQ3/lmqTbiptx5v++hFuPRrbmTh1ZMGycwMv/li94VQIgHf8rQFD6uZbDRY0vBb5GdLVwzivGclLrr8dkMgYjWTo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190502192720_1556825459557_0.6047650839400636"},"_hasShrinkwrap":false},"1.4.1-master.20190502211414":{"name":"@atomist/automation-client","version":"1.4.1-master.20190502211414","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4647b1e13bb2230db553292285b60445da8549a7","_id":"@atomist/automation-client@1.4.1-master.20190502211414","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-dkm30Ey00BziylWADnOU22b+9qrxnElMGxhW3/Id0J91e1/5f1gYwgufl1IXZhWDfhUrdScYEpbH2Si56uDRsw==","shasum":"6f923652056d43d843da20f91d984a697202dc64","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190502211414.tgz","fileCount":614,"unpackedSize":2944031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcy15/CRA9TVsSAnZWagAAHb4P/2WrplkqV5bss77NF2Gw\nPUkokikPQ8dS08MW+JFAy/EJewdOF5X2TF5FiHnOhtYG5jQNvB5u9kcBYLDL\n7/gz6jSDht9dI3U9EA1DN7zeWsgH+d9BiaTHyou+OFcO9mRRW7FADLuOAUle\nEGPnmwAgY8SkL5oncVIjl8yQYfKTowfksWuSqgT1QmFcgRRO6Cbc2xIGRuag\n9Sp9GvO+AUY4rHc/pKNXRxZHlAdIdpuAMzx4Ok3SiVFzoJouGPG1H8OxDuOd\nRYAyuhNBfjrYoKT/bT4VptqhseU0ELbvKFPkoamnHaiJDNKADLerNhnSQbEb\nmeDLpDjqRhv1hjIe+cg9mETq7Re0jSF+H072TyS7FggWLrfRfsNzk5nK6Sgb\nC6boWLpYPcZxTKf7ZCL98j+vtjHCUg4W1o0c6+4mwYKbodrz42bWvQXeLreN\nzpJHCgG6HyomQP+xplo5lsK+zeqR4Hi080kMmdBWzKxD5ioImIbnnkpWICkE\nDPaPfD0grrTl0UZWmKiA2dX2GguwzK0UKbCw0InCINpEo9Rb9jSdHWhurIq+\nuZSmPf74QZWJiJ4+0Ssj7PQpvzCWGvRQmt7FHyfLxNH0/gfxHB28PLEoTr4y\nb19+HtyPL+EKQYRp6OpWF8NdvK9Rgsf6n6jZsB9D5vnVp/rC4Kh3DtZI9QZZ\nx8SO\r\n=6qSO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAQ4kjImcsWOwC/q/HZUA0aELZWCknTvdhr6lW8UittwIhALLcJ6RsGMHyYSSCzs0NpU9oYn/le+Q/s6EOvbuGSSlQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190502211414_1556831870984_0.07640985829099045"},"_hasShrinkwrap":false},"1.4.1-master.20190503092134":{"name":"@atomist/automation-client","version":"1.4.1-master.20190503092134","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2bbe63bb6efa8770a0bc4a73334ddf064380a174","_id":"@atomist/automation-client@1.4.1-master.20190503092134","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-LG233HWvK7Qs5BGUg4Pg3gPuLek4nH766UY8S5CrcMczPH5noPUKuRLtWMGs3zn3oZJHgUV64cQ3Wx8pWEoopg==","shasum":"0b19115146b5a20bc9cf3bd430d29293ab5a9732","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190503092134.tgz","fileCount":614,"unpackedSize":2944288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczAlNCRA9TVsSAnZWagAAQjIP/1iOjATexKQXTcah6khK\nZ4AD5Ch7oloVRWyKtJO3uKMVWFxW4qfQD+lAjMzasRw7EJDPxdrcYdL6z1e4\nuC01jKtkYFujcDedyeq1NDICd4emo+nNzhJ6KoE8u6oFqMTtQSdjWYVg/Q2f\nS3Ow/QJK2+cw0g6jsDZDLyt6eVFfCMxQrhk6ICQSKssZTR/KBBgXk0FMe/Yd\nBNMehXhtwhvuKcmFD4rNR7juYRs9HcuejH+5hyuQO+JKzuN2otH9UA9GgGXe\nc7BFu2c3lfmUPkbnYVLIfjmo1qSRRBPkjq7LrKEkycdQeLwWJAkw6rLN7RDR\nQ73pYNUtHKBtOQkYEr62k1rweyBXLmjMBtSf+a/P2HljP+QF8hVY0xmlcgyl\nCgXx65M7NfIN2sIEQ8K0jaJ4q5P5SoXq3UayWK/ECDhZcBrLrQve3WGTpnLl\nw4SB6TydxK2Rb26MJEbz3NajL+s64Vr8WKRinPWgHrsnrjBsMu37u7wbUXcY\nlaIH8n4rVd7KK6dlRWfN/AObNtdCwK/cP10AbitfPkQNbHizyqSt83uL/Xh/\nVF5/rtyjf6hYwZXgwg+0oMMkXr8Y8lHZwGrPPP5bh0iVo7xDhDzAHiTsxGqF\nn0XbgY2t7aC5AF4LKM1j7lO5olsumbBeqHn3KLe2a6CvV0hicUrMyvTsbayU\nt31O\r\n=eRgw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXTvthyZ+HOxmA4irdqkwpP6sSykyTH9wh3ssNadE19gIhAK8kZfwu8WrRnh5W2fdnEdXCSN9fZ6/i3oWMlgNwfYzk"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190503092134_1556875596643_0.4395506276084509"},"_hasShrinkwrap":false},"1.4.1-master.20190503164044":{"name":"@atomist/automation-client","version":"1.4.1-master.20190503164044","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6b9f2f02ad05d1a7f1a2d440a046e7a1271e058c","_id":"@atomist/automation-client@1.4.1-master.20190503164044","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-/6EFhTMPyzlrDlW2w7VLwgu8UDK2peXLjKgk/klqWrP4c8o1d+bXWPd7sj40WCDjhpbAbcmYjUFHRbHC/OWkag==","shasum":"f83a315ccbea605c4a0c316884a5d9e16831430a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190503164044.tgz","fileCount":614,"unpackedSize":2944758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczHACCRA9TVsSAnZWagAAC2IP/jz+oxY9TfasOGsnuKNj\nqm9rq6gPUVmGwgzq4U6TGSdXkSq6X1IIX42fRwO8mwTAoGqCztHQppcgysz3\nZiksmIdyyZCwFTE1GHOG3SDBCX/7iwLpu6P0m0EJqqPpORTXsCQC1kQarBEz\nRdrA5XcbPLDXAnh+1bxyV3b7Ebkdyqj+TqKnkxhG2T4fEF7l/m6Dk4RhfZ6E\naCLyd9OVAUHl1zn9dEDLg0BTXd2qR5XkXx0s/K7jvK45CRo8iK1CVs7ZNQbl\n3T34+3BAqqgDgmskmZsyY/95RWVtGk0YayFtNGDuUuU7u1Yj51S+YOER2Cky\nzTGO8zGCiAefBahTelnSOyeflTeUpl7WEDC6uw4YudMa64w4cNo2KZCOU17J\nw8RQQ/YmNWZZZLyeIoRvPpCQ18In8xueArKYlF0exnrRe+8lE9dVbWYgTnkQ\nPo5DvPPlV+BsVyk0lIA9k5o9gHmtTEPB7by5LsQ7uWhHKXCLUdQPJ7YniXTh\noMnduS6v6tqGkZ3/cJNJipUuuWT+eamY6uxe6eTJ9pHNKcgd3safGV27Z4Q/\nUetuTqMoHi6arWEwjYn9hPi/lFAuTlft2qwnlsys+DaUEP9ivi6FKPMjqhM4\nstiKLuMaq2cjofjoX6/Fkc7hrRL8I4cRLFBXKOzfwg0FTvdjGD5lWmQZBG2h\neAAQ\r\n=FEgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICccUdCZ00FVIeMKNUSZXPw7AS5pbNYVieq6y5ajNCp/AiA30g82/mejBeCH4LHfuBJRV5uFHXGOrq2lUkqQ47TEgg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190503164044_1556901889307_0.27642747612977936"},"_hasShrinkwrap":false},"1.4.1-master.20190503175050":{"name":"@atomist/automation-client","version":"1.4.1-master.20190503175050","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d2096a33b2638a77b406460c04a242d05a98357e","_id":"@atomist/automation-client@1.4.1-master.20190503175050","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-iVkgdn08ZCl/Habq17wcKMLK9p8LOb+CEI2oacqF3Ik/QLh2L61ewbMNMy7xQTKcssb2hV5VpVD89AAvtIShMg==","shasum":"16ee2878b3bfa2393bc2a3e2ad0c31313e2ef895","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190503175050.tgz","fileCount":614,"unpackedSize":2945209,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczIBtCRA9TVsSAnZWagAAfu8QAJcVbP9wURoobpzRtOmz\n624CZFunqLwG1prxNWiTSGPXyFC7Uzu3LxVmHgW2+sg1aXsCYv9Qgco/nMWc\njst15p1r+rt/NrihF1NhyxrryWsotRAs+keeavX8vU9HrAr7zEnnhn/mb0Ej\nLXWnKyCJDsVcJvsYp0y6IPZ/I0+LNebmx4LG52vbXCo19jY0bQK6JEuitOgI\n7NnhyFu31m9scgxAL8AhZBgEi3pmCf+sOFVmAA4jLZZfcIIjhTfqWGgdYm87\n0n1aPOqh/Uy6fQJOdkjsyShm1bz2jMgyitONpVgtyjZbK6A9MjfaUnBJopAw\nNUMD5NxTygqqguK4tLUXjrE0VfC6IAHAQhxxKoZr2ADUW8Jqf/geTkY07D8S\nLcktu4luTF7f4AkIViSqzDY4QIJuumsg8SaOHg7RQEcGztLCVImECZncJkO1\nOkYGp9kkMNrifW5AQ+j5XvAsxVSj3bSoiwTaiWI8HX48AhmJTL1iwXrtmxdt\nrIhK7fczr1qHehN8DgkyQhXgWJjc7yEcJbicnzV8W8C24kAzIBZ1BddMtffu\nX+E9+7iO3T2nrNHhzF5voI13m+sub4ajrBhKJ5K0u1a8UtZpQsN0hmz52l/e\nuaHgsPBTSMjMbc6vIaScuc+siTmgID9xUI7a9kXvtrd8akeGuExx+C0tilgT\n/46V\r\n=hwPZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmNwNvYDgfbe1bMkiYuv2ClMFr5Cx1jrhIbMC52J7WSgIhANeICgHV/Aj1L20sXP5ZN/S455hbwl7SVwUyVBptW5PZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190503175050_1556906092746_0.4191801415081655"},"_hasShrinkwrap":false},"1.4.1-nortissej.in-mem-subproject.20190513221636":{"name":"@atomist/automation-client","version":"1.4.1-nortissej.in-mem-subproject.20190513221636","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6ca2b6825b666ad005885fd5414abea7f03ce5d1","_id":"@atomist/automation-client@1.4.1-nortissej.in-mem-subproject.20190513221636","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yclmsrmaaKv8sRzKhBq5SJwu/6EpHwz9LiTLXyro6w3uwvZ7Rvzr+U1ZYF0pXtHRfRz77w0MYktPXHG9j06R4w==","shasum":"1a2d9613a1f9a380595a41ef234d119fd87e371f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-nortissej.in-mem-subproject.20190513221636.tgz","fileCount":614,"unpackedSize":2946563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2e3HCRA9TVsSAnZWagAADBwP/AhFc1H0T8l8kFvUIvG7\ncO8jUaWAcUDgbpX806VgGHq2CH19tzJjSI6m9E/18vHqus4WBJmbzITZDA0B\nL2WQuKl/n0BoyokdHGfRlP3Gq8eRkYBc5uCzojWPpltrCoRFARGAn/ERnweK\n2MtuLG5dnPCTIyV4fkNrdf/R5k4nz0y5zI4eDCbtIjVZJr3XNhooYVkK1400\nma/x9w3YT7y+g/OKf+Vxq1XNf/XWempc73zzM0ksNOmAmRleuggHPOMltshG\ndTjD9ur8k4ROamSqbsEKvAnxLyPIL4SOjFgih6lbCM7g8MB3+IICfYEhQ3YH\nLsnOmHSDB6xF7uBndLI5RnAP7Sf2tM/qNjh0yzabV8V0A1x4nECLAXJLNy0h\nM0UgP8ldZVsOxCSeS531DUaqMZmcghsam/LitabM4bd98mX8pRdyJy4g13MO\nF7R5/92qQWGKooaUxAS4qZ2eizptCIMduqL1i6rYwa69zW2NbArfPq4/+GGN\nfd9YD5mhOEUt4I5aOYsJyKG0iTGlhj8W281uS2btd/8PNH3PsAw2TPj7+L3y\n1GLU0jdc29YW6OuohWQfT3YF5Ki5G97Gnz9aWIgjJxtt9RFE8GoKaSzSofAB\nTmVDyZrPr1MLg9vS30KOqpj0TOMEB8bJ59i0sWTIn62s0XSAPy+LO0mMjtvu\nTOso\r\n=kQOJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIutir5QmjSTRePG4TQSBK1ts5ykoa+DVutyB3Yp9dhwIgAN/S/JEHnhYpAbCJ4sEdGAQX0Jjm9ENiw9bYCGvsPHo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-nortissej.in-mem-subproject.20190513221636_1557786054601_0.9225962242630794"},"_hasShrinkwrap":false},"1.4.1-master.20190514195214":{"name":"@atomist/automation-client","version":"1.4.1-master.20190514195214","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.3.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"734192afe97db07b7e728f6d84601fdb30f6dcab","_id":"@atomist/automation-client@1.4.1-master.20190514195214","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-sRvUkWbJzQrGVTZ82A1RKSnHQ80djNhsc331w1KGW1DudWgqQ7g1w6tyDbn6e9YmeBi6/W3uj8D6NA/Yk+U2/A==","shasum":"e887c80d219fc70febc2dd6ebcc86d594209f47b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190514195214.tgz","fileCount":614,"unpackedSize":2945218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2x3gCRA9TVsSAnZWagAAypQP/22jQCupt4IInkxL3pyo\n7ZWilXsDAfgWHzCEq0UxNd9yFwdIr+PfE+hj/ipjaenrkZXN27ZNCKf2iFrB\nyXq0D9BQXBXzDXxHvkyzheC642xTz+6bD8eJoIhG9WYZwhQQHuyCUBsUSyRU\nGxQfnrRVoQTxNxVMzIg9s5BTVj3ZAgNxksXygfMJyEJ41blKtw6VhGPK42zZ\nHO6X4hk4TTTmZOhFcn/Wgo3En3vVzT+Ngohq8OMs0T7hTnzf0IwOkZnTYc/S\nKNzoBdS+ZiqsExg+zVJMLYqQREU/wEvp6UWsw9nM7JMT0v5b/5ZM688mI5cg\nl6eZKKOEB0Ln0oRUjAIpXz5qiom7rmsGXJGDFSujwZUfa/OopUoL3ytlYoTW\ncy7uBe5P6K5mCiHOIbNgYhFIlWlE/OgW8XgZjPHSaz+FafJURu+pApwHE3Ds\n5GqxG8Fv2h/PuoSDhGr4gWDC/RrArCXva2gQeCBHSuONZT1jmUVVNQp/b9gZ\n85QHZcmlJ49A3/hQcOsaWzs9zUtqF/35bSB8hZUPSVg7TLgElBYqcSWYaXWS\n/A5d1M4Qx/x6pzN/VaFQH10zOsjX6cktNEC2DE1/WOLBDYH2e7qb8nBUaRmw\nV8GTF4MKlLTyiSclhPrC7/zBYAr4131aXtAyI1c2TYPHO3KiCy9v7Gl8LvKJ\nH6Kh\r\n=XV/Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIOPL2gEb4aAqMJd9yz9q8/sacDuby/rEJxXDsY0L2hAiEA4KcjKEGOU30PSv2bXLhMZ2ofveWdV4HcNrv/J0WjTfo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190514195214_1557863903886_0.07179788900203032"},"_hasShrinkwrap":false},"1.4.1-master.20190515123924":{"name":"@atomist/automation-client","version":"1.4.1-master.20190515123924","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/node-statsd":"^0.1.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","node-statsd":"^0.1.1","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d808b651cb5b5988000f3d4f514753978a640fd6","_id":"@atomist/automation-client@1.4.1-master.20190515123924","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-3GwPzUwrBWLzzpMaqZT0aOq//ZMAeXT4zB1mF4JVmNjtat+YrSs9QuiIXM8t9lmG5/KkR29bPczzAI1MHOEFYQ==","shasum":"62efa0e3c0366e69d9012bd4fcafabf1aa2fc7fa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.4.1-master.20190515123924.tgz","fileCount":617,"unpackedSize":2953112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3AmFCRA9TVsSAnZWagAAvjsP/0klT8XOgLeJtiJoBBqX\nj+5lrnunfHbaBEZ/1EUuGo9ILvV0Pull36jcLyq38PMYuaUypPKWssb/oUkL\nnYHe8NojNeQp64lkxicyD1+u0ZGAI5jNVaz7AmsuBKJC8LTyFORHhsDQDrl3\nD8Qr/mhJMsYEpRUAEsgA/MBRH8VdQiM9MrOJEjDHtL1ypNQ/Ds8XmeuCwTlT\n2a+dnYQnAfz1YP8jvmTtQt6eJ8n2L9jSuUXAAkXUUge+fE6D6nZQ1F16/eCT\nSKVSmF69Ewb7LXDTx70rpd4aCNT/RvvjmTbLExJ0VSzd5bQoajK455KSfv/d\nFoVzFp7tV0MrRfi2K/Cw3tQ4MVdNdIcBYb6pBSV3aWQISZe/POV57mYqpHDZ\nIx3a5VwpovfSlFnOXxHOK4ztaFlwvdA8POXUD3EH3BqpAy5tbN1ED0uJYfZB\nZ6xnbNC3J5nTsIbYsqoI4Vu1e7vK1tARVPpXnXZqTEAyloO8Vb2xZobuj48T\nt3Rh96WLFx2fF/+84z3YgXWQeMnhpIWtTvSfmRlKCP8vNnPDi0Vh+w8GxSNL\nkKRcc4hDQvBTNoS7uV1uZUV2/CIAVjyB6Yju+MYkc3yZevFoF626gKnjw9LO\nIubD0b4cmcJ4Se6Foreu9yFjPt05KPGktZC/y0Y0+hww+hYRqxJizO35zdeK\nheuD\r\n=3DQ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+To3Q573y5hZxQAkPA1HTca6ykDJSPFFP6kT00Py0UQIhAMDHvVbDA8IQEJlaB4KBTYaiNF/azE766guhR7TRmafZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.4.1-master.20190515123924_1557924228393_0.2031810381339818"},"_hasShrinkwrap":false},"1.5.0-master.20190515135847":{"name":"@atomist/automation-client","version":"1.5.0-master.20190515135847","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/node-statsd":"^0.1.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","node-statsd":"^0.1.1","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4409e5e0a60c5b3b7d59ea9c78fea737d3100f26","_id":"@atomist/automation-client@1.5.0-master.20190515135847","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-WEOro/pM4ncPh9IbHpVH1lKX4wJWqpyQl9jHnB6yOB0S1Gr+J5rxIUQwwWufK3huCKW6NHJ55tgp94IkWMjZpw==","shasum":"a8c4826b3d585030a38beb3666208648c163e444","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190515135847.tgz","fileCount":617,"unpackedSize":2953112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3Bx4CRA9TVsSAnZWagAAK90P/RC2gckIWP1QMzNAybf1\nT4aK+MuyGAG7V4ZwG8s5mKEgxHxM/GcQc20w42KGpS3VT7OciB+fp6R5kzWs\naROIVn2MuKMuAWBuxiHPTbKDJFk0ywrBaj/O0CiKPB97VHyMKnGxTElhe49n\nHPgiO5Ms4Sa4OC/B7v4q10Wxf1spIeNzmUhSpJmLEC148oazfipOTzJbKji0\nY2UR8pAJWGpmpU07qkWU76JV7iQVwb03Gg/vitkB4CqYB8xpgfXfKja7WbDT\nZQ1I4A2MNioy5cZAvvHQ5IrE6WN5frJjuNhZMorKgNm3lJYXCz6SWlGMCzBj\nkCcilOOIncOpoww6Qs8r9wXYSVCuQ+vknezb6HjM1thSmM3A8a90h8npV8xC\nzgqHZ+V0Gvw+qKv8TtEL7uCHUTlue0iiKeCuGD5AXnVBRj9A4tby148bx2gS\n6m2Aigh0532JDjoiKXFGdXgTZPnJ/WdPxAvH/5cQuzEcpildH9MHV3ft5D2i\n9JOj6jcujvFj98xWqDSqmOQjQbmb+49hk+aK3s5n+RLTaDKjH1J1bh0u7Kk0\nXqWGBrTSrId3sCl3IRCuVx++VUmnQ8FN601xWwVkNu0CTqp/axJ9m2qNqko4\n0tMuujXnHZPMOY5WmWZ5B6drNdQbSjONv9svvCRPOk27klIQUHnXqnBpuvoI\n/cBT\r\n=HX3a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH44os/rCdl5GXC3JrmVVzUGsULI6rDOOaWkx4pFJXm3AiEArqh6pGA2FJDTatFCNS4OSn52mBgwD4hhF03SqNg1xuI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190515135847_1557929079811_0.11994209524224142"},"_hasShrinkwrap":false},"1.5.0-master.20190515141026":{"name":"@atomist/automation-client","version":"1.5.0-master.20190515141026","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/node-statsd":"^0.1.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","node-statsd":"^0.1.1","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"211e01a285992333ad391a74078b9a0c8caf1b8d","_id":"@atomist/automation-client@1.5.0-master.20190515141026","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-u2PoMg2/bEl+UQ+gmhfBeDwVZGnEZHdNnqasXotNot0jx6VnouhwixV+FOrw2JFF43yUhOf2L2GULVEC/IvgGA==","shasum":"02e4d71d30371fbfb3faadfeb1eb494144542f83","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190515141026.tgz","fileCount":617,"unpackedSize":2953100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3B7LCRA9TVsSAnZWagAAN6kP/2wMfe/rAMAjxR22Emcv\nctFAsany28Um/EhsTLYMFJ3y9Xge4MkvJ2pjBecswr6C6KPG5AkBu61YdHAl\nSZBEjjDE0i0hGDPV5ikLC3AQCi30vILsCCwbYAMx0NhmqOORXWqhH3ABYre8\nvqfNR8DF5qdV19rp5uGxTjRXv91O6GtIS4j2V5Rs1SmveHEWKsf2lmlWgXcz\n1IHYruk1IdqiEzOe5YSfqCiSNS2e/YYurUCHIB72XucNqAeV3CWNyQ1aueuT\njn4RoJslz3I+pORMx7MKsrBJ/VXwq0fQcZTz1ciRHO4/L2PAnqZ5UlMXUXb1\nmj1xbdXDAEp47F9DmfW0qgHPuWD7Dz63OVWIZDIDTO6xew40c10dQpXas0Ce\n8MdFM2DH6kOAiDaf2RMzUdQN6B4yjye65DPokLcexmErRs4IJGF2UqjCTw+I\nbVoVtdSj2HGp8fWeJgvPTYqk0eyRpsDcFMB11E2dH6ubxJ4p0RAZkVQPF2vb\novKLkdnzGGmTzwp/brc+Q5i4YpFhwQXVDIe/dRzWs7n8PAeB7vsQR9/6E/an\nT18cA55y8qVbPxNAtSz0Lyp8ri9bbwOVwJ5GqTm6+UrIRotDPlK+029p0wxv\ngHvRgMZ1k1VPXdMyOszogCFyp4mUUyA/xyYZI19OAXkReSCjcqyz0QVdZmnS\nurPZ\r\n=VNWp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwEARpa2Z+h+k563nLxBnFn0BSF1EbWUwR10+cl5r6VAIhAPiE/pa1rKeaFg9WAtB9CmJKD+ju+LWxQTF66hBmbXo0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190515141026_1557929675222_0.633386344116605"},"_hasShrinkwrap":false},"1.5.0-master.20190515195848":{"name":"@atomist/automation-client","version":"1.5.0-master.20190515195848","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"50e1d85c4d40e7459e1ca5bc244755f49248c37f","_id":"@atomist/automation-client@1.5.0-master.20190515195848","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-XxlZQL3bN1dBBiBSsxLlLr4ZFKEzVIj82wP0oejgmpzb7BUOgIfgzs4nZeradFFMbSQ5eF4UuejblOzhwSW8Lg==","shasum":"072e345b4056b02f699333ee1f7e5b9cd267d659","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190515195848.tgz","fileCount":617,"unpackedSize":2949483,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3HBOCRA9TVsSAnZWagAAdQIP/3sfwr/IBKFbnygT8IeU\nOxr2YkgFJtYyHB2Kj8b7vtCjooSLdDqxqT9ecQTzr7ci1xNwYzDS9Q7wMxVy\nROYNaQSu58y+k/BBD5Cuq1/Qdos/sLGxXPlLRyw+lAK2rBrRZZKWR4730tld\nXkDMLcKWo0LCuBZxP+FCnuv+JIQ5yaRSCzyImOkR2k2oinEygzMQllAyr+pi\ndYGl/1oYmlSBYxzK9ZZnBfvYRkPxXdtIF2bMUykVApeW2Hn8zlQAO3WNnMCq\njDjWHOvk/bIwMGtqBVcj6lu0e+nyRlkhBTh01qXmJP+98iwRV6Gmtbwl9H75\nWBaq6wm1IeGic717I6F16YIqu3Ybqfb16vy19v1pn8LRmL006UVRYbZhngSe\nZWccrb95TftLxlwMq2Z0mNxgu6BYeUhezF+IuYgKLpHw3kkH+130N7m04lAU\nf7wa28HyNdRYEaTWFUWk+SLN6VLdNGyK5O0rHjbXKpdcH1pLQRucr9pDBeGL\n+HGNOPR6b7k3q7jqPTGl6tB57vRZUCUpqfIS1A7oHFnzGI+Vc/bfe1OisD7h\nB542pHunamm0HbZywyCnBcEZuf4Lo1/mJUHpokYpmeXuNLx9YozzMxR2M4GT\nAzU2EgBk7E+i3uzwVg/qHtOgeGY7Py5H0xooceAtYjOZf/wGlrVb1n2kH+8U\nV4jG\r\n=tr3A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/j4f9MIlOKakfWbVDihI3bnzdY4omOE3OlLy4Opar4QIgYZ5+0CGcOfcLzLlMrTwC11qxVXKcLmmytsXbAToDYw4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190515195848_1557950542090_0.3263833753240031"},"_hasShrinkwrap":false},"1.5.0-master.20190520153523":{"name":"@atomist/automation-client","version":"1.5.0-master.20190520153523","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bc756b992ac112e7391e85dfd42bcd3c22db47f2","_id":"@atomist/automation-client@1.5.0-master.20190520153523","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-4eBi7M8azw+WwtefUGRNKoG6tvv8t7RK5KGIqWrf8VUE6M+gukDmPJC2MaxOwcf1NT1PeM1zXlvyMVE82twPMw==","shasum":"37de9d1d1288a38ae3863ec4942e9d76f4e1780d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190520153523.tgz","fileCount":617,"unpackedSize":2949639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4spkCRA9TVsSAnZWagAANqEP/Rb3kNRezfbzDlzPx/qV\nxqoJrCrdcsDWoyLN9BadUQ2Hv5SDrIXUYCoBwmN3a2ujorsrQJlkbLdCMzuc\nWIhbAQRk4Xj6uR4543nDGcF99IVMLPbNrzn5+1TeEJIRxoq2ObC0VyWfcMiC\nFp7f7GccJM4ZSvf/EyChF/7z8pEyLykRyU+NI62m3ne0Rov+TKSPXfISVTJC\nBJHixaMeWalXR0ksC6wTLp1LhLBKxmMVqLY6eWtiRal7sH+Ub6UztT+ZXBSE\ngXWzOBsUDkh7CB1jhpdVufxNo1uy1VQIoYdjPmkkRDfAW28mgBNZYLxIDKFn\nbaQJ87pBIGisMTrmaPNsn+eGrnZeAR6KFJHfYrnI7wNqo1rJ6LwIdCDgbvX9\neNp9FRPvehfJSRClqK1m9yrZQZNT7xOk+u6rfq+2Anh60nZ77ju1bViiwjXp\npiwUWQF3Rtb3cW7yrMduR+m3kDApASlkY6sdFl54YV8oVM5yrDEYCf5Y7ZxO\nB1V4iVLIkdXsf3bcFcgS0FptFn+wMM1OkHOUdjisXQLQBP8T6Mset0xUSSqV\n/TJ6NUDQoKD9befnrNuyc8OIRGD8KlIUIS+yZUqdl5YBoB3zHzagXGBB9/7H\nmjpgOITeo0hHAXqPm1NatsNOcApawQxMeyHT+hNQRV3a8Njg2OivOma/Vzdy\nLzUY\r\n=rAnU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKpMxeqMafNWxj4FvtnkaVYDNfsHAes59MTFJRKOEF2gIhANUV/exON1ZlitQEEALxViLtg9S0usmv3AmfybhT/RRZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190520153523_1558366819765_0.029574477461017823"},"_hasShrinkwrap":false},"1.5.0-add-default-reviewers-bitbucket.20190521125709":{"name":"@atomist/automation-client","version":"1.5.0-add-default-reviewers-bitbucket.20190521125709","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c2f1e806aaf24b3fc312f8d7918fcecbd319b8f3","_id":"@atomist/automation-client@1.5.0-add-default-reviewers-bitbucket.20190521125709","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-YxQxWx946s+IxFfkVTg/slcEu1kTwezVqiTjRCO7Tmmr2Bo3Y88K8PegRzhcV4NcgRujZymVuuN5mgBokO8flg==","shasum":"837bab02954252832625f5670e4385bd446f968b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-add-default-reviewers-bitbucket.20190521125709.tgz","fileCount":617,"unpackedSize":2953751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4/Z7CRA9TVsSAnZWagAAZhMP/278qasBvQTY1b28I7Q3\nJkJ135eK2qLUc27T91yBX7Ycp5KzERBhRibspVGvXZWrwiLMGqNmLV5Z0wwt\nLxUy5dts/qPweVlKhgqSptEFrNY/qx+EPBxYyQpTzUq/CPy0JQvYvb561XBw\nPZ/ftbKV/NOUMRmX3G2pkhIY6iFgWUJbY2kpTUIXRkeEG2iPFrlpUsy3PYlp\nMORXSLyVWyxJQKyfLlbayJqX6Ayf1nce/0Y44m3edNzsoasSN8I1lT2QIg+4\n3dlBNYafyDaj7tZSo0fX4dDRwNL7d6Xey8UOPKHZ7x+v8VKi/hL/UGTWY8Rc\nnwOd8BF6KbBPTyzgjbu2d7hpxKDSm8gDKpxc2U5jUK90wqCubUGgsIuhXxLn\nkR51mmiqOYZgyNIvzEPXlXJ0Z/PVrdZ9Xtnyr1EyYsSu61jsZjHtpGYuw/Cc\nzHvigMheMEfjPR/jgSuGCOJKwvThcuLFeZZBferq8WDhyLHSsPAeR24ZjnnU\nkZHnydIdOgOxyPJmbzL/uiasTz/rgBHUwhkKth7kxUKh7Sg/rNwz/Igl8isg\nUXJxGSVl+NkidlJzbLFsmC+7GUr8OomfoUkSVErM3lWU3Vf7qlB+3PLrIs6D\nsKK8Onz+7BThPmXStmFAyhFnRiuGfFBk9o1ukyYnbPECO6XFZdHsASrZ42Xc\nij5u\r\n=Ew2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDH8UaP7SNNgOnuJGar8tKk2dn3uZ5MpVKAt+TuTd7xGwIgHHGP5J4BMbpoACKVeDX2m/STdidZrUrbwfcP4koPgAY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-add-default-reviewers-bitbucket.20190521125709_1558443642322_0.4117833181513517"},"_hasShrinkwrap":false},"1.5.0-question-style.20190522122106":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190522122106","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"80c808eec090796e43951ef29231d47a08401cff","_id":"@atomist/automation-client@1.5.0-question-style.20190522122106","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-WTvWiY6aFvk+5DpdqCz8Fp5pvVQq7XdxUlriXIWb05qahqxsZz+z0Tw4o5Indd2Rqk/WKIJcW/dv0ja9jCH6Ww==","shasum":"b9a96bb4a88ee4deb62e03cf8adfabd95a6e8775","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190522122106.tgz","fileCount":617,"unpackedSize":2950122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5T/HCRA9TVsSAnZWagAANmIP/2AFcR6dXomZmvJ6U91Z\nA0depSmewV0K9kaE6sNlugcO5YpTYpRwTV9hiZa8xQTVbb+0s9iQ2tpwqmWJ\nS9Rd2S2+jsJFlXOax58ic0s6zlSFJczyxgM7alKD1yeRVhSEr6/RH4+Id2Z3\ncIM2db+F56dd++S+GGjDYhIhFOSc+fxyD07KUE4zZJgVPp0daIX5CbzVk5Mm\n3301L2s86emrt7t9Z5ae/EHt00FFdT0j+H/dyQWO8j8uw0r4rGYFZdqTXExq\nSJL4eZoGBLps05Qg5ohl5lBTx86Hdo9N6Y/oh75i0d3d+JSpfRJry6o4+F17\nER/bAI9huzq/j5j+cnw48s/7/DP+HUHIsYcUALAyK4OxWQQJ8chovvxxDIrs\n/b6gDMeFo1L1zJ/tlTdG5AGTNn1hdZha34VJ3EGNOaeFufW3PWP/TJuYMJBS\nOJ4f/IuKAqj8dijCrTyhYrolUKyD4e7eyf/JZXHbqN5x43TTzh1yqTgCB4+H\n+rzR1IsCQl64V+BzCzPVw+TvM8rrqb26MPDKhCaBMxaYC1kNZh4zWlRwJHyM\n2Y9Lu5LqpcJ5LXB6MhHAMoxTAf50iclyDsj+7b4xQUqtm5lnhDKHxDs7vCiE\nr8HkDvQoSiHDU7gjShIHJW0VQsmcQDz7deeIU8ItFoPTQdHamAxUmRBUot0r\n7Gdn\r\n=KrNT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwgXpF9Jjkr+4HiUMwUmEmr1pj46n4U3lS9zGardhH4AiEA2BK7BrjzcHoLyZfOZLsZUmv1+B3t4OE1dm80qYRmzUM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190522122106_1558527942909_0.4505498937666681"},"_hasShrinkwrap":false},"1.5.0-question-style.20190522122820":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190522122820","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"80c808eec090796e43951ef29231d47a08401cff","_id":"@atomist/automation-client@1.5.0-question-style.20190522122820","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-MuvOMpJa6P3/GwoWmzPzwezFal62xZVcdFlyzDSjEO27cNe5oD99w+6I1cdiHNyNiJlt4jzwfh6TyhfvUuXDtw==","shasum":"03a3525d19a617f722f46d47e2975c90d5a2a1aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190522122820.tgz","fileCount":617,"unpackedSize":2950122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5UFlCRA9TVsSAnZWagAAI2oP/AuNToNt6v5gwszbPRhB\nBMJzebW8oFuMDhzE6xStaxmVYVzLTy7DeVjyWxl7uPf53vPQ7x7gxEBOSOGH\nVVjkQTAMJC772EWpynvVf1EFSzgwFyZHESWH1/WRbGm+harIYr3weY/+g1P1\n2aLj0O1GcV9+NCE2dvFj6LA2SI/hndVw7xVxAcI69fnI9fdmiO7KA0lGsHsf\nPMUP9hjP0Ky/RrzUPEEWBtCF/As36NMUSQF7jd8CVzabdiq3WYxCRzr5uGWh\n4+PVnH8N7lrIwvPpxywDDCGcaL3kc4M1AFGp/fJ3RBitT2KLf3ZhuyEj2E5L\nePKU4eGnC8Jv1ufADpLevZ/6tfQqb+a9xgMI4iSWQfvRYiWwe2lyTj1CTRFI\nzdn3/VuYdbMMWqyC/CGAJ7c/oA8j71Vq+zchrknz4SJ+U/NfZr/tWkUy7CFR\nOnyaVTniQyHxscXoIqmzzIPaBRVJVUWFGiJq5Chn7atZUa1HnoSY3dt89n5f\nFkz1/1D1fAML+HwmOJQex8vIizcapIU95/3kHt8mWg5jQOqwY+SXeT3H7Erq\nY7aLCzOX7aXrslsq4oABJ7G4Yog1O287qk0va6KrU2q0EUq6umQ8cyoLb+8x\noevwXld+vxH3X9HUxrN32PguwzcikoAVc3Bv+Tct/aXmSWw4ykpC0Du4h1aL\ncmtW\r\n=p9cM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEIVLlfl4e0Rs7DdrxDVe/lzkz03n4GU33vsmFPcFytTAiEAmz9Tw/UP8X8MICoVKzilEJb/ucVrY1WgJQZpEr1FXDo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190522122820_1558528357103_0.9242278668059725"},"_hasShrinkwrap":false},"1.5.0-nortissej.in-mem-subproject.20190522200544":{"name":"@atomist/automation-client","version":"1.5.0-nortissej.in-mem-subproject.20190522200544","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"49cfe27b180ac1a3b16c24bef2384edc405d1739","_id":"@atomist/automation-client@1.5.0-nortissej.in-mem-subproject.20190522200544","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jR/6BK3O9cqpXZi80iDfeeacFZP7/HfhqmFCfRZIIKgjU2RUaJJ1jk5w5rt6ZXC17VQCXNClvUXUkd0p5K7e3A==","shasum":"c8c5b27ae086bd79ea22e8ee076430443a874e90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-nortissej.in-mem-subproject.20190522200544.tgz","fileCount":617,"unpackedSize":2951276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5ayUCRA9TVsSAnZWagAAmRIP/22KiGlMDuU5H/kWKDSM\n6/faB6nEkzRhmT329aNnq/UmPpsXqmfyEmkQDxJTfaIuNWoRZccq3TbOAt06\ncBIa361TdIwmCK8g0oExV+IugxLIt/lNOLbxA5BmL7/R5AYJ+FlZrvzb4ULq\n8a17XP6iXB2L9tA8MQd91ok1FiGpPjUx7GK9igZAu6TJZTgeZAfx6VIbcMDL\nSsW29DWJ6ilMhWHBXmljtjb82sNaBb7xhxl1TtAsvCoOs4NwO2fkWljPgPk8\nRP2DsHW4IJZk/xDIaCUqw809rQGX9bNdXTKVAiLi2eAFzORKaPxfIkiRld0w\nLgpxHmv27iVwvQNhwskhEixHPf0uWsIh+Pt0ARiundrapsiyrRIL0+xn3XX8\nBGY04LEKgZCbXl7gZUdPJOXRVncQcws86XPcDos1Ec3PGlZOkCRwGnVkDRr2\nyRqKG+Kxhm0MxO9S7n8AcwRVdyRrIq7Fi0CMAwvuJOi/+JF5apXQP1JBVias\njjv3S9aYAYLz16H/cxUIaGLXaBgiEItMd8OqyGcsdrD4dF8ShDb29i/MIht+\nrvbYarWDE/l6BU8vnzV5p3s+rGH/RiNa8OmVjLR350MXBGt9bvgHj59Z6tRm\n5uWsQLCOzE15ywWy9G3eZfKI68EWK/COlUseUx32qqhjfhGauCBd5j646u3P\nFPbJ\r\n=0Mp+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyepB0opi3SjtDoSN42KBu77r0AKiqX1P4/8tU2zSnEwIhAPR5GsSjzZcguz14lIUV2QMah6a6eO5hggfKtUCtPqQt"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-nortissej.in-mem-subproject.20190522200544_1558555795643_0.22677414566815224"},"_hasShrinkwrap":false},"1.5.0-question-style.20190523110235":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190523110235","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c42e1b568909a06d824f868ce83892e548959d47","_id":"@atomist/automation-client@1.5.0-question-style.20190523110235","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-SCdkh7JyYncGmG38a233ZF1j4jjW70nSS//vqI/Y1/SPg96YAOaWDSz07Xma3VeOBDssS35Pha0aZeU8BNxHTA==","shasum":"9e1a7e120e5eda295da566185bfb4d8ac2008f44","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190523110235.tgz","fileCount":617,"unpackedSize":2954718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5n7UCRA9TVsSAnZWagAAIOsP/39IIloobSp6XWogRSRV\nDsEsGaBAaKlOW01iYdBBxMm/64QrIEvFgqIF00+iUKfKKPmp+rnqwD7giDM+\nIUTx1W+jqpyZsemjdEUN2OH0p5At3UvsXS+wfwzCZKrv9yo6ZwrUsp6BDPSf\nep6f+meBwV6lZvROezT/6YFPEqM9fps89bG/0MSWTOstUDgxTPTQNWu+NMLx\nOHOOOv6+wIb7brmlY4Cqh3zpWyUTRy4kSO8k55fKRbdkyhy46e7X8IQ4su9o\negTf1fXUspgfsGe+SYw9kFHKl4EIrFlkRKXxv7gSUQ63auSlqd2XOvd4/d3A\nSq3AczE0mVyReDYqjv8pZeJu05O/5qrHNDcVp0MiR4SYue5d/QEeXUs4LCMq\n/c+RGb6ce9ch7B6EGXjWS5GtBrcnHOJsRMFGL8WVZAz+A3+DMyvuVXNv9rH4\nohNFmeic/0ZkkIXYj8XBtdxMdshnapgETV3km7iMV3+HY5WE6/uwj8REeVaU\nas3N+Suv7ULn6sneBJHZsbVXCKDHedM8ReCx3UxrR65oqyIrUFZQcgFhBmCN\nRGYeEggrHPfAyLKJb1ewedegJZuWqHO5iPM5HRJ9TEO48hwmH+D+3AnlbCzU\nicwA0hd7A5EcvKMHTGMKi0fPIZkc1bkoyJP6YMlxfUbFitj00smECgi1Avjb\nCAwv\r\n=lirT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmxcnJloxS4/jj5uL5Tr+9S8tObbxL6sId/+/MSJZYcwIgMqHE2m9UoOEE8kzrG6HtpZXenDzyJH676alU1FIRjOQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190523110235_1558609620077_0.732386327389166"},"_hasShrinkwrap":false},"1.5.0-master.20190523141559":{"name":"@atomist/automation-client","version":"1.5.0-master.20190523141559","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"992ef4c2b7c31229eb55f959c7d0ccec51413a7e","_id":"@atomist/automation-client@1.5.0-master.20190523141559","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-f5DlXL5XDnrVyku0REsC+vC1Ddlq/K6P2pBFS20ombv2G4eWrx5suMed493e/Sk2e+IY5PC+tC8crvBmx4kuEg==","shasum":"523aacac45f52c89c3718e612d339db66f2ea571","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190523141559.tgz","fileCount":617,"unpackedSize":2949928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5qxHCRA9TVsSAnZWagAABFUQAJ3IX13FKQ55qEb7nY41\nfCBerq4i6dPw2nQ1YZwRHgxf+vD8Qe8iD+Hwm2GY8qS3573UTz7Zq5613sE2\nvfVinC7sQCJLf+w1M2NESDRGqIYU9lroe7sZs5+nuLyk1n5s7dd8Eu4uKh6e\nJsmC0V3B6lFxpI51NsTTCQdQJiIWHMdOHMAhw7qQraHwZ/0x3gvdoULNExku\n2ybejdD3rtmPSQZVm+86nob4QH/oT/6AZIGen/Qt7Rt3y4g3gengyhDv8Pzf\nzJs53SArJeIEp2HaMWGjrsxcFObCNYMNzb2ZS09p3MyDxTle206rfYoO8DPN\n3YjT+X3FGsmSDNpx3TO4yBxXOiwgV8gGL4AI6Vow4baTSOq7L+Io6imVTYAb\n4Ynn/RsDBM5z6mQJs3R2IqKFTAYSPFomx/FyYK5yqsKbGssLRag+werdF0By\neS8LOK8XSfmvg0FbmNQL2S3JKotsAFMpmHEifFLtrsgoPZoAXFu7r5r27WJE\nubpANhGUgWwp0eYPe/O+7jdMYJq950BwnvxrD0jBOIXnW4Q6KfxzmQkh8q19\nPHBYr4bHETuxVMw6Qzd81FUNei3DlXIghc21PwqbUezxgEA8EpMdMviIiVq7\nJ7XEvObac7vrQmcng7rDBYEAyX164KLHGmhksw0Pd7o4TH57mE/o7Tlbk2TE\n4X2v\r\n=vzmu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1EqT68vKUTL0HwP+SSnFmp85kJcoK69N0xcNDu9YIMAiA3dGVyKmh8l7+7J0Aleyb0EQCwhwSuAthdVucZ7/ENaQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190523141559_1558621254351_0.2369223247205532"},"_hasShrinkwrap":false},"1.5.0-question-style.20190523200738":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190523200738","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6c2cbb445b4f6913f944064efd615f1dd21be176","_id":"@atomist/automation-client@1.5.0-question-style.20190523200738","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-rzm9tufC0qOgkjBSs69MkKhhy0ZG/3G3CcjA2ZXFQGSgd4qGkIxgPDyvqGiz2NJtrvd5LCaRL4pFNuPSU2nImQ==","shasum":"b8221a57ab2b31b390fba8e09a5049388c5e5fe8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190523200738.tgz","fileCount":617,"unpackedSize":2955109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5v6jCRA9TVsSAnZWagAAw20P/jqUEitWvG07C/n90xqD\n5xOvCcsWW5ShAkIaQoOZI4aXcBYqWOH31a9E2bMgcYtnBUTaDvKFaDhsFMss\nb9NNYPg4Htghf9dTe7m02GhNwfBcx6BcW3UsGyPT8DIQ3Smfy/SQ5UPvI2In\nwlVXeTGNc+YWJWB1vsOvgsYrijufp1JVVNNXGIZbW/md2/UXCPcH7LjLGPMB\nHxZ+20AITUIYIoNZjIsQ4cKpb98NjDyprMMarnFXZspqs3VLMGCSs6GMjjbS\nDQhiYHn9501zJaGitkaVe/ftAV7BEtwtFdryWgfBXEBSIZr+kAb9DpM/NZZs\nwSZwTlwoAky0vEtiCqjinWmY2rOKmES2VD4v6SFUFjywo0pXojLbhco1jfIp\nliWU4HGynW584PnE6+ajr9p3lIjTnxxRHgil0DRgvk1bi4lKG+QL48WAQXxR\nK8rQ35rLPgrqqB89VBSEyUQtTDw/z8bKcCBEn6HqwQnpKO090UvA+NFCk8xf\nMvID1Sjrsju5iCB7yIQY8LOPUi1REZ6gHzy9FMUu9OKvwb+45YG/qykOtdlc\npeczSbvovrPuWhSDT2ry1yMTaFK3RwO9z1fO99ByVU0Uyp12sRrlg4Gu05Vj\n1p0vRBIJgR3zbSJ+AkZomIQknfRRQzFbADusG2LvI99np/A6Bf7aqADXt5KW\npFLg\r\n=zF5t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmXiXAd5uIWKhxB/CUwChRCa1O7Re03qabqWi5SCXXTAiA048DfkXsbluJwwtDcMfTmZMXUznnBKSOJInOu1XwkNw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190523200738_1558642338135_0.5103659221964996"},"_hasShrinkwrap":false},"1.5.0-question-style.20190523215938":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190523215938","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cfb37944d545ce3b16b7822a0e2308caa63a7c86","_id":"@atomist/automation-client@1.5.0-question-style.20190523215938","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-D+F/HPBjoXvTAJVqi9dNQSWHbBri+c1O6DCtMH+vIGeofctceOeOYDtr5Y+fgpyZvY6bZZSfLLgwQOHVnT4T9g==","shasum":"ca60914f6032bf5a5837de032f498062d4a7518d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190523215938.tgz","fileCount":617,"unpackedSize":2955170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5xicCRA9TVsSAnZWagAAUIUQAJdgKQd9KvUvn8iwLRti\nNlzabSXzMCVZCWOQJQB4TZFbSusOLcGGu7oUC21wx3sDu6cFuhDMf1gYcHAi\nRe9kT8ww46cEsHmFVgOi0fd+ZvZFXdkHXF53/tTe1nCPSWxqA1os+Qv8evFl\nBC1cMpYjhvzMXNgX/n2fqz2WolYJRRe3EJNsX0XtuqBr6N9888nFuTrWLOGG\nuJjUlHM7Ch+5V0UPl32SQgDEl/Mf0PqUsNn3gxlZ3fcEjvupwq1x66xDVnR8\nFuuSGnGVzwMrXXw5ooxMN6jWqOafwL6ME/pYgGVTNs6Clv4tKIsRWx+l0ydb\notMNLbfUg5pnJF2abYu0Y8rpNWQSZ2k5HqgzS8+SYmU3Z9TkVideVoVDZ/b9\nCEFg94gpQJ3GefYGcKzOusZUhoQt8UZ79oFh42RUyJoWhFepKXqdkEts2E63\nUOcXvmNhjnnerPElOGdJANu9I5Sp4w+CVXzlCni6DTQndMWxVts/4TUA8RiA\nCE+ciJYD4dvqQYNxC7zpfmGSLvbYcG/4hdDAobJjLaP1+hXbwaD6lqDVg2gE\n0LTxRojLpz7SnAlWy8BvzRwLPcFDTAahtvA/FvQGt4h+Hrx4sSYcMbqw+9Go\nKwcjcZ4sYGVLVkCxZMqT2HwNqmlDP/XBfmgARcN0/srVcK7aYDKT6Om7aWVw\nimi6\r\n=d0+5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjmzuzudCWua6WIfraPQS47Gykts6JysFMoydcfwwUGgIgFJyNBfE/VjKqndDEMnRTGBqOqrG7IqfExEndHGOME9Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190523215938_1558648987356_0.765558530979038"},"_hasShrinkwrap":false},"1.5.0-question-style.20190524081145":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190524081145","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d4ffab7e219093575fca8104e00572428c141f19","_id":"@atomist/automation-client@1.5.0-question-style.20190524081145","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-Ejn8h3ErKDKKw/jkWZgPPE0LTeuhTHdK+wQT3/i7iOVsiJYXCcMZ7VYy5MzAqz1PVK0Y06RSdp4MF9ml0393CQ==","shasum":"a2368019d37e8becf3365aa08cd81470cbc793f9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190524081145.tgz","fileCount":617,"unpackedSize":2955170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc56gGCRA9TVsSAnZWagAAOjUQAIIf4wCXKXi4XLsONgnB\n2bEeCE2plstQR9oqaK56NAq5dLs7Zm3TMlInaQu89wEF39bCMJOuapLd43do\nlWarXRGYlsRqpzJfDH9jqTUWVy+CkF3bJrcCR8I/Vk5OhW9tdHCWS/3HtbJO\npb94Uq/QF74NaKwY2n16qv6S3vHUho2FpLG6zrHbb0PPBzNOcuS9NUALPTja\nDQJYnt/fSsmObSZM30CCEP0HMNcPGFmjyf/BjMtFlUTxb/iK6v+zd1OtgynT\n5eBTcZ7/5soylTXjQ64HVHhsr1OsNDGUUgkg9H+uqFo7abnufm2WIBIJoMZ4\n5fwH0+vbAo9OBRE/Kzp8DA+8yv3Raq+N4rrkf6kQQ4tMJs0dwjrs7hNLTpEN\n+xOa1TYZbkQIybgIutoTUkrgwGYKV1gy9uuSWyv/tZ0QGvh/qWH7t9Xa5uuh\nZTuDG7ZEXI+TZ4OUAxkfBco0eA6nYJTCkQnAMYTYDz66PO8EbDqUcmXeYiEI\nxFkJa3Il84r1MCDSoXWGUdbNbAKT3l4N+d9PyuZCJH7I+t3C3EfJzSKzPP3v\n7fdSWfaCjRZr6feEH1fsSgc3as1pEc1lRLzpnM+B0vzuo3JbRJZwJiZf1bWy\nQ6UPfktaA5VByfxj871cyV4YrTfQ6T65WsSb88ZkZs2afAsekab4XSUt9bwS\nKUOT\r\n=Wstz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsGg0gVkIODl8QU7kUvkRVX2uhWG0C+RRnf8h9WbhgAQIgZ/8cnTTzARw8dVGv9gx/1lq9DtuUPEOHwoQYMUH2Vbg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190524081145_1558685701469_0.7403726752298267"},"_hasShrinkwrap":false},"1.5.0-question-style.20190524111209":{"name":"@atomist/automation-client","version":"1.5.0-question-style.20190524111209","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bfd9f2d66061c4d891d5c65ff3e8b3c001e978ca","_id":"@atomist/automation-client@1.5.0-question-style.20190524111209","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-pWM4WoQbZyz7OjB/PLM44Ns373NtVilCGz7LFtYlxIWN6wiDkV+vWTPCDJ2pDakUnk7NRhPSxdwNb14rOnhHaA==","shasum":"fc333c0755e01dc6e512a2a8cfa460511b2843da","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-question-style.20190524111209.tgz","fileCount":617,"unpackedSize":2955116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc59JOCRA9TVsSAnZWagAAKfMP/01isrbuoqAEwhg/A3qI\nuz2NwBLVr7AQtfJXo0mzc4WZHCTP9m0JeihNdDqKW0619JRdi6hNQ3JDJa70\n21T14OQKF//SQchrTWIpk0DOT/MnTmbrP9Qt8zOlPNGZTQYwugbGtDgj56IH\n9ZyWRjxD96BrF4WMgD56y6RfTBX9zrGFFO0ualFYIHsZ5Dh6cq122wmxlVcD\nOHaiR2bGyE5mXEdZBHC7GhjFgUP222qsrDXB8GlfCvtd3lnCT6K3mGmZNA7P\nx+zaD2UbKGPBrhzGtBpNKtKhZCz92cNYVo6+8DKql32JdpCtc6HHXlvFYsDc\nB+2Pl6p1kdfSJ1wXJY7BT2ayTn6mdnUlEtQNeAfXEycA5gur2WT1cuj8ZYTP\nYk/p7a0bj1ClFO4g7Et2VMdcv7PnPberLtQa3JmOB/+38YQY5Y8I5nux5ofe\nixgGVMryO3GZ8n3ATZiNKW6VZMBBxshpfy/aB1v0RIjhKuR+HfzvOVT7JjUT\nb/L61kwHz+3EMyrVfRBhxkbswPcBcJp2SkvlXPOgfNBVCB5xliKs3umTpxzS\nR2RBw31FyO53bszFxlVA7c59mf3ydhDA49xYwqdF6R3dvIDztSpo5vZp2khK\nvPKC0tp5BDF9QJ3L7Eohkkvd4E9yhBpUQAmXOBU+mbPCUwNJDHm5JSUOTEsm\n9VZu\r\n=LgWw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCV2K6eFkJZe9VaKEoVWlrB3RKwabb+SvA2xFBqoKBoIwIhAJXpRkjkQfex9CqqKCxhPCyRe9flsqCZsBxLZBOo6Zlq"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-question-style.20190524111209_1558696525843_0.7715385714492489"},"_hasShrinkwrap":false},"1.5.0-master.20190524111144":{"name":"@atomist/automation-client","version":"1.5.0-master.20190524111144","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c099973143dc89b114f9fe244589c4acacb0cf10","_id":"@atomist/automation-client@1.5.0-master.20190524111144","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-F59D1At4vbSY7y203JNqWTSKV+SfRVKyVyWzZJ30bem9BKhgOdMojfHwQIPX7flOqna8+9wSziqZcNjLoiGjaA==","shasum":"41f65dbcb5d9a856f04396494e242e3f00ce7f20","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190524111144.tgz","fileCount":617,"unpackedSize":2949874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc59JdCRA9TVsSAnZWagAA/IEP/jb1pTMT92I9RnK16zn+\n5yu1sUkwt/1AmMRGDqYZPjp/Ap0HrZ2ErkdzgyTG7MramQmnIQCXbspyrALN\nF4PgTOYjSa6R/xC0p5AaJeFgeCHig381vKc6R3xy/zKfvvptpqhqP6wLVdUI\n/Q7oILjhBlDMgXafoj8AgBIOQxa2k7Zsl+/tu4Uu6reZe/S06zHXxXmP410t\nr/UFSZoy/pRmMAcfs+eYcfRn2UzxkifS02B2dTb8n538xlU84J1yOquESEAR\nTURdmtjEgtitAP7SvxhzCkK8I0/r4wglzXCEjdB7D4Q+mg8H++X2nx22/oXU\nvPJxWKMkiFUnHxzhk7cAgiuEid31Dyg2MVmb0YZu8hBxk5vZCd9Xb/LFBldb\nxilyHr9Keo3pL5di+Eo8eMWO/QEboGB6RqyYAvZ98y3XTrNyEP/GNpoP9DM6\nE044k819pkRZNSJdm32Cu6UB9k25zpPzKlyEe7QsQqyXdXO5W5GOYWYoLW5h\nyQNVcuIHktzFOUdVTyYeX9AO0u+tvNoFZlvCyCfIIdFAaGpsjG8lmRKXGlbC\nFrK8KwYclBkyrw0EAHKLnSIh/2vKzHBWX7YrWqucWz03LwfoB7rvSv6A+kbs\nOAVJGq7sM1EKanosFhKygWFa9yTG8oYXGoFKDNiMrTkSN8Ukl5ZBDRifBQdB\nkofN\r\n=RRax\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF64eSNIe0+c5kEW581tZ7SiEVCQDTQpahgs0w5jiIqUAiEAz4pnQ5itIxYGMw2vzX8G2W2Glu0rxj1EyGY+84T6N18="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190524111144_1558696540386_0.5705013838086066"},"_hasShrinkwrap":false},"1.5.0-master.20190524114244":{"name":"@atomist/automation-client","version":"1.5.0-master.20190524114244","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"865ba1f209861f86314e4c72961f791b39ed370b","_id":"@atomist/automation-client@1.5.0-master.20190524114244","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-ZA/pVtgyX42JcQM8EYNS+e3rFFG2HIqJ4qt+N/KpZzBoE8cv74EnVbtgjNAIs+pUJy0/0Cztg/MYRdYNey0Elg==","shasum":"4df50d6d057d026f997a587278e9b8ee848ce4e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190524114244.tgz","fileCount":617,"unpackedSize":2955257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc59mTCRA9TVsSAnZWagAAlJQP/Rc4ZdjQxIoGohGKbhw3\nldMJLnCRZHPZoFO+e9pC9/24AclYgC3xaIFRP0vIQfuCPyDiWzyoD2Eg7eS2\nTZ+xc0BsMeBNodxxLv/LgUmByxIL7usj8R7ToxmqznS2H/ITDH7F95361DaH\nVywp2DQggbD3k02gaeaKT8T9VQT/lFOKuKkZ+JC538sD+RYZIg+CVqR6vn0k\n+crW79AQvmaxQ/SOrUQV4apELdba5wURWOISY9AmAFiF517vKKFYKdPMkh/f\nBS9SWsMOQMPPChLLEhGe5xjmneH6jZ3ejwcvTd1gIzQZ5eqZ6mSG8cKdI4HT\nLNe7qapY5yEBgUQXYnYesyQF/1GVXlQJBub1U3gBwGWqTe0SIhGh5MEJcDAW\nB4GRm20uUtHSnGxe/d0CJLWgrQg0Sa91UWJY7PXG8QhAWvPXj5sxC8WoCRS4\nk2oll9z3XIlmxAz2zt5mWNOkK+PDN73RrSg5eEEEU7U5bA1fpKd0x0BTqZam\nORKv5PfnJ12fSHMgK49GmikqA6SH9FXEr3i9n62/Y1ksWkO6SFAKabLN6Sph\nS9kpxqrfLrJVbynz6VnX+njzPwxhN8DPG8Sw2hTNblfftIfJJWSjZix8V39n\nYDNULAVInhI/Qf6VH/Yms+pFeA4jncL+qiIRG0pMXIzKVj2GZqqZ1YUTeOjI\n/OxL\r\n=2lOC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAldltpz30yep3GhFESWsIhiEKMFzD/yrUvIWAftvxaQAiBchtUNpq7YNCLRrQByzvR8RdCpgUOQeqJD1fHCJGxobQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190524114244_1558698386407_0.3149495667741591"},"_hasShrinkwrap":false},"1.5.0-master.20190524114428":{"name":"@atomist/automation-client","version":"1.5.0-master.20190524114428","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.0.2","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"865ba1f209861f86314e4c72961f791b39ed370b","_id":"@atomist/automation-client@1.5.0-master.20190524114428","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-ZCJ/tMyMnCkSk23+c9WtaekHLQW2B1daZEh6OE6PeLg4tu1w9vz/MwN3Ov9f94HScP71o+Zv+sN64HavJ1fZOw==","shasum":"0d8c56d7fe063f7edb7c10054cd927263fa16dd4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190524114428.tgz","fileCount":617,"unpackedSize":2955257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc59oDCRA9TVsSAnZWagAA80gQAIRnp8AK+Yc1TzuFcyyQ\noirAoIYu8kcC7Gcam23Q+678a4l7jxJ4oJnNrpKX4kpbJaa6RqH4blP2G5xK\nXtzVaYE5raUtHHI5YuRZ64k1yNMUTRhvMBUdSTHx8q8UN3jdTFlwc+3Bu5PK\nheNFWEHCVqDeYyrtMEuj434A/7xIw5A3cpOz3URx4anL2hjYgEsF5leRXCCj\nCW9edbetIqIAurje3h7hjm9YD8YZluxsO4ZEBzCuSEId0/rmzHfuzFRHEzsN\n89a6uTLaDwQl4idB9SBqGjoINLRZ3sfqxbOzz5otiPBIK7TcsdQg+04OMepr\ne2t85FXZuRlXxRm4G4ytv21ytEO5bNg4qm+prjoZYoeOvBKm2u2rqlIXCmuu\nBTVJDvH3Cc7pZcqvS/ckwJse9GncBL52laDqkGmO/qnadMfviOflBJ7kmZDI\nsJ66u8TOD1wb8PZtrYFIf3g9RiBEQ1zLkHL8279w83n9iaaTX4N4Qo+GtuKw\naun3Gha1kCaCGhtig4LJcowyFtdqzoar8IOK9mul4VGoKvx+UzhFrLJyPPVG\ni+kj+eqHm34uPZWWB7ESWveJ63IPzndwesr7rqm7i/cK5xjREBdtOQNVC27W\nc22LNI71ZV3CfissY32J8H9JmV66U8Drnq7P6w8mfTYcaGzo+Sb3wkfWu+nq\nfM0a\r\n=nnQp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFn5U4tKgjDYlMb3tqNhz5aaPKgrGcTT78rEurzlMjA/AiAfgaM4p161fSHvYAmB3AEhzG5py7IxFCaXRqon1fb7NQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190524114428_1558698497351_0.47234304511490444"},"_hasShrinkwrap":false},"1.5.0-master.20190524125853":{"name":"@atomist/automation-client","version":"1.5.0-master.20190524125853","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.5.3","apollo-cache-inmemory":"^1.4.3","apollo-client":"^2.4.13","apollo-link":"^1.2.8","apollo-link-http":"^1.5.11","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"^2.9.2","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9a3a22e4fc9730e7e97e0ec4e587193741cc160f","_id":"@atomist/automation-client@1.5.0-master.20190524125853","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-/btSOLQsHMD+9K2sCXb/64Xbtl9r+OD0zv2Xiyleoq0mXlMOmpX8FfM6zuQPpBDTy8pfoz6zh0P6B9t/ltlR8w==","shasum":"f1e5b35f18611c9938cb50eb5b218f0902e08346","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190524125853.tgz","fileCount":617,"unpackedSize":2955157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5+tvCRA9TVsSAnZWagAAqAMP/0ehnEQRfvYHfu/afUBw\ndHKJIKoxzAWTkTvriqXjv82QgHx6icK5mNFB7Na1is8jdX1Kk9qCdOEUMpzt\nPKk/oULSlrIHFUPJ2Pfu2PIp/1ZaXarxy0Ji0XwYhXY3aXHvxljzBCxbWJOS\nf8v+8U65bJYapQQgT1Scr/FcJGBUP9HWfrCDSm1jiXHCQEX+eYprEMV8YKAd\nof8jbQ7Hq6BryR0RmPDWPvSTbnxPGp127L5okP4CRe2+WlEFKsWpSVgJvu/W\nl6ybQYp/2yvhm0v1WnTuSGPNM3r2Y2jNtBY+fzQ3UkpeR2wc5Fr1Y+/raIFj\nVZewSP9HilCw7uj7x+qvmjs0okrMYydvJ9s8y6F17Xxr/dPgYlpjTPSKlPjV\nlVPHluZA26jLQ02+1eRNJY4oQvwa39JWjJy/UbfvZ7j/9mFB3X1HzzZEdnMg\nAVPWRm7w0PVKyd7IL95wQFnvKk5l0eoKQrfb2tZcuIsKF39UvTWnM98yO4aN\noMh0KGoMfkV0z3pT4/VWR0OAmMBUTUL+drx+kExxAf2WTljjPys3DAGGZVzd\nbjWnbA4efnH4c2mFKgjk/3JRTaFjVyWQKDWz3r5k80mbG+2oK/EX06LZGjbp\n6YHRVR+3+nVFRE6KzmXtA7lxJTGk34UOXJ7FIeYcIx0Hjq1CwEADyfwq4iEc\nNmtQ\r\n=qgqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtprmihfzpkZEvyaYG9fjDnB5lXOy9hYkt6E0paHFPogIhAMsANcGd3Im2sRnJlH17XwRp2iNYOr9VtC74x16v5nl1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190524125853_1558702958882_0.45194414429523966"},"_hasShrinkwrap":false},"1.5.0-master.20190524132008":{"name":"@atomist/automation-client","version":"1.5.0-master.20190524132008","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f8cc0771d25f00af50ea1cb448f9cabb6e0c6942","_id":"@atomist/automation-client@1.5.0-master.20190524132008","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-EUTOh2JYfYkNaGi4eYSbiir0kH8DyQ3MbSy5XFLBkIkj9x5qwYXqQIVsEJOH8UgxOb+zcbJmfiVFgLF3g6SJcw==","shasum":"e7c6b7f57a36d786cc74674df017dd711fceaf78","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190524132008.tgz","fileCount":617,"unpackedSize":2954425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5/BJCRA9TVsSAnZWagAAs2gP/2sJH9yGFqDeJldg+Thp\nKy7oc/gpX6+tYi6/4zz4ve+kp+9JNxcW7Y8Lt5b7jgjx7EPW+SwyYb4puCTi\nu/O2cjK3+wXh2WwFV7O99+E7U/i+Zy3USUR/kPHpJ5HjQDN1ed5y9/tlcRPX\nT571kOJ/3r7QQ5w4tqVHYyT0ygJgl+O3vtqI+wnxvT8yQ711lsEAQjzIFvAn\n/86Jb8FF6k1y1zUwUiSBbNPozWjJNgvVJpzY0Kk+iKKAmctB3UHxgWHyytV9\nEzHG/RdJKxkC8/+BGdR2ZBWo/Rhp7E3aaSPvSdx3J1ljbDlYL+15X25A1T/3\nJ3CL5o0aRtcqEXcHSz+hrTIGf+ZbCfY8kN4TswoPYuIhlt3Di/x1c/JvRedD\nHwN0NotZISnBWSbyZ/d0Jmn0NmbwwGC07R5Bl68ovnhIoVfgObW6R2saPlyL\ngHZEnsDwwSq/IGUVqVu3rF2XCnFJMjdKsXjxdyYZTtPltouW7zI8cgXUJBx8\nVW0tLKAa4BvS7lSdk6KS8ualWy7vm3rDOU7hKXnFUtz0dZUrJIrrj+owpZeb\ner8Wjcg1cPDAJQQEFcmFlQweSwGsQvLg5nRYI0ikyxIdluq+VOSYOlGBoFTi\noRhY7F/q+qWprF93v+w1ffLHevIe/4Jh9uhvJSXwZrMVCYUfQVOWJsxFxiPZ\ndbk2\r\n=rvrk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFs1vcd9EM6nR0vWw2vifHuBWBoF7WpCp2wrDxp74MDQIgBqX76Z2a14CtsrgjvaXCttXnMvNjZ4LT+/mzbPfHUM4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190524132008_1558704201053_0.6982043584506958"},"_hasShrinkwrap":false},"1.5.0-shutdown-543.20190524144307":{"name":"@atomist/automation-client","version":"1.5.0-shutdown-543.20190524144307","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"56c0a7cb4ac4b2b67a7699ab91fcb6af9925a673","_id":"@atomist/automation-client@1.5.0-shutdown-543.20190524144307","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-SJUMS8ebtD5jp+yoOUxtHhCfxgXucMTof5T/+BBLsHoCxkeJOaVC+I9XinMAlEFFZnOoVWSoSPdQH1+g1WbSpw==","shasum":"3a8f63980c2dd520446ab09ca1df69f0a7010dcb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-shutdown-543.20190524144307.tgz","fileCount":620,"unpackedSize":2966875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6APpCRA9TVsSAnZWagAAC/oP/3sVkhqcsrUYH5pcXqIi\nx9LVPLx/AOHnKUAYyAAPMfKqWSwMCwpE4ucJ6k21w9+5O9MFJfoR7qczZz5v\njiAJfX+rFIm+JfGM1yS25iqJzgn1Z2Fn/dc+JTFeWpeVEBztkHghFG2beiEf\nDCXCIZU2vBdn5Efm1bxmhQrmb2mmBKpn0XkhcpXedjwjwYdZPOwAIcxfOPYV\nhkmFUIjQUpr718jYMD5K2JrH33QjNLaOodcEAiMzXC6BvjBWc0dThrxnSr8E\nBwpPMNZUDTwWdv1VwKAuToNBdkzTavupKycRa3XhJ69hwxNS5lhptgNgmo8L\ng0MUj8fDfu9JuaqKd8w5yRMPAuWhWaMLtwkER95tqrLfA5O6Pas8IYpbX/pS\noNGzxfqL5m+hWMJMlOnJ4OV9CPDpT1tNv8cmEpvLH8xfCnCETLD5pJXJ5Q5E\nkWr4hkKlt3cJvgSVWgCTSe2H769pDlZEbbczYSzy/gjaUUxRQ8VCQeHfkhBX\neKDek6oiUIPVPqqAy5pSZCznZngzn4MF6dCa3uE/OWPQltEaVVqEpRY8Yv7r\nKB8x3LAdSA8BATi0RLVusaKDbr7TRpBQnMi0y7CQ/u0N3XQVNyWtoQgZIouj\nYbhYf7JOmPiY5vr9C3hFY+GVo8R6clOJgxnGu47QN0KEwGltvyf9Z/2gUvm8\ngSd+\r\n=Ftgg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+BUcc1N/vK871RwIgszqj4V23poeOZ/1+sXQ9q5zqvAIgcDIL9gYTQ/luuIiAchjQ+fV1zHnN9mGce5t7ADaclUU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-shutdown-543.20190524144307_1558709224347_0.9651232513984647"},"_hasShrinkwrap":false},"1.5.0-shutdown-543.20190524213735":{"name":"@atomist/automation-client","version":"1.5.0-shutdown-543.20190524213735","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cac994a7133f55d96ac3c75dc8263fe373afab36","_id":"@atomist/automation-client@1.5.0-shutdown-543.20190524213735","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-+SIbWbYrPeJZHzFVn1z39fZoCFkEyCThwYhAtJCk25tQXx6lOvpc3RubgJXPXwhCUUmhR+8Lbr8q/UQRGFMxgg==","shasum":"01fb922db9ed6632969afe753ac3299a4508f7fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-shutdown-543.20190524213735.tgz","fileCount":620,"unpackedSize":2969474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6GThCRA9TVsSAnZWagAA/uAQAIiHmHOHPlJJNqK+HxI6\nbk82bs08VTAUDjvbn6TBmEEnIIebIUTOgUOefIB56FmmDPcNxY88XoEY5aRs\nhLV2+yP31EigPHwHuC4U5mpcIRi11fBcdEF9ENnZLhjNwP0OptAQTRqcespg\n4duv9WkDj7aPhWn9Vg0YXXiK8SdVqrIwkYw+rWPuWPIR7a7Gj8Ud0cWtByiQ\n9eoPUqHaYZTm5GDeEW7sfoisEf6YQIlNUs9akiERg9zKDfMCs7RzQHT9uAtP\nbk0NvkEKuZV6/LNuGL2f+pDiNqjGXzPH9r2UGORsHJHdZoH0yasLIycjSGQv\nfoNq60QzS0z1d+RfFdjRStECiA2hPUoV6lSYbIrDpnGKTE5optp8sOILkjtT\nAA7jabCMTEPioEk1yUY90eRF0EOCaVn9S3/vlbj73EaprkcgHFnFR6mewPAC\nxcJt6QlUqH7PdOHRCUGfN6Drh6Dd1mj7XwJn9RkICTxhs8NJwLbQqew2zrJB\ndsE0olJmggwT0Y7QvcQ8itXtgsrqncWV9xv0L58I8Fq1OyP1h14Pg5VJqOMv\neTZeZUvDmYIIk9UFAc8nlKMJlbQf/MWm94XkrVZnNS6Lov0tyg0vdGZRfRCj\nHa+pijRgiizmnrYEIfOCDMR9s4gcHuIMUyJiDq9M7V9nYSdITJEtMjaFNOnd\nO7zq\r\n=uA7s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmvfvgRk9RMJZp61cNp49Tc47EHhDpnsiAGSFTD7BT7AiBUudjVzD7YuJyd3sehwCgej5sMatDbJUxKKJTtHzxVFg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-shutdown-543.20190524213735_1558734048790_0.09377215507715109"},"_hasShrinkwrap":false},"1.5.0-shutdown-543.20190524220707":{"name":"@atomist/automation-client","version":"1.5.0-shutdown-543.20190524220707","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1b2a69ff2974ee7e8541e17cb4480aca3919f0f9","_id":"@atomist/automation-client@1.5.0-shutdown-543.20190524220707","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-vGyfshtGxLQzJzNzQcLQ9+b8oT3pII2xl5UCdE6Wf43Qi1prGrneXPXH+B/eKe0kMKgAFpM5j3QnnudxoxCIBg==","shasum":"cb6674a74cb7420d10d04895ab0482aa5886563f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-shutdown-543.20190524220707.tgz","fileCount":620,"unpackedSize":2969474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6GvPCRA9TVsSAnZWagAA5KMP+wc9D74G/BbzHtgK59QY\nFPk0u3Wkc7BSrNvlgPr1MDSe2b5AkusQ8JzCYBJHCzKZvSv8aaDW95H1nB1L\nReFaPySijzUjRAYH+ao87PTBLIR8KyZ7pdvtPcLGiuqfAaRABoe14b3hERww\nkcMFvJnbP08V8EcX2CobFzFtIAngceDKFZhPzb42Ng7e9mfH3gJg0mnpjlgc\ndllF5BO75R+CHN8KV2edUfl2HiZPXHlkaFm7EbG4MEzKROe9gl/rU49mhhbm\n8MdxHav896z2fYuOuS457ybNZjHACOR9PJ0zZcwtxqtjUgeh9Q4slvF4DmQq\nBRiWt/jvJ2C1I6LyOW/sn3NkFRELKRC3tq96YVaRw9OB/GQan5HmntCkI6Vr\ntFOIypzVPad4oz3TZHtd1S2XBD5STjokx0VMypVebIoFeSQbFhP9cQzx3Y1b\n9ZUDS11TcZWQfvGNmt71WEmIHE2GvaPNDbeMr9raW8d+JaXanWX3JOLHXVnI\nhU+cCGYcPMh6y8cW4aTtVJyX6C6bwAl2LjARcUr/K/7+jzyaz63GUERNDzHj\nAp9uBJ1SHjcXitsbL7ITAGWoVpcC41r7Xsrrxh27agjPG574Adf/lwPgsYh5\nGWf/upmMiuPvqly/2EU7R9zvxyZiCdfrCGV8mx6Bwd/LZVBu5lQQCBoNX0/q\nI731\r\n=BjQ5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGldM3rKw1xG1zLaNeyuw2TKI1vhtwdpO7ddTKqHG2T/AiBPDObWgKHHjnliU/CxMwkZBDEW+eZJAxQCbqPnTZ7+Vg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-shutdown-543.20190524220707_1558735822317_0.8199543195020864"},"_hasShrinkwrap":false},"1.5.0-master.20190525080315":{"name":"@atomist/automation-client","version":"1.5.0-master.20190525080315","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"467e39c4586f37a389e03cb1ae694c1e3cec870e","_id":"@atomist/automation-client@1.5.0-master.20190525080315","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-M+K5udZetvGLSgi0n8B61FIM/rY8Y3p0apH2hMXspiVFfNCl2/uumlGVx8hDexfTyduqpwYxJMqyKwZ4YQxJxQ==","shasum":"e46525e2b0812ea11f4f3b5d254e334641efdcda","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190525080315.tgz","fileCount":620,"unpackedSize":2970886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6Pe2CRA9TVsSAnZWagAAcj0P/3fiug1y756TGVtRBmz9\n4CctOZAgtReCHl5AedVYzfDEDQgryBmrq7m+gbyhKGWazDXCZ36SDtxDGEaZ\nsIBBD/iCMYIHzmfDLRTfiwGsCJIEGXZ0cZt2FOVr/2hsbvGez53jMVGW7cRQ\nZLvx2yKainy5IhkQpX8Yz1y6WVqj6Ute7aSWvuQZ0s/UsXQJKF8S3mJLLb86\nPoeOn06ouNIGgue32f4hM5c8iKjTbHYAF1OQhwjQgwPZkwtA4gia0utnXGXo\n/8j1k2ow2TP5RDEO7Satntd0Z0hOO6rc4KyVTzMuScdLev13evKfsTfY8Odp\nwedve3/iE3juIIJ/dBI1O+1eAsmn01Lpulyc0JRBL700IgD5GFqecJGPN5nw\nj2oToSafzM7bYuqton+jqD/ewQS9ZTehy64S3pHiS7EmvJ5eknOp92pWLTGN\nloq7IwqFZFruL3GBCHnNEGqVI94EnIHIMjYtAraXid+TQsjp7W4Iz7OaDwPm\ncQiNVVKFIRILIDUJGGpe+LpxjYZhridA1zeKXdSSXZ46oV502vje6U3S0sNa\n9bxV6CQu+g/Nz5WKtB89KtrkBPtVVxCg6grRYMsUkmW1QPLyHCDWdZ4umUIu\nsKK1v6YthSP6VsXOmtq/mdUFXJzbq00hcQ5V3YTrMyyHaFvzDbdI//TET7lN\nWu1d\r\n=Tqgy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAV7CWwl2ohYwaeYXclwJ1H7/U8GVNEvLfgKOKc88PHgIgUGSyBgYx+ITZCGt3GhhTmb3BsG9CH6jUUX/BndsqWDg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190525080315_1558771637586_0.29829165913387934"},"_hasShrinkwrap":false},"1.5.0-master.20190525081042":{"name":"@atomist/automation-client","version":"1.5.0-master.20190525081042","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"467e39c4586f37a389e03cb1ae694c1e3cec870e","_id":"@atomist/automation-client@1.5.0-master.20190525081042","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-Hbh+j5t3A1VHULz3s7QbWDahz/+OhYB0MqgLHa4pPBMMAwd2e9N3j2L+XAZ76EPQZy/pRS7bNMJG5pz/XNgKKg==","shasum":"e21fd271eecd410bdd31e490aca485912a2ede18","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190525081042.tgz","fileCount":620,"unpackedSize":2970886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6PlECRA9TVsSAnZWagAAzTUP/1bi/0pbkkX5LcUIniT5\nNIAYD4w/Jpq8rtpDDTTaSHF0D8oKn9NdjI2X70hJGUIzSjJLJfW7NMowRMEi\nXHIgtQ+fN1AiYOPhBsdZCqRVkftmMtv7ombILMWlPIBcahYZvaRujJ5YvdQu\ndCag1dzeyGi1iHO/RQh8PFTjxij33zT2FH7f60wL6X4/VkOBs4QTXJp/FndA\ntOpod5L2KPIUUvjQXIgYDyHDNOyIw5w25/kWKCTCyNfi2gzW+U8PSrvYwOQ7\nSYWK0Yj6jDV6qouFGjdASAQuI3EGnO4slGVxMBFY9XcSq4S5HXNUt06SZ9QO\nB22yIBr0Wgz+CQ/qHbM1Mja/gyI5Y409oJQWc5ETNUBcDl3zOUlxLTf5EULn\nUP8zjJNvyaMQq09RxE5s/m1UlV/oSSwQw70qsdsV+L1GqJhCydtEwqcFDUai\nisxsLj3N5Fjp09y9gCYY/FRTJV6MlxpX5PcgW940sw2uaScTsEB0V52JRnO7\nrDgJsmx6W9ZXbVjgxgfdByKVmMmekkGvM4WBxHMps0XF7sD9cSKVb/rv1iLf\nWbyaBZwL8QenwUXE5Ca4h5m67WyEClpV5Hfl2IZKvQxEc1ZyvoFuyvmxXtMo\naSa9xIAJfvPlvwZZA40eEO+CmpmMatkGIJl5F2kxaxwqhGgUHeclBlG879G1\nCTGx\r\n=g4Kr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6hsYqJE1RFzb6FrDUx9esZ9gkih8JRXcNLstyCnvk4gIhAKFuqF65qRG8fWwA2QOM1WC65wHiIPexU/Wr+s596qMx"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190525081042_1558772036005_0.6576900450312395"},"_hasShrinkwrap":false},"1.5.0-master-shutdown-543.20190526182451":{"name":"@atomist/automation-client","version":"1.5.0-master-shutdown-543.20190526182451","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a300940b2bfd43343c2d78b78e0c2fe03f863313","_id":"@atomist/automation-client@1.5.0-master-shutdown-543.20190526182451","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-tOBVDvoNlEXm+go7CZNILsvpF7H6WLmbigzIQNSZiOQXjubo/MeVYmhzNCvgLy/RO70/cPMo+OhMRS9xPOXLrg==","shasum":"094aa72de35fb0acca2153a627ed62a3c0f7fc1e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master-shutdown-543.20190526182451.tgz","fileCount":620,"unpackedSize":2971065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6trLCRA9TVsSAnZWagAAFtgP/2B8/52y1/HwRMkLFd1A\nZcZx7g+i0lWDhPjC2dfjY/ItoAtLFbfBoS5ExapPaTpzg4rK6LgUuR+Lqldd\nkh2D7/4rOgdj5toL2sT2qb+IUi9MVhU7Zu6GGAhBoY3bPqtvs89HKYYPho9h\nbAbX+RKLqhJ0qvZiXnaompfdsVXCPD4x7TgR9SyHn2Mz81sGSoCmzbIEG5O3\nvkZCcOwfDrdaYvXDdqB8qIGIEFo+mE5p10R0q6ToMO363nz/VRQwJWjmV3Ju\n3HEpESk5yTe9xrLxU4l3m9ecyRjEhfaY5zm8pfa5m2eMnrzP/gXBe63uLEKo\nB8X5C+rNVhuu47tjCeCrWgwM7HhFy+DyW0UIYFCtrKVlJcbl3UPZe4iZED3p\nB9cwcCcl8Jl9XNq/iOyht7WPY4tmZhoqaOuZpXhvm/agSSz7TfNWwKBP3Aci\nY9RZsISJiMJeFiNkUorrw4GUuSHP0F6Cvc+q10ioW3V720GmkVmocvj07iXW\nGJhHBp117nfm+CtMYMEG2YvHVzbczZ79Cw8lFfkuej6djwrcEQU3aeUVEJX2\n3QjDFjvfFYuoXH3BAQbBqGljyqvyibWC99khAu8lHMSR8g9QfI0qEupOtzMD\nVZYZfmkUYDyiRqmeAnareEP1TofkDB3CN2oxeK1w5qJHaepbJAZnRAEpESXe\n4hmi\r\n=n9hH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsATRtfKyT7uBCK6gw6BCcY7gZqdSarOXAoqRU4akBCgIhAKd8vejOgMbZCgROeOL1zHD0DJnD5/rMLGydjs6OeicR"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master-shutdown-543.20190526182451_1558895306620_0.07944956604105946"},"_hasShrinkwrap":false},"1.5.0-master-shutdown-543.20190526193010":{"name":"@atomist/automation-client","version":"1.5.0-master-shutdown-543.20190526193010","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8a9d8c51421dc1de66585d3af8a18345f0f1b6d5","_id":"@atomist/automation-client@1.5.0-master-shutdown-543.20190526193010","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-IP+vWsSEqZFQLhtw2NwpMW1YV3nonwkBTv7b9lLKbvGkYY/eT23c1IyFsWdlcnOy4/I61kdnkRk6SPSFtK1sig==","shasum":"1ad8636f33516f4f4f7e63a1c0bac7cc6aed2f96","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master-shutdown-543.20190526193010.tgz","fileCount":620,"unpackedSize":2971336,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6unxCRA9TVsSAnZWagAABVsP/0Ok20fRaWzUy8WdDWp8\nT3SNJTHn7+PItuhttYiRhztXRJheIS44mub5MYpzXYd21g7DZ1QjeLxcuIxq\ng18x5BEXRtcHFPeNRM/MwW4aYysNuKFukFJmq/yTQ2QiwNn962MOeSlRLCQZ\nkz1R1uRoumoef4O4e6WSe7PjjIWU6+z58kFhgRPb6Go7/00uSuZqJk94L56g\n6diG5vs7to2ZkCNM1AlsmbBffeD9zpbQ9FQ12zt/SzRoRIJACx8ZqAZtECUW\nQchADRLqEDA7i3hlgXRMmOTqAhscupdIr4cdAXVEL6wjh3e8HF2cDmcJcieN\n6lIw0IAsvQp6pQRS4D2/mZlEXuKnZXzpkiDKBog6q7//xqNWHkcEG6PLVuD0\nJcKvz0t0x7hDfUU4FAPFzKhVJQ1mXxR0wI2xeVoceIgJA5XwsP10Re1Qe1T4\nUPIDbnIf4tJnJi7Ee2ntu6KaqtEuk2VLSD8+akhqrqedJ5uocgDPb1ZM9NVI\nVW9/De/szvY6MbtWAuDfnxkDEKCmj/VEHg6yDaSXA1+qa542EGNI/xLaS1yW\n674ih0ji2OiIRRupR/Yyw3GsHYlbzLJpui0mCtg1o1xJCSRCcxlftD7eqI6R\nQ72eXZcuEcz8Xrs2msm65qDsKF0dpFxcs4ptt9oznklI62DIJ9+SZo5FlYWd\nwkgi\r\n=nKbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI+I2SAqfmSVs2hMNOuDfW3PmTm1YQPrmgyZP/SkKsmQIgC+nf22xvJfrtX1uJXu4RDjwIA1saRbCXFpDZ2uxMRYE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master-shutdown-543.20190526193010_1558899184933_0.041373149982472546"},"_hasShrinkwrap":false},"1.5.0-master.20190527132708":{"name":"@atomist/automation-client","version":"1.5.0-master.20190527132708","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.4","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^5.0.5","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.42","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.121","@types/minimatch":"^3.0.3","@types/node":"^11.9.4","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.7","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^5.5.0","@types/shelljs":"^0.8.3","@types/strip-ansi":"^3.0.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.16.4","express-session":"^1.15.6","find-up":"^3.0.0","flat":"^4.1.0","fs-extra":"^7.0.1","git-url-parse":"^11.1.2","glob":"^7.1.3","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.15.1","hot-shots":"^6.1.1","https-proxy-agent":"^2.2.1","inquirer":"^6.2.2","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.10.1","semver":"^5.6.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.10","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.0.0","tinyqueue":"2.0.0","tmp-promise":"^1.0.5","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^6.2.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5955cbe7111cd5282f38d5525db15b5c88eac012","_id":"@atomist/automation-client@1.5.0-master.20190527132708","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-3FEUPF1PY9ghteL8lm0hSMLepAl6ANAt4SmLHC8A4CZXmMszpd3SkIUDjhdWBxRdQtyfMXUtvn83pz3WM5SE+A==","shasum":"c3fa34c0fd7a2d95e62b37e1351fbe253028be31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190527132708.tgz","fileCount":620,"unpackedSize":2971426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6+ajCRA9TVsSAnZWagAAmaMP/3d6NuwT3sfe6TE3kTWb\nUrB91PnqsW6+IKSPGeUsEdTwnDSfoHFI0RGEvXxOWr0ztfSAAed4J7fNW485\nEU/s2kQqKd5oKwuBj7SXgSHEVc65cEvmAsOuA2W4QCaHoGcWDOiKJKNMJrBc\ncWe30PIzq4G55JImGRrlAgeGmTlxyfj6NObCpvEc2o5sW0Ds+h5/9psPjGUr\nhHD0tI6N0elBCymhvJOz9a9tNIFpDcUQYmIbPTaC0QjZ3Xb9Mkt9Rf42/NHd\nYKq4XcT4K+vwo8usH3t2A1Em4aYm+aQv8kvdi7eOOlkNseUKEe4LxCSeCbeC\n3ti/7aXaaNNxfUZQmU18Xwlu0Wk6anNDAUuWgv9Z/ECMvzJOBvBq9I3npmCK\naTHd9zbDfbxX5sex9K/caR02OTKr2rCIUaicZkDA7x8qz3VtEBPVWCG0IC7Y\nXG81z8Sw3olCCpjg56hBbMyHkfryqOldoSV3kNu6oiHBVQ0tv8yacSIMQ+zD\nJOvMclQIe0EDaXQ4NCTM+eQBegw1DLUsgel0wwqR9sTUXpgiuDVFfeIuxlel\nsddG/tI76ORe92ESGet+ZsmnnfHYBqRhNqnqxrM4A94Xo5K7C9iWBCLm6fS2\nVVX6uNon09T79XsbZasprPBxeNxrRUToDJErcT67wO0+k5Ygl5RdpUV5+1f2\nPYRW\r\n=njvm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeE2Twic/IZ5XC56Zcb0jdOTOHZwt8dPrGbsAxCYemvQIhAMNbRalmXKkv9zqJ+J7mSx1QOGbyCQukE+VsnFENSTzZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190527132708_1558963874665_0.1095226254665509"},"_hasShrinkwrap":false},"1.5.0-master.20190527141005":{"name":"@atomist/automation-client","version":"1.5.0-master.20190527141005","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"95085f2ce948c0d85343a8f4fa6f933922a90a95","_id":"@atomist/automation-client@1.5.0-master.20190527141005","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-pvQuynnU9LXwzh4m0NQzi9HJisMb3glM0HzeY+sv7wX0/FO26sPsrj8HoCeSjmFMIekEZ67fGIW/7BhzPAPJDg==","shasum":"744f33170ef3fd0e7f777eb61ba280be2733964a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190527141005.tgz","fileCount":620,"unpackedSize":2971444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6/CDCRA9TVsSAnZWagAAYc8QAJKtIgF4+eZnXxiKxYH7\nd5OMiIVvxSd+I/vqiqqX66HSvH0glrO4SMhTsI85JO/36YtvD7+DV+Nizr9k\nQ3MyqQbpvEKEyX6igKPmO4loylpoZPSfKRzhyZZZ6jufUVvygTGIx6ghyZPX\nX+kAxmEiT1jklmCi+ogArgLn0utkOwuvuLXdzqM/Q5xXaYv7tZSXRYyeQeUS\nyH3tjOLMP5vW3pZgewt5ELJykcGxhe6m9wKhzugFskk7dKiCQ84dWp/uVEKz\n75FmfNT+OrOLz74mPTx0PLdo2Q7if7s7RFOkwO6l3pcDiKH2W/7P68Jhttt5\nn8j5vS5MjHy0c55ERA1uCf+UmwYAMk3j8cjBmd+QfZijXRoo+FQPNnbparYh\n8V8A1j9zzdALCTWirmKdiz8CUW1PDTuT0n9Yjou8HARx64KrLh+aH1GVHhJy\nmllMD9/us1YItbzVzyMfkilr+1Mqz6IkAcrjcv9rIQULTVf/SYD0fx98Ooyr\n3yEjlw2R8trwMBsHJgq9T6WZu8gKhhi2t6TvGKVPA++Uj4C4GgWveOaQL9rN\n3jenRGIAirchModf+KvAG/9IuucV+Mja7Lfrhy3GMztHxszeosGkxfhppK0/\nvFA3b5YYcOu84j063qHZFO4ptdMFrgXbrr8gVLYWya7//qD0UWi+JQ4md7kd\nfnLU\r\n=nt0V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv2cwc0KvFFE4JVy8JUNwPYFnWRl8Bh2laOZUkTdLu8wIhAJbSWHOox72OdBIJF4IBD8dQULtP54k41JeYW+mLqs3e"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190527141005_1558966402436_0.3127227068284517"},"_hasShrinkwrap":false},"1.5.0-master.20190527205706":{"name":"@atomist/automation-client","version":"1.5.0-master.20190527205706","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"85502e6bb015d1fe6dd5724cb18c4ec63d190d93","_id":"@atomist/automation-client@1.5.0-master.20190527205706","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-2WUUaSKxjMludg8+8ZUzMW5rx2k4pDTBskIQ2n8LQVvVuUyyU5JZ8H4DXrlzYbiJp904qN1Jg4KY8tjL9L1ESg==","shasum":"3541bd58d98869bfe5cefdc826442de187b10622","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0-master.20190527205706.tgz","fileCount":620,"unpackedSize":2975645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7FADCRA9TVsSAnZWagAALC8QAKDmaTmizC4Hi7A6tsCw\nqZ2iGV2p1CGe8C5HNKdlVSn8lIum816BpvGUHyv0uTeDIX0YzdOGz6Zxu5Gk\nWc2MYeC+wjywqjlKLOBG4gyZd3MYuchgPsVEaa9pz2MXFBZ1K09MMZ6zRzcL\nuYjthPoIO1sVo0fqR8Fl7M0hcXK5KpIwqxnwilzGdarRByj/GHaurI5u5Ywg\nEJd5me4AEfniEy2cD12gQ9b7QD3QGbppIbr0a9JRqypo/0gnFamp71P0RkIn\nHzetWB06dkVM79saP8RQj6BaPdj9UimvOEjb+4VRxABH9SVPDfE8FUlC/qec\nPc9ckPqtHY9kWzGL9pBc1VczDzXbIqNqG1iIpY12SjLx22slsl3V1QgzV9d0\nAEVgw9468XqYOaM7zv7H1KiemLIq1tExK4WUxszg5PJFD8aPr0OairqsplIo\nmEH7ihAGpIIQk7EExFKfUAGs8StG4woDyXNvOhy/PUemw+Jq2yUmZ0Pa6aCe\nK8m1Bqt7lleKfOdX+B6lJgckObVrcx6J0UjWeBJvwyeweAzZwCLkshNb+rsm\n9GwhRLmLRy0FRrnP03QSwvlukxoTT6Rezvye0xYP8XD7ACnFAObmWQqh1kCA\nCiCm2Qk3WZmjVInjALLaaQGCEn1YAUEASy6yupHLDglW/XB4uJUUmSlhhYZ4\nR7p7\r\n=cjFC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWJPfvIaRItX5+/cOFj62YIOqW3D4Oj598ujy3eDQC/AiEAq2eA6KL37s6SgFbtV/Dl5jLhuPZoEG1Jhyp9hCTYnrQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0-master.20190527205706_1558990850593_0.07382178246066995"},"_hasShrinkwrap":false},"1.5.0":{"name":"@atomist/automation-client","version":"1.5.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.16.1","graphql-codegen-core":"^0.16.1","graphql-codegen-typescript-client":"^0.16.1","graphql-codegen-typescript-common":"^0.16.1","graphql-codegen-typescript-server":"^0.16.1","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"38eef82449abc014e0399104662052d14a22dcc5","_id":"@atomist/automation-client@1.5.0","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-YnBpHDV3jaCYWzyhMspyZNZzxoE7id2GLDVqIKO3MzKUvSnIQOJpVDT8Nj/3hNXK0foNO2rgUTbOkBuq6+lZqQ==","shasum":"dd6d70705ecd03d4e37574d240dda7506f60279f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.0.tgz","fileCount":620,"unpackedSize":2975623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7FBYCRA9TVsSAnZWagAACLcP/1Jq3EYUUp8Q6BeSgHfD\n8i/5R/H7gIUoprBNbdwE7t96wPC6LpDrYQn5qXsgNQMHDGLIX6mGoJq6VqGB\npjOucjlJdRw/rxzolMN2RRuwcgb/Tf8oitApipQckdHo5EAZujPn7+JPAATQ\nXv2Nvpae363dCIIk/2HHwLkW+Jij2B71pmzC/EgRiPQssK5RVQQL6av7d+Qb\n8++xWdEN5tiklBnAOi7FyRn1d0mga9vHlHW3G76XZV5fIkp2bjTRxkTsF4rz\nn1DDXeyfVyCqtyOv2HiBwLxrzSNDUKl7rj4bh8iHD97/KDzUPzz+4vnSZ80f\nafenhQ9vg9wLsnuOErQYhn2Ar/K0PxxhzR2z9jtsn5rw4uxXEYDHHlRR9Y+l\nIxaBUj39SkMBfOjuJ9+AUHzIfAJaR/dG6p7ZkuEuOY9RcPnqvsxDS8VMHTED\nve440S9rukf5WSsJlLzDHvEhb8Y3sOqcQx4hweWUtmB0sDannUh09qBeChn0\np6LrZSFIk1hwXVsRM2oxAvU+GBkVLDlKNisIf5+a0CeHK6UFyA+jsR8mzdvO\n3GrjI9F8q3O8UfIb+s3SjI/+hWoB76qCS+WL189XSpUJfiMf4OPg3glvJYWY\n5ntOtyhOMarf3ym26qnCrt0uofowpfuaLWNIcgRSNxwfMAUyEpy15ihKRWKN\nBgZ2\r\n=t3Uy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYJlHURjcgFUTgVXSeMey1vGqwD2dJLMRmDozA/mFjJAiAH6nUKcQQUQobLS6WgLQUtWYTxVQNfk59WUPLZVho8Rw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.0_1558990935838_0.6252873233346581"},"_hasShrinkwrap":false},"1.5.1-master.20190528152631":{"name":"@atomist/automation-client","version":"1.5.1-master.20190528152631","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"eab8c3b378afa97e987b4121e19a4e6c92bcf17d","_id":"@atomist/automation-client@1.5.1-master.20190528152631","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-5s6gsyQl/yW21f5TAwYZwtO3GaDoljk0ElZyVczl0g94eVqhtNZHHK9ZpDCchUbkyLgC3JyPSf3jF6IX+0ZfpQ==","shasum":"2197e1eef1bf9cc3adba42b7672cc5710a3f5bd8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.1-master.20190528152631.tgz","fileCount":620,"unpackedSize":2975897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7VQuCRA9TVsSAnZWagAA8vUP/jC9Lr3Og+aa+VGkOTDu\nAJC7WxrT/KOodOxQQpjzkwRYZmRKcGxH53cfJV1M3/lC+yVBM1bY7ZPSNw8M\nKnWezK28W9fhMtiRQsogfdtxxXm7Lo/XMUHz2qQSf9UDenMJIJqwBzT5rpVV\n2E3u2NsUlPPb2tCRF/oqn1qVR20p3TE37O70aT9d3i0qMxhsHrJwP+ClTzIh\npTz56JBPcupcJSLHqdFpO9fG+zVpkLR2TtvAmTLczdpqpywhrYvBTAR5l/ln\n80EBL0M3Ev+pyjh213aZJjJiJlf+Rq1kodz4sULlX6ZWqjwRQXwJ6Uet4nML\nTLKUsCzsfbm+6XoJ9+rg+8qIJ6v+j3q/x9HLUec3bE6R5G+uQRSA+Q4laKCm\nosaJIM0jy29fjrWXpSsVJWh0qlvD5UmeMaZvqdxhxzEEpEx30mrDJmXy+Lon\nFhxFrynC0/wemsUC4S5ENytP/GaLHd1iYhgeAbPEEZDtcV4SEqqUbaj0Slte\nFuA+fE6EPfpmq/fPAY5ASf1o0h+Bu1iYrUNDVMFdiBac4vEIo+u8NaU/HHsN\n/48rsBAxjBnqL3lY6GipFzrOwMvaDj4e9+Z8RI1oV2y5tfk2GEsmv86LCs3F\n7hJzUTrTKxlDXLjiTbYl2gmLh93RvySL2b1BzSrXrYVVZ1v6AxecEjMhYpk/\nUiva\r\n=onKb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQhA02rKNjZgBEom/2erB8xn5sZeBa+ZWFyjWuUNimfQIge4ezL0awGodJCGXyQb7glwvQXmHrE9azIEbT17WSO0Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.1-master.20190528152631_1559057453366_0.5473423416662135"},"_hasShrinkwrap":false},"1.5.1-safe-exit-543.20190528194959":{"name":"@atomist/automation-client","version":"1.5.1-safe-exit-543.20190528194959","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"360d6831aabd00cc94cd8939cf5f27a14ea538c1","_id":"@atomist/automation-client@1.5.1-safe-exit-543.20190528194959","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-seRXdRfTYPIfIUWGnEjIKFBqespiT3kdHC+7/Jx19SUDB6D5jMJ2itRimek4Pb61KjWXR5w7yNG8zF7nqbUa2Q==","shasum":"e548a1a661416a1466ab2e91b84a5e5563fae8fd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.1-safe-exit-543.20190528194959.tgz","fileCount":620,"unpackedSize":2977908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7ZHZCRA9TVsSAnZWagAAlf8P/1Tq4Gh20F53FbSEWKH6\nNII2BFfcKJjqp2hOCKYuHFimdmRhExMDH+OqIOchV5pfp/0dAI741qrfOGO6\nxKfUo8XoClYZXbafpCwPqSB8sG1ZaIWzZ0p3uJzrRYeNIVNGbQWuxsSF4nds\nepviXftBVDj7eEjZpfU/eNtg855LsEQIDPc+nwb6cjzodKZshDdzRTOEpIOP\n35hDCDUqXnFPa+nARTLskTvV+Z9LqgBomICnx/5EnDDHDxtD68+fAe5LMBqj\ngG0mhAtq4+yb/CIrD1dcRvfmt941ANJtXQXfX9Ly2th/VALcffxoDuNeosV2\nEXGJp7FaLcFwkETB6Qb6qXFzAQKc9ltaZVMlKNsfNOAanouU3UoznXyMxmj6\nlebm2U+32U/aUFzHHM8sfha+41GFL3RaC4TMCpIXHnf7MN5oNdBmLvC6se6C\nb496gW+nyBD8o0qRtKy5vtduSNRmwBi0tFsZrCrC8xEr8JvVPrdBTbo1SDJn\n6a6T/YqEgX2xElTRDHwF8GoxMQLPnHPRHvwnYj9F6PSems4NGlNXww323Aup\nk8MQ7H5WUZ3N4HnYq/KMpVwTw1azgUBeOoSoBc7xu/lOq8kCbtdMx18XOb+C\nDq6ehQdz2o265IrFqSURnhUVw9mgWGPh+I1kro00BHd9k/3/Z51Rfc9GeGdP\n8XJV\r\n=t3SI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUPDy/SGX6KW5lPkVugdOKNSJWFKcYpoCn8XMAuTB3IAiBc1euWfK7IN5OCnmGOSt3ZPG9Vs8AaCrztJbNOdQQauA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.1-safe-exit-543.20190528194959_1559073240894_0.8486532573834287"},"_hasShrinkwrap":false},"1.5.1-master.20190528210851":{"name":"@atomist/automation-client","version":"1.5.1-master.20190528210851","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"824a16b4b54945d36ef2d343fc5bc6cb8dfbb908","_id":"@atomist/automation-client@1.5.1-master.20190528210851","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-ktEdUAKm92yQtxx5SP77+TWprmjro112IQshcY5otLIIJawQgDmSMl3o9kDAKHIuwJcV4pJ5YsVEkTlMETn5pw==","shasum":"c3f5e8241034fa0e8905270bc6d3a828f0d1bddb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.1-master.20190528210851.tgz","fileCount":620,"unpackedSize":2978021,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7aRDCRA9TVsSAnZWagAAvoUP/jYIJdYYRoAjXABnkkTI\n51GK2UbHmqmujdoQK/YJ8CdOQFRshlcXm9/Fx/jXTjbRpF+AkVFzGTDM9DWh\n5MxdLIkASj11hVkpruylZtnf3vaxgJXBHM9KlheKfzy168tU5WOC3B+K6Ana\nkGOGY1rRUkxs1cYMY1Z5cfWv0HGGPwHJgjx8eMOd1dcL4cKy+E/q5ZKm6Dcf\nUNlL/0sLYT6XuzwMmTNHkccojQLkWcu/wljj4qYEacJ3hgqW0VVVvAMPoD9s\nwNFX/LRX5xT7CDUUPRYET6FeXIMjMWvneUvVlOGkMeJu+nKN3jtPs1y8T+R3\njfojUThNdJbpbXxDWyFR5RUu1UIf3OIuFnfP+a0BS7Dg0AUCjQvOJ33RL+0M\nuz89hZnZvv1n5V8dI/1RjehmpB5t19zaML+gY4XXix5Ahs7lDpttdbi5mrsX\nGUVN0Zh5a1mJPKeczj/SbBO/yYvkNh7hat2FYSDPlJgNw6eXxLCdMVm/JRRG\n7RO9N8nArlwnJGcBNK4jNGVFWRX4zDfv1shEutpI4PGkwtJG0SBUsrT81hXe\nMy/FwvS3SvK/0h1TWXbioQGbwyRSvlcOcOvQtanvt9+Df69fVOugw0UUJv/H\ndZmoxU1VEUahDXEfbTHyXLG4HXcvIUUPPZaEscODUaLm5/hlhgVVmLUC5Z69\nh2Xh\r\n=SPKT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrzGPQyH4PDr8kdBKs/dX0dj10MPs2/xpnCB/cRJiRmAiEAq1C3TgS+KaPfM3oG+CHMoiWDHLUW9AxDwhO0wxxTcug="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.1-master.20190528210851_1559077954257_0.8467188876954848"},"_hasShrinkwrap":false},"1.5.1":{"name":"@atomist/automation-client","version":"1.5.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"17b4f675092c2b0abfa7760b8eac96936437be8c","_id":"@atomist/automation-client@1.5.1","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-VUsqD33PdyzmTgFchrfbPRfGXn7YTbXXw2yE4UZ1euvnDuU8NfjI7N2ooCY1qf2Q+3+9miabEC/vJYsdAfcEAA==","shasum":"f2961f75504b3ad2b16e3a2ec6257519e4245207","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.1.tgz","fileCount":620,"unpackedSize":2977999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7nVbCRA9TVsSAnZWagAA5oYQAKNlSNmOjLqnXFMXjelA\nBBoOWiQqE3sCRMpi3JdrbbUKtOkFTsZE7R72T4EP1lN9HqQx3CDRuMeorOsq\nEVHolwaf2Ctb60qujn7ZX9MpG4yfMKEWBrvoOgRNeydLLzMEPKF4pw1p/eBe\ny9uC4fpAYcxoc0DTy5RPPm/6JUMnhsEOjrxOGCj5egZTHs1qX1xLet1PUcEG\nTHVh5qrUI7xKfv3owqQ2ehQvfIRhKrOaKz061qVL+YrrP6pt7JPkS9asnlNz\nTtDBMcVnLgZfaZZiigjFPZAk5imlfGLlWN9olQZY2qdRMZrvBxnuvIOoovi1\ndZQOvfO/1DUX6023h8topyvf4MZ6c8VudlwpYzjMjnAJuu9O3xr/c1lU7fLi\nlj2+FZ4MNCzvwB/dj0ngYlIjbb3Mgb7uFwBJtBqFmmwUdBsQWjlCYp//wdts\nHjLUUMMUwh27iLOZ6obGr6UjXYsUG8XMAX3Tp6wE3tJDkgCTBmBqC3ZKU4bT\ncCd3ws/sI/9E6okqXu9DtXRnr2HisNVMPuMtgacX6y4S7WKU/OgLCcChqQbZ\n9lt/I9VXss+UfD0hdMAHu9OE4HPoLMF6aYWHpGZng1juqwODcwSmuv7dxNlJ\nVIyZnloSXBBmb3ANXj1QAlWDu3hYzj/RcnPOadjMcqShPdTTyu+5bRKHrlSN\n8xxl\r\n=PprU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMHVNnNgwEe++Z5O2pv80vSYxd6Ycumw/+rs9zjYU5gAIhAOwEfa0DcuHN+IQuZnatlyPKElcw2d4aFCOKIxT+992D"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.1_1559131482060_0.059037504841649824"},"_hasShrinkwrap":false},"1.5.2-master.20190529214058":{"name":"@atomist/automation-client","version":"1.5.2-master.20190529214058","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"078fc93b11a2af70814163124a4b6a71f78461bb","_id":"@atomist/automation-client@1.5.2-master.20190529214058","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-24Cs4R4IeS41KhbPbM8rWhyPJy9vSKiDEqAP1j9YbxRkGI8YTn0ag/izbWvgHDlndCyOAi7ixGN1i42QyHdEmw==","shasum":"35e481068fb3fcc083e75404a464f9904f879f5b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190529214058.tgz","fileCount":620,"unpackedSize":2978333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7v1TCRA9TVsSAnZWagAAeFkP/iaYqS/IQ5jEZnx4U1Et\n/11bSHLbD+iTOrjVZ7eYAassLZQs+7tNLonqBd6bVtsGQbqhje2nNPUFJg5A\n3xG8Zl7sB4Yhr4mFlUhX7cGJ5ymutrEmblznm6x6O0mtXja43J2km4l26dmg\nb3NIjig2MyjlYCzJ+UUTzMlI/ionNTw9hOteP0vi661jQuskz00czY03/AEp\nw8D39URkMSmQOj5kvZbLl4t2u+w5BW4bzMWVZwaAbwpOlURL9QCw9arz/TJ3\nMe/OfoyR0anCqyKqySzvEUTZFTqRkXDQSgl9/1aDhdieIKulnE+lLyjCFinS\ny/j4xj+uGD4yJ7lv1yn0o8njoRwSMI4JQzfLpD2lT9TtUynnK82CqPkT1Psn\ns287u+CrmXTzCgGvxuQrTZqFAbL26Q2/tRNF22pGmRtN0AopM/mE0c0aTlyu\njaUpkZeEo3amYywljDF4veQidGW+GFjQHFYnYcJIw0vz7CZymSAzaEps26o/\n+GuhHPY47ogO+rXKyNRTnEhtROoD6Zc8NA4454Jed+5o1k+EOrp66BQH8Lkj\n6LMe63CjvnFmrXDatbSUQ1Ekyt6te90NMZvsKrT+E61ptkmGZZe8DGbVh8xd\nYZNle/snaAQXT8oyQQtumXxGHWciTBMtmWqJu0Sd/0iQt30X0CA6fg6s+0WV\nq1fV\r\n=hHn7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFST1Ac1ktJByu0yC0HFvWZ8Mxc9woh7n5s+93ZQkV7NAiBcxG+q0b517/VAD4YBQKmnZJ8VZ2+6jcXors1Jcs+UbA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190529214058_1559166291082_0.06160237995131923"},"_hasShrinkwrap":false},"1.5.2-master.20190529225628":{"name":"@atomist/automation-client","version":"1.5.2-master.20190529225628","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e77a4a48a6535625aaf1ea8f0b1d84abac3f3f0f","_id":"@atomist/automation-client@1.5.2-master.20190529225628","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-QNrfsq7DW4iXTsSYbphknEATJISGhZ77hX9b8GT652I9XaGH+Z8+R7pFD4Pk/Wpwl/Gg/Zz2VpcdtQPZIh2wNQ==","shasum":"9adadd6cb2d7b670d45a919023f9a41d1d272492","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190529225628.tgz","fileCount":620,"unpackedSize":2979002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7w99CRA9TVsSAnZWagAASOEP/i45SRrFKEEip3b2NO18\n5txkC2DbuFkNQSHWkYtSvSs4AHyJQUEtok2Tzsr0bN2CmLYDX6UT9GL4MChc\nFlTLKmNl0kf6fkB2ZrHEiNM7Oml2poyqAU7kis7Yi7VL5Q3QfxdzGodusyCA\n/HfET8ms0Ee1QvYkMfOd0anCZ3M75hiSKxvmakFMJN/AhoNTpRPE6zCHk96/\nL3s3PWqsCYgQbmsxszfI5dS2OvqvyYfUQJP415R/+fLZlY9wZTqUDnGXsrDn\nFXwsbRk/NOkaIEue3q83x2vTBzuvAIljC6u92JRoqPbQagv8wrZctsylZbHg\nc6cS78y/YZZW8sd9Vp/NuT7mQ5ZnULzIfy+X1agG3vTs+FNOPUtcpyoHDUOe\nOI7w6cm0Os9vnwFL3Mw7nmqgsFwEDu5yTKfPd26RlDfdOSmTW2saUHrWWMxv\nWoTV07SXNgxW283ChHeLHubiyDhL1Ey5lz8NYcyOIYJHyHM3NEpatC1+2PCc\njUupLoGVaB0SuOrRIIOkBdCTDcyehV0lspx/S35jjcap1PO1MY06R32eXfuk\nZJbScRt9yiVf5vC4YrGwLtXroQaZaBuebTr75WiMPtrE2xc3eV+kzbE7iZAc\nhqm9lPfA+PXp/bInsE6wq0tBTcIGdkC6UUWV4cdAmCBo/kXJTkJPIfFT7UQG\nJmtC\r\n=WmVL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOZkKGQxj2p4fsSsYBzM/jvQsoIk3caH2EVSxl6SBlfQIgCg/MOnQtUgLs8RLDsEC3GztkCqfhuIWV/xNfpfIMzQ0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190529225628_1559170940779_0.5616789374351139"},"_hasShrinkwrap":false},"1.5.2-master.20190529225743":{"name":"@atomist/automation-client","version":"1.5.2-master.20190529225743","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e77a4a48a6535625aaf1ea8f0b1d84abac3f3f0f","_id":"@atomist/automation-client@1.5.2-master.20190529225743","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-edGxMuPTYPOZjz5fGjMNSGhf94i8CvIeZXTlg/hKFFxnjlE4ZoztwBYEHzSV13s/mrYM8szVVqYoSEfhhezTJQ==","shasum":"f7a9a4d3ac249ee6708a2daf63eb8134285bac63","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190529225743.tgz","fileCount":620,"unpackedSize":2979002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7xDICRA9TVsSAnZWagAA1uIP/00Gx3LNYvKQJUoFPQCY\n6h7EtMTZi9zt5T70SMggISaIwGxuFJPBJbcx1KmtES/MZceUldz4+38NNsiK\nD+IwUMboPPAXp14ZynUU8Hg6T7KZBXwmb7WqKCT0FUTFCD3Nk0CzEHDJTQxL\nxapVElr70q5UhSfmuRlEMFce7hCREZv/2ZJKSGp0yOVJZzJHredjrL5DVxpk\nX3QFszlVbX+9UC+qNfFfVEO/YIMIi3KAgQhShJTcfQlPhe5A18MYPvaZ5Xx0\nEkewfyuimbrARQxw5VxsvZKwvOLNLyRgMGEt7DKK8if70nn401JhY9mpLwNg\nSHmjEP7/PG/vGmRcq7WMC77+BPaoljXRhDFuFwYO4o4fLa+JzO6N15+bgP0l\nuI6cwZTfumKcIrhe5N5/mK8S3g/NeJJ6IUwRCmNINCkJ85ItGS/otiKp/cea\nHbL7jFG18yexfiV/kMqYNQLLhnJPEKomGQkc8M+cOet/+MuYaOMnq2naxmQB\nolY3Y9JAlxIXdWeS8q9ZkZUYA0OccYGkxQhBx/21QWrncstOKUEVQiPH0cqr\nT8OctJx7nQWaW26Uq/iNX0Y60bqtVi7nQysHd2XS7tupFMyQ3IBHhmn2RrmC\nUE5+5sI+PlCRZEIk0BYTMX8UiC8JUuoEiAbEq2T/GgbmoEdmOpmBw5eyx5gX\nNBEE\r\n=f5Rv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2XCmTxVJUvPWYA1uyNBNcmSB3B3HWZ4qdmfmlXAhLwAiEAy4nYOBK4Krd6nZnKJyOWimiE3/EnQ1n5VSZFThzfHtc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190529225743_1559171271844_0.8203560335954343"},"_hasShrinkwrap":false},"1.5.2-master.20190529231304":{"name":"@atomist/automation-client","version":"1.5.2-master.20190529231304","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"706fb1fd0dd2caa7712089cb56ea4ac74c928d22","_id":"@atomist/automation-client@1.5.2-master.20190529231304","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-+3ilNLM6TVSnqxrfYjDflmFPJXzRAsmfv5i1WhGa7MtrWetirZn+RU4o3AIWG6rO0cBfxKr7AqBJlSfktUC0Qg==","shasum":"17bec5d4823af5e4d5616cc86d8aff0c40bf07b0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190529231304.tgz","fileCount":620,"unpackedSize":2978985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7xLFCRA9TVsSAnZWagAAPRQP/3xi0kAY2ehUlF4BZesn\nvw/qIWYzuwV0JTKXb5u3JaUlLLQc7Jb5twJEWYI3x+cAYyW8ku+pZ/ixI05L\nMtHASYg9QgeJNtB/y13SjHTUf30duZcT/drigQezdy/9ycDZljR/3BZe3wSz\n83mBRBV3IZKFqPk4M2+/af4vr1e6ZL1TMzkSCH/ZSGm+YRhXB3ZqbYvXn49G\ndOHiOOvIEjPsPeehKkOPBoRkG37bxdMNooWDgeiZXHnDTOrTUjQeMG2PIGYt\nviZOn0BpcpfLCqtv7TFaiJpi2oWJ2Jp/hFhIGh35n3Ugfc+0pJTLQzO/2B5D\nhFkb88t1vtAE8pDCXerVrX1i35hnp93fKLqKY1g2hPkMereTsx15le1G0dgQ\nxOYV7WwDweDVp1NVZMxCrk4oRVXEwHocdY0uhpR7OHyR66UaNXwZoikxIwNm\nAGzyZd1Q9T7/Zr3G4YsKqp9btuNhL+RkZ5pMHrzMjakEFsd1kV0fZW/WjOkZ\nN4Z18kmrl6adCh4yzpRV+Oa7QSBmONMB5OSUhuqt3GrSoS3FS5XGifRdA6Pl\nuvfIPnKpmD2YNYQLpKgUr/LxtktakcE0ZBAq7JsRM3Le+9g3Jg8oJbVKevFu\nbL7TOJPw6hgOWCaf3dMB6yWQSsK2feB0AZX6+fdBuCg43/jiRoMaALQ41Zka\nvbry\r\n=IHpj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3K/BXnNFBOo4icg/61gxm7+SXdAdO5CKFSQ3GNXpjnwIgdL8DNiikwPcfBJK3k4FwxIMvy5A+s9eKcjKp94gdtJQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190529231304_1559171780394_0.49505736505700026"},"_hasShrinkwrap":false},"1.5.2-master.20190529233036":{"name":"@atomist/automation-client","version":"1.5.2-master.20190529233036","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"63069b1dba03b7d0e77c5c83cf3ef925b9732032","_id":"@atomist/automation-client@1.5.2-master.20190529233036","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-DrWUtI5y+0UTlTKJz12cF3S7US73hin+2j0qRzKhD5h+X4ET/gqC1zRbzNdQF671eraJlHMycyRUvrK9YW/8mA==","shasum":"79a83deeed82f7f7acbcc1237e9070fd588ed8bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190529233036.tgz","fileCount":620,"unpackedSize":2979079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7xbeCRA9TVsSAnZWagAAkjsP/iZitPiJyh5C1BA9bQXz\nSqMrj8TPedBGXjHSCbAWHWybTiig/xy6FyrlOpIPOzGZp9UrUe98R175R15l\nH/oE5AHpSXSCAGeofbjeVQXc7K4wmSro0SMoQvhqxasazVtUvW9YhP7tOY3O\nuEe+QTFZa2ut0qxyz8NFASatIqNYDJXKB6J7MxLFLvLEbhkw7diSDSiqMD1F\n+ZUFkXwaDV4GhhsNEGvXQew0N3lYC1cUAkszoYwUgwZqEuGR7+/V9b8KrVYw\n++a5xhE4QAlMQEJs0Cwgl/L/j3BAt76KyqhpBPWz5kzRahS5kYlszWiTZ6fR\n1H8mMJko5N47/5vFDdQ0xfacbqoPIdUKKLwyDuZ/3Zg1ZjamwoJy/zvASpWI\nuTRyuXZPJbsuffJS8fW/Z2+hu7O5tiy+EbitcbxeGRvJ78urd11vPp+FhuOg\nI2AQpekszxlzOdWecG7KdqnArATjVUSchGt2HbJNz9GzuYRg21YlVW2Kc4dd\n971f2PTxso7EBe/PCVPGpobvwredyc2TukfGMMNnP+tnmebSZqdDC+lB1YiD\nSXNE1CWwEfn1j/JXq1QcUNQXHbpbjOBW8vm01l45AS31SyjVWtmrEHaC0j//\nIvk0lYu7xjj/GcWlRpsAsnMN1CQ2I6lqHUOYGtmzWM8ZCAK9g7e7Niv8U3ub\nIb+t\r\n=+SaW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESaQQd4H3CjzrppCGGR5oogXJfbnzR3vtq0WqTc63tJAiEAg7Ug+lDLi5isRPnEW+CRLka8qERAEDAlC7O6UqGR45Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190529233036_1559172830288_0.93237003747798"},"_hasShrinkwrap":false},"1.5.2-cancel-shutdown.20190530131408":{"name":"@atomist/automation-client","version":"1.5.2-cancel-shutdown.20190530131408","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"86f3a64aa13c838ace29160a0d4ed04bec8619c2","_id":"@atomist/automation-client@1.5.2-cancel-shutdown.20190530131408","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-+KiaJEHIa8StV8H+8YE304H/V7QIu3lXnMxqXm6E2dHVNYy+6B+/S/bDvL7T3ajscxHxHH9e8YXfOf97TDpYmQ==","shasum":"077741a0743a6935bde11d9da9b0df0b3a376997","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-cancel-shutdown.20190530131408.tgz","fileCount":620,"unpackedSize":2977982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc79gDCRA9TVsSAnZWagAAcZMP/2neQMxToy3Tj6XQt9Kz\nzreeoMwgrsIaNHEAncCV9SUUYarJ2CkQ8TXyBS0K5yCLoo/Yb0RlUmHl6Ne2\nGicsLZX7XV04vGdtjQTwK4KeTgNuxMqe8NtOCjdx6iFBA8Mg0aLps9AICN+M\nrXBBIgw/YLVNrHDRI32b93tyXyugXA4pS0bfKfcuvHouec9dbNc2qR5iv/QT\na8xDi5NhxOWkyUtMOFJQioah9rbTHsZEj/xdf9zvnsB0TrbLLdM3AyMAk6qi\n1Phndu8suRltOTudY5w/ipLb5LnYCjogKCdpfQoszXWxzBhvhE30gfEzcsQx\nI3172lsDVy0sjJMl1WNDJsisTDyLzTpJaBC8p4g1fciVNvUPKrJJxScK8uoe\nRCify6E7XX0ULT3DJjQngwgbrep2eRIY2zJoEH68rG8XfP3fhoQLESVKTmF/\ntfEhu5itSPTdVeYQFBME7YOJ1w//K6gUjMInGpm1QcNnvQIwhzjOTqQyDFyp\nMykb3tM98aLXS8T/o7RjMGtePy3M9DI57zM7yBHYDT7MiorSJL0FdMf2+ecf\nxVo8duwPRpMB2z+WmsWQZK+SRRXLq/IFzROAd2tmWuKayeOht1/Pp3d/u6QV\nQ+bPiLqZp/wPTEed/3AqQsw2MjKTyqy9WF6rDH9sTZjYhdjsdYwDMZbBcT3/\nIfmz\r\n=twgt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDXx8gSA2kIcUkJlQgffNapAcLEIbct0r014e/JlgqJIAiEA6+Y8y0oEygv4t+CAakbZNMssAR1XgCE8BgUkSRmXXlw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-cancel-shutdown.20190530131408_1559222274863_0.33224438100433495"},"_hasShrinkwrap":false},"1.5.2-cancel-shutdown.20190530132807":{"name":"@atomist/automation-client","version":"1.5.2-cancel-shutdown.20190530132807","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7055ec155f9f1aefd0254fc64509543495538391","_id":"@atomist/automation-client@1.5.2-cancel-shutdown.20190530132807","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-faX8tIaw+eMXxzR9OuBH67RLCaY82sJm3zT6jDQZx3Bf66t3LvZPCo26C5R8ht725i4qFqhOE9PIPXnMrwZs2A==","shasum":"56ec8a7d524bd6f90be61f773fef7073b23d1774","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-cancel-shutdown.20190530132807.tgz","fileCount":620,"unpackedSize":2978944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc79t5CRA9TVsSAnZWagAAzDkP/2Rx2cIVn8eaLXxTxpvh\n39ha/elNKHuk8fQ3HiC4BC9Tp4zdDKGFAl7eakFe8uP57iRrTk3FWG0FXlEg\nDg02NOfQeEwpLqcF7Xzz94nElXTB/xVaghgWs9boXqzF0B7HC2WUA+vMNtUO\nk+iHVVI1vvkVQmlW7Bx8n7t878eZaVZwO/2t28eBvdbx536HKj779zrTwsIs\nXi9QqSOUr4MrVMl99pGQ+NNyDQrwCqOmLjnRQbDx8I4x98vRPCMLmPXR5Uvi\nAJXX14fA7ZBhTrWR+t+OL5iVOJohSYvWQIgKYQDL4FtdActPEnJBFo1pcVEj\n6ex9ueOJyp2tLbXXC2Hl/xsk2nJYSNBRwydqBm9cn7eWvC7qZB895YNcoYbu\nAuq8mCWj+o2llZNIw6BrjvkUSuotld/ugcEkMOd9Zs4DWs5vb4BagpCrU19T\nljd2jl7aSpC65x92t8B1ZIakbRLt0Mw4A2AhvrB31HTP02ClAl0En5nWTda/\niw4PiIVNA4ltAx9lW+Sk1o/WsYd5cltfbexKhnY6NCfOiLb33gp5YfK3rL5V\nRrfdbGCQ6tsjudjlLeVHpHUCrmVGFTGyPr524htA4/lCxYCa+gvuyd3V5tRu\n6YQmIZH/32J7H40vNdmalLbRGbEaHL0//qdmxrEasX0RASfWCNcy56NBBB/C\niHOm\r\n=0z2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA36LfGxT8meg2trcNe93Lq2qroqeT9xb4annDBLRV75AiBrIYo0haAAOO26v6huMNYqo5Lt2y/pxpPtEFa3Qs3RQg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-cancel-shutdown.20190530132807_1559223160941_0.15576061286253706"},"_hasShrinkwrap":false},"1.5.2-master.20190530170909":{"name":"@atomist/automation-client","version":"1.5.2-master.20190530170909","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3254b519296265fa14b6e4b5e244421decca5bc9","_id":"@atomist/automation-client@1.5.2-master.20190530170909","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yj/kDbb/f9LdpFtn1nYj9ktp5pHk+3FFzd2k2IheCQX87f/qxrRZkH7+WUpi2FL8VH44BzazDA7CUiCYuF1PRQ==","shasum":"a18edcaf3cf8ef85095b722547fa8909306c0bb9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2-master.20190530170909.tgz","fileCount":621,"unpackedSize":2980557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8A8BCRA9TVsSAnZWagAAlsYP/3nFSrHDKi+cOEmtfX3U\neqPLiaMArjKWHk6er90GCqzOf9BjLrGLEhit3yujXAHy3qu+aLZVwUditkxn\nKNO3w34sDGy5S5cLLsCIWgUx41StV1HwEFNbfSjjwOnpn/O+qzuheWhqDFBD\nvaYqaBxjzaVAYlrpVJt0hsCUICLmi8qFx6ytnmkzq5E1o/MLNiAz4rVLPEkr\nM3NVE53BGjL3eyQlDDuaQv4gffG977JuP1+KZdy89i94Bgj9ddFIie1Y/sFJ\nlMnzuSmnLzUaiwdZsrmGc5I2ptLFzzv0m7ZGkgyUPxrmlqxbTazCPkIZMD4v\nnMcWleZYD/o1a2lqbqZJwR2chZa6XS0THBzEVOSqpKev5NzfomST3YBZO59C\n4KOP806LoELwrTEOOi0FEk6t//syxfa5ddBTXoF1/8YPzFzAFIRRUh4BnEGF\nR3PmiEQmZ9BeavcV4r8Q7DIDkMyvw2zuAng8FSX8UQRYxo6sUprQie733JzY\nJlUu2cg9n3SQmHUArnwSGav6w1b0FEpXpFpUuJvieyJueAnz9FZjF7NK+ugC\nqzNxknim6wJh/7AAZVhjk2D8DSZHZnkQg/gckWX9e34AVYsC/Qf6d363HEXi\n2MTZd+V3pdM6fTgaZbfpVENGjuSJNW+qk5kfZGc6jp8lzZBx82t2qz6wNRKf\nYH1r\r\n=4CH9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDd2hijXxe0cKnZqdaf4UtMCswqTitx5ZbsMdoiKcUc3AiEAxnbWC7vhGvD4Ql61MVoMHbYXHlOsK07vSpslg5eeF5U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2-master.20190530170909_1559236352670_0.35463382277026656"},"_hasShrinkwrap":false},"1.5.2":{"name":"@atomist/automation-client","version":"1.5.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"ded4916b99f9fb47d93f0dcbb406abcaa85f3b62","_id":"@atomist/automation-client@1.5.2","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-W/zPmXw00Z1rkvB1E47um9UZ/MEZYxplb45/Lcnc84TjKV30bQ3D516Gz5ckO3/a2HqPj8H7PLLP5NrRvvAnrg==","shasum":"34a83b07f6e3b6eff7de94565998e842ead59318","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.2.tgz","fileCount":621,"unpackedSize":2980535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8DGpCRA9TVsSAnZWagAAsfEP/1kDEZNxVcssfTRl46EE\nu6dATYcxQE7mt/Q9QyquQDp7h/MSQvWicxxDO4w18SM4dZ+hQii7IGf0hyaH\nibjennSskdCAspB9hZpFIyHcHxRn61uIYRQGbnbQjg546iBJpgQiKfnrRdMJ\njS0taD8XR3YpHX8kjCaBdUgqSR8IcBoLta3aFiZ4yrRHiJQ1UYWn4qenTAOS\naFjvD2YK8OdUfFqOsc2Cc2Lg8AT8E4dmO4gN2Y8BjvVvwLayIflF4WMvFR2N\nG2g7w/sB3O86pTxXJiwNybcbnDwMTN6BaSreurbrTtBuxElBmCgZE03m6PuG\nSzbnIZZDsBghB2Lka/4qNSsxpgHVVB9bIgHuGL2uGJgQRlYnF5l8hOPojmOP\n5RwO6zJr/06J6Qnt/dkc2MaQ9y3qCwieEFGypadpTynUYPj9b1JuC3K7fT9g\nz6Xnz/ZUuczQysifPWyR1N9MWk3BzHCMzv427sUPl0GJN3BF3HgL6PFUNF8z\nyhAqUJusYDulC15owBHjhHMuBTK4i0VfvaynBHXD6Kp1VRu1EgK+cXZ9evMt\ndDAN+/5ijdVoSvnbIabKqwAdRHPuq2s36IpXfBN20b7Dvx0Cb5vDzaB4rNBK\nuVpp+OLm6v6V9qsv/E/grIQlweHw0t/L2k9NJfnGs9J68TvMipAXt0Q6vJf+\n5CLw\r\n=AzQu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk+c+dfA82B6mH91Gp+wNMv7SjGcozzI3eD0aabm1e4gIgag/rwPdDjujWaYHZLb6Hks1vP/k5qTl5sHOux5UD9Og="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.2_1559245224600_0.05107658898940581"},"_hasShrinkwrap":false},"1.5.3-kipz-patch-1.20190530211310":{"name":"@atomist/automation-client","version":"1.5.3-kipz-patch-1.20190530211310","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d34513d226f890174d3c01d120137e8bafcadb5","_id":"@atomist/automation-client@1.5.3-kipz-patch-1.20190530211310","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-rEuZy3fHU0QQbraVYgZ+5O0QNwnLXH285T8/8PIGs8K3XIfdfscYgRXzsojenk1/RjC1aBz6jBMV8PxgJfnkGg==","shasum":"0aa14eed5b0278d16ae2babac848c6f613988795","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-kipz-patch-1.20190530211310.tgz","fileCount":621,"unpackedSize":2980978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8EhSCRA9TVsSAnZWagAAs5IP/A1cHALHL1qh3dFXD/cJ\nyJhYWXYxueXKy5fgoYgBS3t2ecT6mmoSmP29ZyTo02N6dNOfQ5YFtHvPZM7+\nt9Kvt2qc60JQqWWqYitwdroeBrTkdNhIVJj4n8WK08e/R+g5iJpKeWKZ9tCF\nVBZRRuDVv8Kf6u92kdHaJv0ZmSIQ5n6p0XPQJ01XHeXlkDhEkGR5E1vW7YUk\ngJcBDDGRTGhQa95ORs6d7FnTVueDEvW1Z5KPhP3nMD/tJh1FaboH0ovKHKld\nQTmbN9ALdB41J7nGxoQu9kyuEHiPSCdYssskf4nskQu5hAJrf8uuPk/A9f78\nLu2nnP+kKLMHxQ1NDAJ2SjyjOolwe5GHLJOkIFE8p99HyP+4FjXob1w2qwqY\nO/glS4F4wPdBQv9xcO2R0pwERuXOIug1aRLEzUS+mWhkAu3zNRbipqNCcl5t\naLRLkWRV8zBDcM5va7ccsXqCjEepJ2BuN7DLTmHcLLbJvtnI1TcemMFLgbN+\nbWwRNLNldCM3UYhk2ZI/MIE7SXkuTFE3I/oMd0IRCE0R9ET0qDZMLSwt8K3A\nnL/tZrdT6gfX5EKtGLTdCOcU7zWrrPybikpJLJ6b+cYtbyBsTxxv3/WObQy1\nMWCRDNuwTFKCRdhbKVWRZDInw0Bi7OwlfUTsMEU5z8e4fC+NNX+DRMRID6zu\nr6Bk\r\n=OpZr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvUDFHmUYMj2xALgRAKrRgaqjj5Kr4rUKFdiAXbYiAWAIhAOaFsZzJf1Ddx7b06QEbjQZKxcXUS5RfWt/mkO3NN9h+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-kipz-patch-1.20190530211310_1559251025128_0.6732876761842739"},"_hasShrinkwrap":false},"1.5.3-master.20190530211806":{"name":"@atomist/automation-client","version":"1.5.3-master.20190530211806","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6927f6e5cedf20a0c865b7b554be2481c142b4b9","_id":"@atomist/automation-client@1.5.3-master.20190530211806","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-+WSoFMiGYBIRRfLl7TmpFJSdJxSkzWWtVQzCQ5kknfu2RdMcba8TV4KdACSvzEmnPGTR3JlBbATeqFK1Ek7M+w==","shasum":"ec566f2155356945715126896bd9b289a387a7fa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190530211806.tgz","fileCount":621,"unpackedSize":2981128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8EmCCRA9TVsSAnZWagAABaQP/1s7TjT30AlaStCCtX6h\n4CR6z40KhMIE++BV8Yh7LurjQehKb/p5wBGTRVZJ2JqEyeFWHc1mXZ2l4rHF\nXfRvc89okDdZitcLwlASzTKokNAYiTVhqOfGBac6GEdIr0XETOpII/bMZok7\nFyQAq6vL0P84Sk/qkWGjclu85JZCY28w4JrMKi+bpz3C7BQ0kw+/2YsY/tE0\nC7pbWisf9CImopKSfCgtWSZV6X/vl1BKC4GkQnkNqamEVdvWRyMeWPPcxHkA\n2N4QDv2ZKtjQZkbTHjxBkEEdVQXbtxfceMefQFexfLlhAE1pKUUUMeZhuwZA\nxQveI/bFhBT3TCpiOQ2DCLJEChmBlZe/6GXT4kxPBpH1ZOSt5miFhp/ZMElN\nxR5wRD2DQrPPlRUoWuhFUSwERD2zI/K5SVPaFs0Vx3TisYNzMurg1o9w8ecK\niRHR1Db9/F80jNEKTG43oJOrcra9LSK+ugMe20GL9I3CA3IytsOE/JSJzE44\nQcnz930F+KINDWU2ZdqrfRxeaq4Ov3zmKjUMFw72gS1ojDWyTjj1y2V89Ctm\nWOQoJ1HBFjxrGKRMe5bl39yanXmXaw1t9rvTepEAFW5W88GmVr7OYwdXXAqo\nQH3u8a3Fx/wtnGmlpnFfaLsnfLKx6hPJSLB+wbnjus0waziXi0Rbl5cVKWzF\nH1oj\r\n=B+FR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxRUuvSjQSRF2DdHNEdUKSCehrzD+e75LllPyjfETcpAIhAO6TBhET2mobDAy1A25WVPZRhuSGD9Mp4H31Qn6yusYv"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190530211806_1559251330047_0.5939528264418279"},"_hasShrinkwrap":false},"1.5.3-async-configuration-loading.20190530213652":{"name":"@atomist/automation-client","version":"1.5.3-async-configuration-loading.20190530213652","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9632c5f13b286ae63387978efe4f6e1273bb16e1","_id":"@atomist/automation-client@1.5.3-async-configuration-loading.20190530213652","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-moPerPlWWc/wvu5KDa1umTYhNlIcEwm1mBX8PV8Qn2mVzXtP4WyHn7dBysxc2FzXdrpQj2/hRvTEbtHNGk862Q==","shasum":"94d0849bd30477fbe680687989cdd42fe6cea6a7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-async-configuration-loading.20190530213652.tgz","fileCount":621,"unpackedSize":2981976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8E4FCRA9TVsSAnZWagAAwXcP/1FZQIhd9UM4ZL4JVThu\nyYxJ/oUFnlvrmdj2IRKM2cx4dFJ7jgKZJ/jFcqCZczxcflFwLYQgFRPBnGMr\nDiilOvzJZ8U51+wAZ23m4IbVew/lJdvozQZgRE5QLGVDQ7GUtd5B+zORtYcD\nEsNIfcU/lMr6r82mq/HU8Z8s26phFWZluEC5F9ptzsrOQdjgHqwW8DbekZQ3\nP9hI975ehfTiL8Bn1+/DyikjeRP+dVR2lbJrQaKHNMrJzzfQLm41XxN90BoU\n46MtvwyjzYEO02ee6IGJ37LJ8fKoX2RId/kNSS7eKzts1nnAj/ARy50uJxle\nwBo8C+Jv+E9q55Dj8/d9f7DAd2RIjE/ZbJVj7RhTty8Kgf1+NtEDzG4fimmm\n7okddtRGH1l+wWBftSDcVf6IEE1xvuN6e/w574zRPegRNXX71rkV4JMjrB5V\nNakyQ6sU1gG5o/wrn8gRv9NNZ7Rol3bi6FCnVPizLxK7qe/kDERVrKKiHydk\nqUuaiUVkLt5MnLqEj3M3o6UBlIwU0qUBOxJW1YcalTAbpQm9EUEDCFmkuVjE\nw9xYDcuZp9oSicseRE52YBuQiM2/0n9uH3KDl6GWS9SEG29lvZiIJLjU770O\n9VNs6D+A+MrtpU/qzlSj02F7FZXyk/sGXCXzYe77GtjYRJ528hxTy5jOhoDi\nmQgT\r\n=bV5j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDphEtaJluQ95Z7d97O/Jw+qfV0gzVgWorylSqwKNXAQIgd1fgrjBI/2kIzRtlGIJNZxZnLFOvlvjzLZNMcik1TE8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-async-configuration-loading.20190530213652_1559252484938_0.03305997611699718"},"_hasShrinkwrap":false},"1.5.3-async-configuration-loading.20190530215656":{"name":"@atomist/automation-client","version":"1.5.3-async-configuration-loading.20190530215656","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"0.19.0-beta.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"63710c336e97f4e00fc49a5289ce9f68d0d4e527","_id":"@atomist/automation-client@1.5.3-async-configuration-loading.20190530215656","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-OLzmh2Ydbb9NgL0LYdouxyQ4hQreL0pTTRkHO0u4kG0BYH8kAC0wIxUU/1JW5oi+OV4y4pejDybLld+sF0Jopw==","shasum":"1e0e792e06e19d9e51466a628b9f4f1b5292151b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-async-configuration-loading.20190530215656.tgz","fileCount":621,"unpackedSize":2982132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8FLOCRA9TVsSAnZWagAAQYUP/31FBGFyiyJSANxLJAwZ\njt5nVVfwkTXenYbMQdwId6zOi+fYfEvLcIeR96cf9gGruNgPO35L3u0178Cn\nFZMiap95+UeaTOM9v12ZWq41epkouBL8NnLLAUpcrIzG0wjLaaezutESzFFp\n90ZN9irPoK+8qAABVq5rWMMeq+6nsmHo+SYpKXB37UWh7pB4Ij3R51lpc596\nKYCuZEEcT+/eIaGuvNp+Rn+BT/1Zvz80N6pIkUU5OGiKQYD7kR1wfmbFoGAf\n2exGEXuukM67okYlGE6lDRNCbQz+/SIc/Zi/rTwRb8flCylBw+WOjc0xes93\nNKLiytM/ubaBAW5kk26ibgy/egtNfVfsHzGCeMQSxwQpsGmX2HeQXC8fwLM6\nL1Eu1kx6bOxOj20yDyqfYNAWjggTDJUbyx3GQ2wfig4Iu3wcxglqUILNKlh4\nN9r2Fv14JLqxj9USh1GvsbXYdqP1nZ4bFIO3LLB+3DBcMQYp3hvSuy2xT6/u\ne7YEFdzTv84SDQhs61O+pvoUDU68cZpkmE0Psfy5+ILLP2J0/u4ucgIcmS4p\nLGkMDjnmLoGtQtPCZ4IYr23ROxf74Knf5uzNh37mwvv/Sz/Yt2vAiY+I113u\n5PQw3u1Me8p0+Uez5y+IZepOWOuqY6rprYnxeTySP/Mo5Rbmj1Qeeepa9tpW\nEitv\r\n=3OxX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCc4OvwBCoghqMM1MU3q85qUmAaLZMnKI8VyjqmvyyVQQIgeQpOEqiDmmrwGdNePFB8iQcsq8ZzrDbJwk0FQdjBEyQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-async-configuration-loading.20190530215656_1559253709164_0.6791041653790528"},"_hasShrinkwrap":false},"1.5.3-atomist-update-latest-20190530224912.20190531070146":{"name":"@atomist/automation-client","version":"1.5.3-atomist-update-latest-20190530224912.20190531070146","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8ba1901beb0cf8fa93dd35c836c3e80bad8304ed","_id":"@atomist/automation-client@1.5.3-atomist-update-latest-20190530224912.20190531070146","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-YOQpG8wETJHZD95a801Dt5VobSDjWtlA9U+BTW8ijGayQ3M871DTIfuNEm8XLRNE/YwbX8fbLunjb0gYgKjeBA==","shasum":"a28d4b013c4fe289f3cca46960fa8279fa9fa7d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-atomist-update-latest-20190530224912.20190531070146.tgz","fileCount":621,"unpackedSize":2981152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8NJcCRA9TVsSAnZWagAACUgP/3vqTiJeM4KY3rq59cd+\n1BrVjDeV9seGSskl0B/erIgS8WkBEQQK16fl4faAxsgq3HY4NX+srjdOzZLD\nvzmRjJ/OSqHhfv3HucTVttX+FKbJMW3/BpjlPbFmekUZ729M/2Wf1/AWEq23\nfW8d+xuJ/SoHQLlkJdMfVyHWDl0ZWoOBFgpephFjrjFIYujYJYhF1maYYMd3\nWXG1ymm3Lmp4h2NkiuFEpKRm2joy8S8aJq+g9nx8vIj48cfdGqXM++Xy59J8\n+oht2Q77H3btxVg3Yi7WiPffRsaWrjUVJ0EF9+QAI00tuU/RzooWZn6QoTJV\nhnSw0RHOU5okkf+N0Vs+ZQimsqVmaAmyZwktzZTIemUE1DAGy69yTmj7O5PF\nt1a710vNN5rcT9nOM9DYdSQgIp2CC8NcRGg5RKPb96SfSHDOL2Hvf0+HLfSD\n2VUV0l8tUhd1MY90J7OLgonpw2dSG6wRYM7839mliRDoXL24omZbgNfPWZKX\nHd14B5YSrn2AW+5T+VQxQOYcrwAAQ4IM7XMAqH/uRbzLiYhHyJDafqjQ6n/8\n/1HCYVwI9w4sozpRXQL38hVzVxVPn/Y3Uiv7fSty+4hvkVOrwbX1IFB/UIUC\n/4H0y+GTAQp7cUxWxVYScFB5CJJSWLthxTGCiS9wM1llB9ivyhNXj1MwM/ks\nPf5d\r\n=8eMm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFF3bfaUkBmMRsMRQj0huN396MFHdyoE6eK3/7CuAvDBAiEAxmKhb9xVccwcBEfGCxE0kRzIxjfmewb1RIq1M44pLf4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-atomist-update-latest-20190530224912.20190531070146_1559286363902_0.016917570974642526"},"_hasShrinkwrap":false},"1.5.3-master.20190531071810":{"name":"@atomist/automation-client","version":"1.5.3-master.20190531071810","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c054235811f67eaaa922d07a89dffa6836166831","_id":"@atomist/automation-client@1.5.3-master.20190531071810","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-me9Gi3MnpbpEYrPbgKpkcEa80Qe15XZoKRtvfyaV7g/8gGB3nNDeEnPwgDZsci4Bxc03tFzoAURTjWn3C+ZRLQ==","shasum":"87885c930c96b2ba3042b9b33b50e77ba1ae582c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190531071810.tgz","fileCount":621,"unpackedSize":2981226,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8NYVCRA9TVsSAnZWagAAqDUP/i5fF9OC5Ht1EpSw0gkH\nl/Z03Mkr42osKQ99Z2RGkSjoiPRfvi69uRRBlyujq5DudsSpOmTVIG+nxnS6\nrjYcxWf8jY2XyX2FfASvWz89hvOB3VSnB0Gqh3v1dT0TmOZlTv7bUYSE10jt\ngSHLTs07e1RfKocGXdvWHGXiWa4qvtvit5Au2UoEiqhjLDMp8MWnTCyp25+J\nOd0cllWJsB9kBzJ1rKz8n9c14w6d3y7PsyleduECBVsN4U51eNWtInmWXSSw\nw2tWfTbzhJYBuOgfTcAH2Qjzw+UuDtuO7HLLgqoTovebpelpLx9PYYkpjjSd\nj6XZGsAWO/tyjmFTL7W9JAUSok3vpIe24Ygi5tvyEX94bRk/tTd+QhW7z7/8\n/D4Vetz8KBhG40IAbbWFB0tqx2vSqvq4lPBIDcUsuiyax7FMM1XjRFI5ds2G\nnIyPRqcdwjqzm/C2yAa+FggdIxtBzTpN74LCylO9ejmJAPSRYiC1LcHDkd3A\n8HPxY1bro9VI154siJhWMed6YevBXAjmMY87Ot+hh7R9QlnQvhmn7DI9Lfxb\na1+7rY0IzEBaH/DXnI1bjQPfo+BUnixdG8UfC7WDwd7Kd1dcbb+Q+q96AS8M\nlZM6nrm/F39bUeqL0BvMJZ6dCM1HiNTxcJxSdF7yFn+yrHJ5voZoJGCuvEDN\njZwI\r\n=9mro\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSB67dvK/pBmTnhF4bQuMYl/W+kRPf4+ItbVPQHDzjgwIgOc4ojZZulxRl8/eGWtQN41z48UcSsUn9zNygNdmwFKQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190531071810_1559287316854_0.5877134257804453"},"_hasShrinkwrap":false},"1.5.3-async-configuration-loading.20190531071824":{"name":"@atomist/automation-client","version":"1.5.3-async-configuration-loading.20190531071824","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"91bc4e654dc30d26f55e61f496dfeb559e86f3bf","_id":"@atomist/automation-client@1.5.3-async-configuration-loading.20190531071824","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-qVB/FdcpwVSZLNHp4zGT2Mm+GkIjBzssC4pNZXeW9EmklDvfnesVCekiZaVBmzaX1xtsC8EDT8uQyN9SUsVBHw==","shasum":"228e74a8405769021545bc16bc90e524df45c631","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-async-configuration-loading.20190531071824.tgz","fileCount":621,"unpackedSize":2982230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8NY5CRA9TVsSAnZWagAAbSoP/1mRmQf0TWV60VSZKRV4\npB46qd9VJDFrphxQGrbnVGge3g7YaRNY08mwYW6QYvvrY+TMriCLi97xyl6t\n4uYz/a9PO0KGWwnczlfwDun1arTpPKpg85l5V9WSHr5A812iBPK6Mo48FQ2+\nM4Gy937VQ+CJnxAK0tLmviQPduJVWbDrm+tQsUZP1aGENY0By6BjlC+KT510\nnXlYdRHNLB4Bghi4ASNe0PefnIWMr72h4t/Uvs2ae08rUuLq9s1VM5hhQAa5\nAZuMxiXK2IY5qNzEhx/PAJGOBgFfPu4+dVOpMGq3rsQV9ZK4piBmu8cvfAdg\nl1kd7ThclwGyxTIi3pmINRnwvsOjJIX3eouC4dQ+kuXF/A0Hgqc5ysApZ6sz\nXLuBEGnMszISFJo0zzBmxQ6uUbGXQn5FLfjRDLS0DSdwIXgUATi9uzDiGzEf\n7BiE9lc7uQkyYf38HgoQgpcJMRy9MGPC8zYl1IR7X9eKa3BzkfTGQGxduFSN\nLlGyy4RtXOBc74B7DXvMHEUvdJKN0HieSN9ZLGEuwFCYNDEm51bfnLfo1MNZ\n38pmlbpr79gazgD2zkf35uM3sJRf4wB91ZpFpMgV8jgPPfSPKsuSTQ0Fw4i2\n4XgTUI4Kb9buHbFouRQJDRKvfjbXwtnUvBQs3d+5mTSUMrGr+AW5r5o9GQs+\nQpPm\r\n=IAZ5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4WFjqWrG3k8uBPOyjCZxGkMQh0cI2YlYi9em0CIXEGwIhAL5jezbwhsSHCDlRmM3lVzUM4WtQZEf2LNAJLBrTEFk5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-async-configuration-loading.20190531071824_1559287353188_0.7366676095454703"},"_hasShrinkwrap":false},"1.5.3-async-configuration-loading.20190531134105":{"name":"@atomist/automation-client","version":"1.5.3-async-configuration-loading.20190531134105","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"612704d7c5efb6e96d0778f4e44d36ef919e2d43","_id":"@atomist/automation-client@1.5.3-async-configuration-loading.20190531134105","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-veaj5ygdEu5O6XkS7t672snRpCfEt2EQNejc+3z+ey+ggOiRIZ0ppNx/sjKL8WE8aqfW1Rf3RUDfbvXMVv0mvw==","shasum":"2c84eadeb2f74f57618ff0c2fe8109405e1b3b92","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-async-configuration-loading.20190531134105.tgz","fileCount":621,"unpackedSize":2982230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8S/qCRA9TVsSAnZWagAAUbMP/iwKeFk9ln3LxojZrRpt\nNAaNe6u5bKY4PDArD5/g+ChlCSa2MiT2ig4qNvFLX1XrwRZdMshvXOzjHly7\nwX3fEFBwIqjh9DHUQD/6DbNzoIhHe/Vl2H3J56g2I8YLJKEaVvcmdNtpcZcX\nb5pMDnkY5SlbgFW6leyn33MBpmNFL2sbQABNF+EFf/GgBTvxfgxu5NB4Ueda\nAYDNcK+BS1doHcVKKPL1XgMd3P8wDh3D8y+O69ctOOmbeqt1+YDlNrlc2til\nWPNIOZjn0+i1LHf84aDnY2fPXSFOp8cxKrcr9mku+4izV0Tizz8Epu4rnZEn\nplsIZejWqpU4yA4w83T5vWoyCF4oBA2Qz9KmrZ7v7TyxdjPOPaiSo02+16Dk\nidQxGU53x3yS7scWw0fiIOG/wY+OvnV2R6HXIvTT9jfQda1knPw80O0uBl7+\nIWQZTs7f5g5bpMtiQSrTME0qb+lCKr3ezr/zXGSVJOkoPb0UbuCdZ5A2fSMs\ne0DaGW4N0+UMIZD+I0nKJt+fWigkzKT0szMBBoTD21LZUW4/ilSUrn1R8AzA\nCVb5G1WGGKOcOnUjMFSBVJLDZWNmFT2XhiyX5gtF9QrK8Xhjn12lB9K7dL87\nCeF6cb7hlsrzKMC0lbXzFy1ipUhBjWiUTV7gposTQu8Y0iWms84k9FeHR66i\n7D7I\r\n=1TMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5qI31XGv1uLjaIRDJDROhy+a2g6XhoCIdYA1wFf72ZwIgRM4lk0cYpZvTyIijv4x93eswQaroOJZBfB/URNHFYRI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-async-configuration-loading.20190531134105_1559310313298_0.3419695713587092"},"_hasShrinkwrap":false},"1.5.3-master.20190531134751":{"name":"@atomist/automation-client","version":"1.5.3-master.20190531134751","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"69b951851b780d2d302ac07564d188b1f219979a","_id":"@atomist/automation-client@1.5.3-master.20190531134751","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-6ok9wP8yo3B0Ru9RVXDii+MnnMUEEGY5OrNfn4ajM2dwXqBR96d/ezJBWglQh35oe4P1ktqjkRZPoK1BJmimIw==","shasum":"6e4cf36da6983ceb02bc7302fcdf674a97a870f9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190531134751.tgz","fileCount":621,"unpackedSize":2982345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8THjCRA9TVsSAnZWagAAok8P/3AMVLyfJO98U4k3dZ1E\nwi0+pMKeZ1rgHBokMkDQRUtomFbaO9nid3unBK0uAVwt/jFmq2pOnJiw4qOV\n+1ixQBbhaq0/dDSck2CUhiQgFqpdV7QAieuvtgbq1ctn66Yu5eM3M2g6W7zo\n0xySAnB/7bdTK0w9Zrbu/CDvw4opd++ou7z7zTVJNCeV6UCHttwcpZm1zgM2\ntYnKsnVtmXnwsEmKaG5L4J3bfpCFhX16/M2u5mCo5UGqF2U2BpiZmsfDtUA0\nTlvmyFgmlcWu73Q9UFT6PxT1B2Jd6lkR8/xF41tOw2+X0716y60FpCcWDdg5\n8O7Zdye4KNv6PdqIWS4PeQI5PmlOslNHK7ue27Yg45BEGmH5B1z6H/x7sv05\nENs0XS9GMseBSxfvm0zYHMCfeQoMkHIpFe1kBjmB2lsOsdx/m+FF9TO0EIbX\n0iMmVuCFJRDjN4/OaeMEytFnKmjm0IiQGBzQrlXVsqXvy9lReKbmv0QFqJWq\nY4EPvOlmDY0JT+7+0pZa2ZeUMPJsu6ciyEPYuuEVmbbSP8+U1xzPbgQPCu9A\n/Bn1yKfsvgLUpcOZG6wAQK6s2ygnASOiP93cgqrsfndiZHm9wq+sV8ah5hXG\nfOYPvbH91opJhht2j7czgvYI/VGYy8gRLscW83aBQmFZQfZQ+Ve0yF+eq/NL\nkE6X\r\n=18kP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVT89rwepFvhBsIr/GAQiEzSzYNt80VTF3/vNak29haAIgQY5PPa2Uiv1OfxTZ9b/JJC0uWi5XpFupLGqKnEwBuoo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190531134751_1559310818523_0.033176683264707796"},"_hasShrinkwrap":false},"1.5.3-master.20190603073933":{"name":"@atomist/automation-client","version":"1.5.3-master.20190603073933","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b9c0d535eb712d2ecda7f482e64966dbbb8b9f36","_id":"@atomist/automation-client@1.5.3-master.20190603073933","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-hON05ueQzZttz1Ccd8R4ZD4fJbiWXEpwj+DtUscxh/5fJEoMS3DOnUi3R657sgy6QVvuMnBrAbIl85NXs9HlmA==","shasum":"1015491c31a8879726e09cb65c362fe3e0abdfc4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190603073933.tgz","fileCount":621,"unpackedSize":2982344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9M/6CRA9TVsSAnZWagAAjAsQAISR06KxU5OUpdJDgcqB\nXB0dclLmtxkA2MsXki9RKhBHCAOZcV5IVqPjj6UJ0Ux2a58TS3t+YQ+ouDgD\nbPaHr1AejRU5QEt3508WSVlx4oCliHV4IDGnEM0GpvFiLFkBMa/F4RntTmI4\neKxYUR8pnECFGT5CJMYY7Zkvdf4OiDWwTsbIjndJL+dSiwvhvWMoVJ6qY9od\nhockwbt1imQEfp0sW6L9alGKzIIB9nxtWV2lOJpv11HqHPo6db2agzX3ZMWx\nIlQ5czvekwJH1XPh1sMd7cKb9f5itGVBybLu1rElsTU7Hjl9li54jjFSdEaJ\nkifR7fLszcJHNpQnrHN+aunWaxKEfM6dukHEF/LkzHSS/yGbieiwkStydF1l\nrf327P4QwQGrvW3/ALg1vlIw8VnkVtpIqnF/eMlhNUHXnTcr+UPHD2ekZsf6\nQxxc3ls64FCFXUuEe9xKhNpUGswNN+RkYdKWCoBjMqoeAfl56LhP2xE7Wh9c\nYUUXRKEV1qpMc7KSiMe0oq+YiqqeTuD3G3NSaK+rBQvYAGwvdj3pMVUSPUeA\nZ4sbHdnNclwMhM5t4oLndEUgQr3VNBEPPxnII9GudoLv95d/zQSXVQAOfnyL\nLgCMMEboUt8j3lQ6MLueSyEwqZtKWaEP3LphX/xyqiiW2VulHzCX1Jm5iMYx\nBi3V\r\n=U6Q2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDNWDNWytntCjzs8xHLBL64vgKaQ7BVv6d/2lV/VbEzkAiEA+HxAQk1ReOCxre78enob20QB8Sr5XJ2XmcSliuba1qE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190603073933_1559547897155_0.27645852397050263"},"_hasShrinkwrap":false},"1.5.3-test-cleanup.20190603211517":{"name":"@atomist/automation-client","version":"1.5.3-test-cleanup.20190603211517","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"aa5283bf8b1ebf4222b15aa12769c58b73402c32","_id":"@atomist/automation-client@1.5.3-test-cleanup.20190603211517","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-R/NeBT4TlQhb4EoSqeElR8dJuEhvClaqE9bF7otZ/dPVG8gLIHSpmsipMPVJHd2bxj3zwt4KhTmxqZ/dDNwVig==","shasum":"cdb62896e74d24b58504aad0ab8efa76e92ae9ac","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-test-cleanup.20190603211517.tgz","fileCount":621,"unpackedSize":2982411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9Y8TCRA9TVsSAnZWagAAOE4P/0Hx9z4ww5ma8Vqe2j3D\nLkF/wQ2rFncwOFeeQizRiYq2qZ5hPcg6CzzhhDze6lusvzj209DqDDkruWeo\npLNkAUkn/aspp46oqb5l5qlqLOIKdh+HbShmZ7PnjYkRk3GSmJp537u5xQFo\nBzPJVdy7pM1uP31niMZQlkuYUXyfk2xgRsyCxnbyu7BMg6Ynvb2aDgrDH+rS\nTVE3W1152slXprtuZ/SmU3xmQZfJ5JZO8dp0TmcP8XPeYImXBr3T9xLtiWNl\nIvdEDkEEEiszVRU9aozTVB7jyq6cA/Uk7o0f4Cfro3L+cKDszwGg/t5n+gOP\nWigm5QPNACTezmMcCIrn4VYH3gNmFOca8+5GwUkbUxbFT6L4VUQ0/Y9bnND6\nRSiS/4Ztb7hKPpP9EsxvFC0cW93nGZwr3ehYfyeFaazcZhqHQ0BnF/5AdXIt\nnQRFtEEF4xY4z5+smSc3Gq9AESAZff4NR5PZe5ShbjlPQNVJZKB5Tygbp2Ag\ngD354cvFu8zSNCmgQPDAh+Mfu2Aj/nx1sWDSsiKCpcLXeS+73Zh8kd1L3X0n\nqk4k3ESSzMK1alIv99PbTB9dQ2B5pYmUDIaWotZZCDAoGRoiKxEoqyD4ek3M\nBrGwaf76gn2vuJkIH7hx+wH8vDYbYRlkSVgWQOqJRCFJ3MSVEF+Q2UKGJNzd\nfAHd\r\n=r597\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6PjW14Q0tKwMLfyi6OoZ4rYhmK0nv3etTz3/Ed7TIJAiEAvO10KPBd8rbZVtI2/QPTYrzHIIADfFSWMfXV9uV3v6U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-test-cleanup.20190603211517_1559596818830_0.0778896456099254"},"_hasShrinkwrap":false},"1.5.3-master.20190603213439":{"name":"@atomist/automation-client","version":"1.5.3-master.20190603213439","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"aa5283bf8b1ebf4222b15aa12769c58b73402c32","_id":"@atomist/automation-client@1.5.3-master.20190603213439","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-lhZG07HjgWsA2xiRn5B03JHoZh2v0ff8UiP4Vbgm1qjLvlnt2veGx97KFMFEIA/18Tgdz51tjHLDN/Zm6rqp1Q==","shasum":"7ac66ef1a39e19f7a2af924892319ac95f46264e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190603213439.tgz","fileCount":621,"unpackedSize":2982405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9ZNLCRA9TVsSAnZWagAAvG0P/2x1S9pHIvFelsgNElL1\naH33krebonTv/yGVpXMDwyWjU6S/y3/Xrpt8z8aPCA+dxwWm3DtTnU9JqIHs\nvggcJKKyFk5EGdR7oyLLEBpxcEnvkl77RGbN3eln0zIXm5y4O8HHcO5WZD0x\n2R0U9u6ARK8IxKrStVIsERsmHiHG1l7gwmfl4j20XIv1xYsXLekCfTS5/H9w\n0kMmRPG4xFnADQTDQHlcFLoqosnk/hr3XeeC3B+JoO+YrIcvci67tBkbjY55\nh2RbBdVC9zMagGWp0bIbkSlpvxNZYbdGynp2e3AJ6eNVF8v/jcpldNx2Enwi\nQrepZwd4cubOagv78r9scyOvxeBM6l/aLRqIV2gGTy+4k1uazR25KVl+hszA\nrpX4Rp0SGLjg8YymApCFYSHzuvEfHiydURPhXHFeSUGnsu19YKOIr7RVtxyR\nSXzwph+P6sR6U/ibjmtuQW53+4L+ohDjAEImHN2QjFIlGBotgpMAS0sbxC+H\nLEIt36zXUusPIHN9FBomplJMtjCmgxaet1y04X35Qp8h5evhu5OOn/fvoV0l\n3A+zo415+wWzDnp6ch2S7V7lQP2JaKi+7QSh2rwlQY2U262qEm08LXa3BdcN\n/3tHy/s0XzoveXneVuy0N36hhVXL8AQLS/SCl51+0MUtXMYCH/4jvMxFCjRp\nO+dl\r\n=DbRg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvOLCdGhJ7MZsAfKP+z2FhtxiAFNTH9vIViSsaZaNBqAIhANHk8Gafiw2R6rUgn4ywlOHefYktQB8toaEcxQD7rSid"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190603213439_1559597898401_0.11770132760137608"},"_hasShrinkwrap":false},"1.5.3-master.20190604125420":{"name":"@atomist/automation-client","version":"1.5.3-master.20190604125420","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0fe1eff6d191603a0b9aa670ff955fddd885f852","_id":"@atomist/automation-client@1.5.3-master.20190604125420","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-Et90dwWv/kz1NI6ZVK0QOzsMnWTnnTBEg9ok/+Pkhet1VbZW7ilOBYJgR9dq21aLZw4Ho18Seq14/30Mj1dN3g==","shasum":"8fe9e7d58d31490db270040a8b5a7fbfbbc738dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190604125420.tgz","fileCount":624,"unpackedSize":2984069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9mrNCRA9TVsSAnZWagAAr04P/jH6G/leJnhRmvdOfZmV\nGE/zFe5EJkOfQJJvRW2XZUTAwMGYqla54pLS/pKFrdQ08xjB8/wUrwN9kFEd\nugpmCZ22w4AJvGvX3ByCJwpZkH5lwACDidt+vX6TwaXBV5VafmxnMJgH7jNP\n8YlUHBGCGqWwIi31lFtlBPv1MhRX5Dt3fBwubDAnUKFO/G427DSz06DMPoD6\n8jiz67v6M2TLPE0qccuk6xzW14Sanw0db2FPKuaDUEYKU87MnnEIg+tTaqBI\n3o1YPPnpnkTvASpnB0Yf3xEix1fa9tiT0todlvo6KWtARZTQGTZlLz4qcbI3\nuE8YBYx0M4qm5DCib/5HGt1utLDm1GEet6azTlrKUFYjcm8jkmdNwUltUQsv\nYubJ47q6K/nj1vb7gzD6uLEJYTPUMWXTCu/+GihKVp82DOU66UOqjeqP0TRH\nQBvkdCV4eCWyPFq0cvhUEQy+0KU8wyuqUR4MpOiXjYwFjjIK4Umuz6JB8VGZ\n34LuoOV4fq8VcdDhc2THsG6bxuN5PNaXw0c1Ir093/vHOIzWTMKIyjBV8Gy+\nRk9dxZq9664INgukHcYqXx0BvsO0xXForBNaqhZDa911VgOuzP1zo1RgYn0K\nmg1qlcDwL/2biLOyaWht8ayzwhGpmqp/1E/g/bU3qyN/yPb8vTxGSvfWlkJa\nChLK\r\n=2WSY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVsfpr3wBA8kElGKR5Tv7nZDZP9gor3Nf0U35KB2jc6AIgUcm3CcxSrujRad75T6dJrzKwJJTqNF05cMTWkEEQ/Jg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190604125420_1559653069168_0.1841459344697174"},"_hasShrinkwrap":false},"1.5.3-master.20190604133443":{"name":"@atomist/automation-client","version":"1.5.3-master.20190604133443","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6e7d269c39d9b9438849de5de9cced5802c80f3f","_id":"@atomist/automation-client@1.5.3-master.20190604133443","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-BotGd9KLdMOhB76Gck8OFegl5yWYKaN0Hhdrd2UET2Pb7wcFjO/7te1ABgcG9DIRooEJBY83XhHWlDNQ9ZH4wg==","shasum":"247af3b37bf75f039099d3661d8d6daf182d1592","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3-master.20190604133443.tgz","fileCount":624,"unpackedSize":2984427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9nShCRA9TVsSAnZWagAAl8wP/iao2R90LSDFi70M7mqr\nYRRwqsffMWaMrBcmUr57JnD+2P7U1ABUh/7P1fw5K+JI4xw+oZ4DzDCOy5Fk\nGEHM0RoDL8eT8aFlh0syXDamAihH1TiqgT1xEG1qSQf28T7kh+VM6/Xq9mSF\nNbAkrSLn7IEYea7fxSTuCPAfjPgX0R/Gm7rXuPCfTZDnDHoswHWHU3/yacxk\nNRHQDlweflhGjgC8LL7P39rHjCfBl544j7nCo6KTRxeN0bVPzHyfQzamLnbl\n+3VNBwwNgG3QMIdYyLwJlut7K5Q5zGX246wiAbPJVIAOPjuZt/0qErmrPmd9\nV+6U43xys8zYVBVPiERuX7EROaXHWXV0C9V+CsLNeO/XXnvxI6E88UpQy+2f\n6/ESYQJ0cX6OAynv4Vd1eYy6sP7QEUJ8To+uekQSVPdDDRJ2IVBEGpcT8DHd\n9RH1gQGMqjjJGDMR6ZIs1XsRKRigabPRb8acgyC5yyv2REkKbaExeJA7UAN4\nfqiDv5QsDM51zHediVL0G4l+su1a8ZGPWu0+0dlVEnnfj1nVvXFKR4TGQlzc\nnfpKYO37AGSaNp2poeX2av7uHQ4PNELGJJ05lxvuJ2K1Ft+TI/GlNw46Z6EX\n+IFsyPp2ISUXiiOHVJL08Zb6DcNCDW/h87v7dQqROTtEyKTA+VMQG6IO4j+F\nXYmv\r\n=8GII\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQDwX9v8nOOi4a1M0dpZohFTnvvi27SuNvhPoY4ICcmgIhANvObpM3dTGewFInCsSVnv2D/TjzwCvB21cUukssbtu4"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3-master.20190604133443_1559655584563_0.10948036751531975"},"_hasShrinkwrap":false},"1.5.3":{"name":"@atomist/automation-client","version":"1.5.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"2d169ff0b4e95dfc92181c2adac21a6d41a5d71a","_id":"@atomist/automation-client@1.5.3","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-3fRNtfWAJG2nUMAgpM+ZYkybclcd+AxpZsMe8CgBRoGQShDTZdMHF8ZXyEC5oot9fcn8ixYT6qTk2n9vVEGaXQ==","shasum":"f425f877247d50386a548b1a70b20b582cbf9fc3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.3.tgz","fileCount":624,"unpackedSize":2984405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9n73CRA9TVsSAnZWagAAbPIQAJOkJylmKaPC/atjh/uE\n1zRtzktUhH4sru8CFi0aI/gQm19xIFKl44ki8hej2u9FhzBIiTe/zVu212hm\nStFyy0KRERUO/lSWa6emQui6izczUgC0JLDE5AvaCXOXFjxpK4vDkwJ5lifP\nBK5GQt+cLUk0K6PaT3NyCqJzH8XFNyZG12beZ6ATD0jv9d7g0ERfU0ruV4IA\n7FBIie89xg8421xEuOcKsVcAWbNZPmsaLTYjvfqOWZJbd35CvSvuLb9wwIJE\nvldF15eRK1faMu/eibieQujAmOcRNhB2Z8HifQaQjY3skCEP7vgaumDJCgcE\nOT036g0tr61VjRb3oiCWkssFJ8+L/KCx4JDXo4mA82ZnjltNu5uw5broZjkb\npC9Jmn2L1iFJh7qazGiXKwfuBa5LC1y3p1WSGtR0Ygf5XAIODeSOYLQ/WAEe\noIzDDMuFe5/GnhJfG9KFaFIP5uCdLp/kjsPDcmBRjuaGqONmt9LErmM7iEYe\nDvTPap8kVKkKcabuaxZjHDKtvvv9yePmIxDKpTzVFxTLTTN/nWLBsMeeJIv0\nSKK2Gzr5PK1sjjSufvuKU5L4Y26YY1zFhoGVir6VFB5yICMPy2viMXTZyxO3\nXSUBrUtaL0FFrHhU2tnJ+KGCz8/u4uh1ZiRWwbgDzN2YaEAa4RcRVBVbD3Ge\nQNGz\r\n=fXgV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtPSwkHCb7d2a2+jKh0SPi0j9X4TCMuRSnqVEB7cAURAiEA82gsR7r4G9bLJNcj+XtvktIWCq3QmbEzzGj2itQ1s2A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.3_1559658230296_0.5160025259486427"},"_hasShrinkwrap":false},"1.5.4-master.20190606233707":{"name":"@atomist/automation-client","version":"1.5.4-master.20190606233707","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bb46343a7d3122911eac2e7d80e8ce57aaae61f9","_id":"@atomist/automation-client@1.5.4-master.20190606233707","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-grPsaLsj74x7iuyNURazVWOqib5l4G0TA+KXp+UTJgW/jUUMBEY6d3EWPF9qOXKw08UK1RA10rS1M1Tuzr5/xw==","shasum":"bec975f1e324a76265cef3634c6d910f2536e408","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190606233707.tgz","fileCount":624,"unpackedSize":2984794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+aTTCRA9TVsSAnZWagAAGBUP/2xqvyWVx0dsEsx1Jp7a\nnsxQW6qVyeqhGFV5PRtS/QaE8xzTLafIiVj+THJuQsarYEoR8X8HnkWNyhdI\nt7Kuq66aYadcmIgdmPWd2KvXXxa1g0m/XwYEgJAILAecHrZvKe7xu4vQ9kbO\njZiaQOspBCCIeOBfOj2WkJl862uPiVM8imU6QGT9vM3RiCuiffUyYUeNcrLM\nUaA8vMMOzPzI0CwWU6+pyyOOObZmlablTpug5SHovDSxGw1OujZOj4Z+gV80\ngdQVvhtFEfLCUdozHICYQYGxeLGO94fhwXnloziBZ3dL4EUqQDOrnt7R+In6\nO5fIP9BKNWkmG3VOHSxyEZddeFWWKJ6FMzkIU+iPxygrcgHi2NTyb2fVJCCA\nAVjDzNamt3xYdtzI6NlGPNXX8cakVaK+ZUkT4+bSarqf9lX7ktYpmdU2es7O\nkrmQIADqt68J9lb4hHX0hNhC8oLEJh6bv0GmAtQJW9GKVhaLrTvreNj+4TYd\nX4ZBU/vz9mcR/W8oXBOeXjSl6QgAPbGnZpv184zxsYvnJ+htTMHavLluzTHX\nOllaG4GApXOhSvX3mTJ4XPEwIbPNk7zlEYtA3sONIuDMzWOVEJ5Jm3YAuOlM\n0pB1TDQjRsJusM+JOoCLIMl8zdPVNAizLaiFaazjc+ulwMhSoL9qmiDwwdXk\nqElw\r\n=kvWS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/OmEcwoBIg2eDBTNxNfXAG4stAc/z20sXWAPTi+sahgIhAOYJZLsC+ZHOwP/6VZ0XzGpcYhHHZytJDafDukR4lEka"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190606233707_1559864528867_0.4027184690030492"},"_hasShrinkwrap":false},"1.5.4-master.20190617112446":{"name":"@atomist/automation-client","version":"1.5.4-master.20190617112446","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"72655e5828e53ad9e301ac00d13c49e462d29f84","_id":"@atomist/automation-client@1.5.4-master.20190617112446","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-SxlwwDbdCLkl4QrbEDr44OF37aH9/mOStABbq6eryUbQ3s+NxnhgrwO9h8YOGnjAm0xdc+h2+TmUKMZ7gpx00Q==","shasum":"a6fcfbcc0a278ce831b11e5d6b7f28fe06df85bf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190617112446.tgz","fileCount":624,"unpackedSize":2988579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdB3nwCRA9TVsSAnZWagAAl98P+wVr0hk9qqDXKFn+G5ok\nTzuwbmE7vUmb2AE1wDJG7rHZucpd12t23nq4ipSidgFKRqitw9xPam0b6e8Q\nBmZKARMaDtjq+SqEOWbtDyapiG3iEke4hQHHOJPu8/nLPO+sEG3t5FA7ZO+8\nR+nrK5WGMXbMO1cGdmHzJAnYon3uZRlgjT+BmacINfIntILKmVBHKnsI1J7V\nJVmEzUVwwavt78y/tMXiBkCR7rO3SIn+aE3t48aoNowJg405PlHI7AAR6CCK\nqXwVSYaeq7hmk0srQpKdwQe8LMlqk1cPIriRJjcgIA7gOSbI68AVYDUYeNw8\nC3WlqS4KclKBg+a4VXroAQ/cS71udGA5N6OxglAhyMRiOob+XToXsL2sz7VC\nyiVtSFud5kxXmQAVJVLxpesC4GPftP05LAk4eBykQFBrgqr2784MvKkmhm4r\nU0R4UQ5PSB9RkgjhsiUH6X99lL57lwpuAvhuvcfMVmIDROtxzVx/3W6f5mrY\nCXXMLdW4CaxZrF6n/Jn82lEMjqLyxGJZbnzz8xoR+xGpa9xAdSrsPUHPRW1K\nGhkUWmrauNz1rJPLkLXPkX6I/GDo3nAuzw2XDM5Q2aae8yeUPXZaBTjiiXhq\nBMMJjhuENi4dLDVLTIjFQRlWAbp9gbcgyJWe7Bt+uRKc56BmeLrh4OdVeYTY\npuoO\r\n=CkIg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdg1y9GFbE3VKjaAh1VGVGveS6d0WxhGVhRV29eYRkvAiA9TJ2rA/WTkYwceI0qjHyrnpBLLGlirgsfS0esikCMaQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190617112446_1560771055891_0.7367474448157982"},"_hasShrinkwrap":false},"1.5.4-master.20190617160836":{"name":"@atomist/automation-client","version":"1.5.4-master.20190617160836","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"865b4a33633f878a9654f17378b154b2fb279ad7","_id":"@atomist/automation-client@1.5.4-master.20190617160836","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-kjCc2Bq4TzRwwAhaHmDfJ7B9MceU0hS/MnUJNMkJM7+g8nWcu1hFsnOIqR4rd2/aNtjigO0RdWJ5LEM0iJ/ZFQ==","shasum":"978f9b79da118dbf724ebdbf239556206ac5bb00","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190617160836.tgz","fileCount":624,"unpackedSize":2988232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdB7wACRA9TVsSAnZWagAARM0QAIvF1diKbGyPADSLh+Me\nbMWR0qnad4NQkqb6ZZJ4smMw+/J8pNe1hhUKBZv+uIG+AoiyeYQcG+JzUeP2\niwMKpbbsT4Br/mQa5+iEGLCmKIiASnL89dGm9U+4cqFkoM96mhjwLCraAbCc\nUqUFsQD0IEjCXMl1lc0lSSrjOdcxXSor1ee1r00oBdSSzhlFACqbGibWEIEa\nDZ3IvxDrQHAkJpHoyIaxIbUp0TizkQxUwHpDJ5xO4jkt8pMDJVySHXSU34To\n8DeUO1sdtM0Dx6iPoeNrV7CiXdM4RlbeZS+yzwhLOp/oFDDzfR5N3dvAMNRt\nruAGTjwcZyzElBZMgi7etC3flySHJbYAFty3gTZVi5GQLrxMl55n12fM0LC2\n67O3DlFfRbtFmk2OW1d91XO7oBeADnqQH0XgmuRsGq7RdV5wOgbWBTrEGbRX\n5lRrKIZzGBxYV2Pcd9DzFEP6mOqEi3rLPcn2mxK9efGOxP9JLz6aEhUqYoLV\nMfGcc0sujwUiKs2vhJJJLgup1aSqD6Pg4XHXoWhDpFCm44UzWHD3+oNH29nu\nQosvX3L9RczrRZ1dlv88mbuS/59znf3k6llGuPjR1mfFylP2mDzcy9rOAdPD\no7qaR5V3DGzPePIwT15B9rJxGDWCB6fXNPFiDOctMFtdn2r+VxH+pvq8p+o8\nFOg7\r\n=cmB5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQgEpHU7th1dPMb9y/G+6KoqBBwuYWMp31JifDO4g4FwIhAOgJWWJDIpOVtk+PXcbOsriT4jEKtrli8QB2aMZRr4zu"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190617160836_1560787967723_0.754143186304072"},"_hasShrinkwrap":false},"1.5.4-master.20190618091503":{"name":"@atomist/automation-client","version":"1.5.4-master.20190618091503","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d1989bf73206fc64cb9a4c53af88c3636f6f65d7","_id":"@atomist/automation-client@1.5.4-master.20190618091503","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-b042WutpSxLhM1vSVjGYdk2Wiw+wLsHEJDYPwNbHEf9bj3GGESCoR1Petc126TEqdywHxYueB5i4E4LQdV+7YQ==","shasum":"01e0a411d82dcfc1b562b8c59820d45ec6d00aba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190618091503.tgz","fileCount":624,"unpackedSize":2989514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCKxuCRA9TVsSAnZWagAAkAAP/jWc8kn3UE9O+tA7r9m1\nHTuBptXkYj/0RDnuZ748BgOCT4RD9F6lqXXK/vj6vxNgZQ0yDw3xI/+sB4BC\nhSrHFAzH7BBPVOb/B954Slc+J2iLml7BWAEDHeXCVYmr9hW+OeGpH5DAoMTO\nQeuJQ1exbglA045F/ZkhCtQFmmzKaeFQXK3JIcIGF83iZORt3wa6j1jeY7Vn\n6hjace5frzBwoRygWw8x7Y0YDfeQXvbmdMP+AClQDR3JrQeui6hlns4yjGpM\nwEGpR9B/t/EHvSVRwKGXreU/4TlQOEzDdOe/+DJt8mnww+0LKPvxdMKDpOBR\njOQ4TSCunDw6a6+zn86PJjrpu0BfojY0Ai9ZZ9yqEvTCxZyAa5Dl5j3wZFWK\nnwLXX6tsLZtxH953Dq9U1Jg6A6Pt+MTum39vhBR7LXaO+153wi4zLNQRJYCP\ngyFSekbY0DjANnKIvc6WEYALljDSsw3NtWRL/CWhzvMDhs8BMA2lX+MrsJNz\nYCMKf/v+sHQNnBd2U/iH0yawFuq7Us/2UH9DJDGElGHqMXUgUXFb4Wom8iOU\nXHEU7sBh0aLTRD0du8M1i+AlstukGJMSCVpZtsqJxHpjzEfXrwz9nALsrN0f\ngkCXchuCNopP94432Hwv3pYqpJSnizeG99jwsLHU3SqmODcH6tmBpb0uGPpH\nlMMq\r\n=bRQM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICusDGnJeVvo21Ejj+IlqSFRwYCL5M5hsumiCOdcAqAZAiAJtQqYSeJdPt69fn4St9p4UhcXc5IJjhmWvSVX0O6rdQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190618091503_1560849517249_0.529806037683068"},"_hasShrinkwrap":false},"1.5.4-master.20190619135120":{"name":"@atomist/automation-client","version":"1.5.4-master.20190619135120","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"72d4bcd66c4569029b646d875c1b2b87c9c49944","_id":"@atomist/automation-client@1.5.4-master.20190619135120","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-epnLJX933oWciUgtl+Ghoa1dxytHfUtemkL6g1hhzlgRC9tGxK74+rhKioo++5j2G+nOpCF+x9QIAotaoVHH3Q==","shasum":"cf039e270c99ba0dbd1cc693c6e30b14fd6e642c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190619135120.tgz","fileCount":624,"unpackedSize":2989950,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCj6vCRA9TVsSAnZWagAA0RoP/2FF7bvRS9rU+ULu9sGm\n/mEkk9Nt0mtGilcrk25vswr/iFCxnS4qBKOaaURy+Wz4BlpQTy0zb42xKcLK\nVRGbxbFHjhQJMlpCvR7QuumaFvZXDwrw5/1TZ0tnsC35Mspn9n3Y60A8zTa/\nLWQ8H4vsDh4+pdvIyTSAjq2I1FyLodD5/39N2tRA+G9HfDS5HUVGjRQnilQ7\nYJhs4sJf0W3heX5Bf9HX0zA8hm+W+hddnmUFD6Z/WAWKqUPlJNYZ8lpGFpLZ\n+TCltSZhVOzBERPEmONnmCTQuGiW2IgTi1TP6qFchyR76xdlYXqRnTZEE0Fk\nJvoYcTNXrlEVnoy/pYUah8TIJmhUsZ11pbmjqI+XlpeFalbGR69J0cj3Bbrl\nepmd5Fu0wBK52lCE5vNu+SbxEns6/HSQL383t5dboaDkKd/IHnFafcGBQMmW\nupjE/qW1GrTGD5Z5f9Otwi602nEX2ERNHb6U9ddHjeWzRidE38nv5JNdLCDv\nCQ5VPMrOCKxRf6PI9UWWi1UqWybWEOcJzQ38tG45SmAkA+VSzKjDimSWB+ds\nGDZhcTGOfYm+2Ehkw9lpgPF/pCmT9TBGjNWvetVSI2CYiSRe/FS8atugQbiq\nC0H58VbJ9ET6Lmn4FaaEKKyuZ1ei1CvcjZBq60w0d3BKGaaOo4A7eRTgcYdh\n17yV\r\n=iScl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmf5WyV48OrNX41PyISjISZVp7+Wbzd8uR2PuBVFtaDgIhAMmlMxNxsUOSMCwiHKyklDLfs6mFNl0chngx5UfTaIes"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190619135120_1560952494512_0.15275112403128288"},"_hasShrinkwrap":false},"1.5.4-master.20190619152732":{"name":"@atomist/automation-client","version":"1.5.4-master.20190619152732","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5c49e1c85796f89ed681ac8d529201b2c5620e5d","_id":"@atomist/automation-client@1.5.4-master.20190619152732","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-vyi2ZzsHmU93j9BDgizin+5nlBc4g1B7Ow2rJJQ8WTZCSWWv1iAgKq1kkwkG2yS5jKBfIZCAVEMsXyDZ7wshMA==","shasum":"696ace69c75b0f2ff7fac4b578234a13c41aa6b3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190619152732.tgz","fileCount":624,"unpackedSize":2989514,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdClVyCRA9TVsSAnZWagAAx4kP/A0QY47mpHk1L8Q5tYvS\njvkq7/st5BWpdnH1HGrg4n3yvN691fJe2dCLbFuRU2L3W+yM1hpkm63Hp0aT\n6gMkRIvx5EaiADUafTLySTmxl5WucNC8YgJz1YGu9mKRLx8JmyNZR5H0NxRD\nDbFebp6kmRv3bdbRcJmCYFDWXvn7BRlDxvh0YD6R/cTjNMh+qYuAz4SGA7EG\nZD+TYItU3bxTaOO7uSJDyejoSzTYS4mQSC1g7ZRqs0K05DfBDOIGuicnXa7b\n3ktR4S0Fsj2Fsd9r+funze8Yn8gBRV9ni5hFx7Mc9UHcgw7qgiEqxSGdq29U\nNY23IIXtCeueClLsiPb5xShn+FuEz7Ip4LRUUB4exEM1Ibaqh8niIOSAtRL8\no6cilLJyzp1De1UzCVFwQal56KmnPlnlfDvd/NYLzTqYcCdO/61yoHAOGxWm\n7ADqb08Y66DZ+yx/I0sWLTPUsQ4jufk9k3aWsGc8t3uc7kaNUu3/v8oh+TTE\na19Dl9y5lNiipeSbt+oOz7tAYeWjQDx0lj6mIT/uJd7/JBbJbkFIA4RhCHBg\nI9aWadHid4Lkuqnl2DidEysCik9JoLNNX07isnpf/UQAnss7j+8ug6Ei/h1+\n0pu7zBMyu+N5vm5pz4Dxrs6CXsdukvatWMLCj7mQRvi58KU9ao6A+o8cZOjj\nC1o6\r\n=Ol8K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4l1COv+2TLPnGml0EnwIQ0gXKnV+ZBHyTrtmTGPZWwAiEAgqg/xLVYye9CpiM9qvlhnvkG1h2GnBRl3+qVPvzTbOs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190619152732_1560958321794_0.8616839047019489"},"_hasShrinkwrap":false},"1.5.4-master.20190625181354":{"name":"@atomist/automation-client","version":"1.5.4-master.20190625181354","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2d056c91775a4a93d01eb6188334251495e807bc","_id":"@atomist/automation-client@1.5.4-master.20190625181354","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-myxHnFQdgl60HCiozJIVMO2KWZ+1PnrIX9H3w3i38xLeuxt2P5UJDQanOXvvRg0AomwUGZuzO5ehVRd5gdmKyA==","shasum":"7cb4aa8f962b347a75ea347d64f2bb3ce6c31af7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190625181354.tgz","fileCount":624,"unpackedSize":2990302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEmVNCRA9TVsSAnZWagAASCUQAJFslWt7JDuA3/1rXdpB\n1unQ0YWtZYWWQ6vZV9iben6jC2SSkJsQS1BlT4s4s1Kr/EalGYLpH8XTmTgq\nLiN1kS6OdPQyfL9Fpiih9gHvFBuFGfmmmA87veetqz9MoMMw74AzEWZ5+WEb\nA848avPItWf1Hk/YOPbHnfWLsSi2sm9wbAxRE+f/NFO2NJixN2Rjcsrbi+83\n9gvtuM7j2l8TdIC97sgXt2BniCVMb13rvpOpW/r832hmbCCbQNnfhxijbiHK\no5D2oR/vWFCr3qLjBNCHEpFvr+pLYdOWU2fQcqhw7n4xnezyzTEv1+cJP/U9\ndkd2X7dMkdwyI1DWkcIHklz+Wqcsi80Th1jPlmWTGrAlRO62YLRmy5DSCdYj\nDPhHQKVyqJE1lWgV4lp0PGjurF7OnNNeytY2AJkki2QkfHFUu9T3lmBFMvJl\nkEGfoGrgDU7mjKKbS5VpePg9NtFYFGqNXD6hEHGTr1vb8j3atZ2gjIEgn+Hd\n42n4Tl7KK9B5DnqoSIgNqXyOyw4hHt8xJnmeM76zPqS4RbF74vHtSu3Yrglv\nayrQIIZHAfwA7laCTmZqG8NmALdGhKs7/lchjmqpYt+8QYk4z3euzNkXcaxP\n9Szx/iEC8qoEzsTc51rNpuhFxnRfkC+InB6AReRENt88z/iVm5/y4HuYP191\nksSP\r\n=cWsq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUf32fDjb7Zi9Sm0a2y5vDylynpCPnQN7TMR265JQXxgIhANEf28MQ9lxWcZnkf/Mki11FvDEF5c/ZD5NE48xzF7W+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190625181354_1561486668382_0.14192977163745701"},"_hasShrinkwrap":false},"1.5.4-master.20190626144326":{"name":"@atomist/automation-client","version":"1.5.4-master.20190626144326","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ac978ec61d5ef2220ed9a34670f10e358b80d914","_id":"@atomist/automation-client@1.5.4-master.20190626144326","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-xOzM1R5KwkgP8Er4jVVp89UBdHDDZRS6N5/yixF18bgqKGUkrxe5uFdRifG23x2XH6Zzn/oYz4erpzJqG0NjlA==","shasum":"8306de10db6122bc1233867f0ae8c7ed01cd911a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190626144326.tgz","fileCount":624,"unpackedSize":2990428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE4rRCRA9TVsSAnZWagAAV94P/3P8BlAA/DY9gk6VgmAJ\n3ZAXxnVNuqUfqXnx8w3yDyn9Q3a/+LpEkBzQLA/wtnxOSZuzgyiaonB1wbq6\nup4CqlNDKRCERsb/QY/QgZN5WPbxO11rrTDzHhFI+k+9xB7clqQjopCMrG4c\niCPTZD/wUmRjdPTBQzElp+izPVShg9EBmuNfVDhL2haLwrPrb3p4NIva5fPo\nxjdIZdAoojF7jXY5XCDmIRMiqAWc4g8KpHmWF7CcORvSG//ZYwbX77zVv02/\nBOUamvk/Xadg23nb9/PaVFT3umlfj+6E992UR9kRFAQSX9eYcwp/Jq1wASv6\nvoDFPZUfYf6C5ty0hy6qDxuQVDoOiYf08lERb0dsehTmvZfZ9oscSP2dX4Gm\nky52rLqPI4fyCS+t0zijh0/rXN/Fq4tf/Q+vt4aHnyXtd5uRs1tTqqCWUpg2\nq948HKNDZi0tJPc/IYreVtnOH/G2Venx08p4o2Vr5jdesHRjKdRjRJ8M80LT\nFJAm3wh2GHUf+VhKm/6nw0a6HrwUFoXH3dL1nSmZ6ZRp5DPi9712ZT53PCax\nQQogZgCq+c1BM7f4z0c6/KYJBAAqRqZi9KIA8DBFZclybrKrPu5ivkkHt88o\nZ0psiDtWB4emJ9bxDQMizj9MFEP9hOxNzHENvee0ORkXbyhFsmCWkf9HyeC2\nhv+P\r\n=tCk8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZFlN3/CVnHj9yYQxdJBMU7YiVlmA4X0b/xqdZNx6+ZAiABIhF6zsKV0MvzW4O6VcDt+UU/XGF/hC1GQrOLQaDZQA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190626144326_1561561808730_0.5671786723898948"},"_hasShrinkwrap":false},"1.5.4-master.20190626214344":{"name":"@atomist/automation-client","version":"1.5.4-master.20190626214344","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"44f71e949ae26029e7383e5d89c10d850de35533","_id":"@atomist/automation-client@1.5.4-master.20190626214344","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-txtTtYt04aoe8SscWu1DeU9YPBXphPnyhHrO/43cK6s5N+DlsZHyZm4EZb7kZbwNw2wIQloxX6Q+grRY0c1voA==","shasum":"b1909af88cf4db394f97323543d5a784c5affc14","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190626214344.tgz","fileCount":624,"unpackedSize":2991221,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE+gDCRA9TVsSAnZWagAAsyIP/1Z9JxA1ltUcEsZTrOhJ\nFV918rAN6qsZu/Tj0z6VcZ0vgWwrUkR4XucOVMZC76drxRyPX5RW2ZoGYF0N\n60NegWGr0b/IRNq06FHW3TuaU1tFXuFDfO28eh0YCgb3srXpz+aNqGqElD3K\nbfh/CbGYC5rcEhwpN8Y25K6r3PePRauul0puz4PD2JHZNtnbJlB/A/STZO+y\newPE8B5CmQ4NY7rs3i+/BcHCRWe2VwzvEhTcsCJjLHuJeW/uioiqqcZJZhzc\nPQagULGZOfAw7/nVRCK0W2BTP81yLhWXAW5c15pbV/nhxxvkt50f/EJvbUxK\nIg1f7iFt7C9kwo1A2J2Byz7mS9Z8dt2LBSlEF92BmIU5cfwKnxI18oJ70Pbb\nArsTYKQT6MrVIr3y3X3MnIZotgo4/xIDraOGjVxDqbYkqB/jdiCixe8AQoIR\ns62coEdyYzqR/OKt5JBEpTTZBk9ym/mp+5CGpPnkMi9qFqkUkE0WW8QXKY/x\nCTrr0FpySLLScAUmAt9NGp6C3fdUX2bzp9iEvRL/cOfmNL3A80TvyBWxZFi/\nTTweXh1P0LkeeowesCCPoZiMlp4JvFRqaKRh1NSmVYT9wg6LrvVZ0Or5EE8u\n5tqyvPz8zD1ghSj6eQ1ZO3U/Sz6rn4fWZwGqbgs0QOxiB6lNhMJwVjhf1P8E\nlEDb\r\n=4n2T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmYJQOgNlJc3irZ3SNFDhKmSCMCPYNyh7YeOaWsaCQLAIgF9USMqRZ7QU+MJHCJbYeFcWHQwXGDlA0h9yUa5RXlR8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190626214344_1561585666556_0.8655646583250949"},"_hasShrinkwrap":false},"1.5.4-master.20190628061747":{"name":"@atomist/automation-client","version":"1.5.4-master.20190628061747","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0c5a8c5c7eadd70dd26dd2c4821fa8122323b092","_id":"@atomist/automation-client@1.5.4-master.20190628061747","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-GrqOhpIhim+sqv7NW4fY+ZSqTNJXjIVbJNnyrMjNIOFnKqOalajkDdKtgaNuk20j7rMATFpanncyt5ot3FmgNg==","shasum":"b104b55f5085d4dcc4f2c17ae14b1f272bb6e61d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.5.4-master.20190628061747.tgz","fileCount":624,"unpackedSize":2991478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFbHJCRA9TVsSAnZWagAAVK8P/RIhlt/LVBz2ArmdKpOY\nN5N//FHQNnRG4sSCWvcxiN1WIIWBPfpfhwNbTu38MrSWSgCkvBAvVr/wrEGw\nD2NIEvOW1JBSdHkyfU9x+gv2JMHGvNfAG2VmGNzTE7zleU1MpzhR/nPW2wo3\n8nKIHEC/nYtfGhynHoYyjI6By1bRh7n9uWI0p9BeIWjs9JXQfxNcPqzpzRuT\nKrhBQodqVwRW9w/FpK3Hpl8y5t6Rr0CWmHwo/IzCAeyosKoUo60Im/VwmDxk\nlJ6KyAtlsNv4FLa+/nHO82NCNU+fhh/tsfwqr1eXuhXYy9D8SbpE0Nk2v1j+\nbdP3f4JhXsRShLYEGgmprgxPUTn3K7bPNM4/3BNFSJKBlOwTqiJ28+ac8mwv\nxkElMmJRh0AhnvRFl1hokRXXvFHRxaXzq3RJ29SCL+kxnqS0B8Kan9xq0m/F\nDhY4qtUCUPCCgSWzlMABJDxky6tpC+4K3ApvVePgpZxXfYU7r3KvdQ35vSKk\nmVrnAfXVj/ie3RZncEFWBO8dMfOmE0KZxXOFOSIGGlIgxAbc3b1yYq9kRrFy\nQ7t1cFLkSA81So99EYgkRlVM8++Jz88m0Af2nB2iw2IVprlSsyfIVNUVZI8z\nHAPOMPjufInshuFmh1dKwgp8FJphRG+ClZHScdMGnlC2vwHVXlZlJvGR5tSz\nxqqg\r\n=FiVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBpIxrUOGJHWF3fYeXMYEYcVScQ0TlTWC32ntr0ApkOyAiBlVzSEqKrOHRpE2azsMfm0aK3lMsYGmhXjX8uSYqqoQA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.5.4-master.20190628061747_1561702856833_0.47057862182344645"},"_hasShrinkwrap":false},"1.6.0-master.20190702113653":{"name":"@atomist/automation-client","version":"1.6.0-master.20190702113653","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.0","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.16.1","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.132","@types/minimatch":"^3.0.3","@types/node":"^12.0.2","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.0","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.4","@types/ws":"^6.0.1","apollo":"^2.12.3","apollo-cache-inmemory":"^1.6.0","apollo-client":"^2.6.0","apollo-link":"^1.2.11","apollo-link-http":"^1.5.14","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.1","find-up":"^4.0.0","flat":"^4.1.0","fs-extra":"^8.0.1","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.1.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.1","tree-kill":"^1.2.1","typescript":"^3.4.5","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^5.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.0.2","tslint":"^5.12.1","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1d9b63b48a0ced5966ec277164e2fdee1b0eeaf6","_id":"@atomist/automation-client@1.6.0-master.20190702113653","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-cD9kJVGk7HO5lZajMhhD738xAcwiBGJSwX/13jUS3k7xlx4k0ReysWKan6RSYud/SsGPAGw5Qho8k2JVbW24Gw==","shasum":"e3eba7751e132845e94c6f65dc36ad6b201f6905","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.0-master.20190702113653.tgz","fileCount":624,"unpackedSize":2991478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdG0K9CRA9TVsSAnZWagAARwcP/2Yy8WxZSHeScjthXxx0\n8jM5grtxpLaFMyLfzddlVMCysqYmiB/yp+g+WSuoRO0BG/F3w75oElzXC0P6\nn24F7lnDsyG2aI6JEgDDY7gZdfJWIsWmTuVRuRKO0raVHL4dXE+PNCSAXXS7\n19tvBml5RXd7LH0s6ZCy4f2Ar22FR6c72e9HTi0jT05Yyznp2u1dyfbxrcpx\n4R/PpxB/g1NXn89WCLLdihfdt9UzCP7NtRsIRTJpMF61zfX1IMo6WryyPf1d\nxJtKZmGrjuWen5px8YSnBtWBw4XMqVpE952xVM1q16KL3AOyg6/BhfcyAjUN\nex7llMQ39OmvwRHpJGZ4qGSh7MwNq4sRcAtTEGOCcFIIWA0/a/iO+JKJz+D3\n25kB88atzHQrQ/Tvlt63NVizpuMHglGlZaT9dEaC47shcDjhDRsjoUh5YuBV\nsgp0m0FgBZ95NqQumXQFEiovdMEN7PBaTVmHs2J/fbi3TzKbUkWrlMAv63/w\noDe8plaRqoT++xqw/9VelFdYTTgw192gUhRevyfcu7SRuUnO9uYJNqBEedBl\nxGBLo5WzzMchFpyjhriXCHABz9u3GdBwY2I8dTQ93acI0sPg8NH8JO6AMCY4\n8uNJo5K/34JdiZgIcsSJxHV68Sh8StwMvKrervCUb+PBPtsU3mcbS83pscNx\n+hbs\r\n=VuX0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0eiSR9eE3wCd9t+FL4VYZCle8qkjj54U6zV+ERk/TyQIgLsKeFhtr0a18b26ksGSbSo6TtFQZY3hLEuRPpAa7YTw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.0-master.20190702113653_1562067644626_0.06266144756146796"},"_hasShrinkwrap":false},"1.6.0-master.20190704103159":{"name":"@atomist/automation-client","version":"1.6.0-master.20190704103159","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"~14.2.1","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8b94f9e19be6b4c1c9a6a06926441e21bd52cae7","_id":"@atomist/automation-client@1.6.0-master.20190704103159","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-hkJgtJmiwujTVH+peLQTRwoNXhD7jAClZckQVBzf+mQ6YSfkAn49ujLp4fDCPlLkfU7QrXtZ+ReCAtCzw3c2Dg==","shasum":"063abf0ed842b61d9fab6ea2df7298ed2f64572b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.0-master.20190704103159.tgz","fileCount":624,"unpackedSize":2994110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHdaHCRA9TVsSAnZWagAAkuQP/AnG7NVcgAG/3BzVTSXU\nN6cMb8sPMv7Z/hxN40rDG9WIMtUEHBp3sPRBPtQURjygAoQMwHD54MDV+ESz\nldUKrWTg7pnE9/vZRv/L72uHDoQxqRfRX8wYJ45NAmdBwlbdhBkA1LM6qRg4\nDDQ2Geb/WyhmIc/wBrvpcz9DoO6alhTOGfAUV27+is75DDBTeFwpxz5ukYIt\nSKhzMeUOsDXNlvmsmjvD/EjHXSjgyn0mcCS4Sc8tYyyA80I5YYhklPYNlXPy\nOzGSJVrHEPVdl+Sp0C4o2kYmH473x+mY4oBPjrrA90uJufueboZnxcUuFWDe\nwO+bJ/y2JynrQp/ZOrJSGq/EeweInn6vAMLzWLQUTP9AaQA2CzqeVNGCfZsU\nCWRili62NWxqFWEYOCZ2ageJB6/uZblE+kPMMDWR5jY+Y9FK4zkJIpUHChG6\ncp5qtqiM9enVW4RWIbvmkxOBNYg7FO5dPh5XQIIsyAM+nluD2paKU/FDQTEE\nMfcdKpQr69hD+4qYEDMH8lKaBNylVwjwyQnt5vSL/7vHKvS8QKIoRNlhlPid\n8UXayCuukk5JD+/gFSLicia8mKqaYsRps7abOU1qahIHT7e913orSerHuYT9\nQ88MzQBJNRSXHejiEURaaxs1A0vbu3TMyqI9QZBKMzUEUJFGdp5x9Pb7nDeL\n7/zr\r\n=3Yz2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxrHlCNVGuBiNwlFCw08DfAOim4rnNIggR+dEjZzyhQAiASun97H+vu/QsDg0M77Z+UO5kwVQEpeBvyrONuO+dk9A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.0-master.20190704103159_1562236550114_0.4806657408095343"},"_hasShrinkwrap":false},"1.6.0-master.20190704104454":{"name":"@atomist/automation-client","version":"1.6.0-master.20190704104454","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6e8e5f090b4b0f1c998bd659e6e23028849867be","_id":"@atomist/automation-client@1.6.0-master.20190704104454","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-mwRZ8YuhlR05K99TIdCYrkWpl8Yxu1pLRD/5UhNBnldpluCByPNS7NXQU+lJ+NmrjsZVQz3xFpFcUYngVO9/KQ==","shasum":"f0bacc199b4c13b7836ab5226d6abaaa09deaf65","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.0-master.20190704104454.tgz","fileCount":624,"unpackedSize":2993897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHdoNCRA9TVsSAnZWagAAuzQP/jRD/Bnf+jzi8gw7ssGP\nMPggoyz3tJUb98IqVQzhg4unov75rxogP8PfvL+l3kLP1u8arytLzFG+EHWI\nuP8z3853zcM+rU0LsdG7EHTBP1jGyeq+OgCtwVN5cr4AXD4K1sVWTa9w0xmM\nXKS2zju9HBoqLOnco7usz3ZNYh1/H8rUfjSSsV1pFo+GybHqze3X7MGBDgK/\nsynpGNJ+z6RQHuloqjj2Kq2pRS0lBF6/PkFDGiaHhn4HT3MrUH/h123TIM0N\ndBKFbb9iVjo+iQlrf0dpem3LJQm9CqTPWg/V5gnj1NA8iS7upg93BFh+M/Cs\nytRZ/X6BNNZoDgoxRgvPN00FauSva4LQW5kOVhtmXDBb+/Q2PbVVmOUKNqJz\nY8mllefzWT1AMgWOdoOdcqrrR1AbmEyDb9Ng58QNP381qdvzHwKPooewBe+3\nOrThF34PrlBV8jUxSSkH5oWHOnc1MV6L/273adqj+4jZWw3LjB2NeqZirorP\nN0jT5Ax+SaPs08nxhh46FJp4GJmyPpO00VTz0PrhG9GSdrfR9ZNzoCVegoqA\nIBaiiI8QMbuzAQdfckl3ggO5cnwianakITu2366S7F4A/L0/sNWf30TfgKT5\nRb0DE1wtsR72y885qPsdo5nzSRMWThL2FJ+t19XvhrUaLjM5mrF2wFsVGHXu\ny0Ho\r\n=umdY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPm9pm0Bs59OemyjbXs054YaHZsUENTS7wqijDlwSQXwIhAKI226oO2FwzQJORQ54/d31glQ2Aoftyl7lml1pPC6+l"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.0-master.20190704104454_1562237452788_0.8522126546700075"},"_hasShrinkwrap":false},"1.6.0-master.20190704120909":{"name":"@atomist/automation-client","version":"1.6.0-master.20190704120909","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b6de9692affb4def23b4b4a7ed6d54018f3daf71","_id":"@atomist/automation-client@1.6.0-master.20190704120909","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-VDBjE85XbWfcAt7h6bPqDe5/o5lnoWmb1EUriEvKBZU36cPzh2H0FFHBsXxwsYSe2n8QUnTwD5OT5u83cA9DkQ==","shasum":"ee6565a92f8c3e41c00f012d6c641cc92838406c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.0-master.20190704120909.tgz","fileCount":624,"unpackedSize":2993937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHe1FCRA9TVsSAnZWagAAlrsP/i9qCFV6ak68fDDs2yi1\nc/6JOa02c/pEqeEuUkzit3+SeEBy4VjcyE3je/BZfrUMprFWcd1qKmhaB4Za\nsPQXYNnqb8dflNbvQ/nvt8liqt/dxckktUllVGe1/LHMG/remt2hmvfmXhPh\nJEZjh3IuNI/JHExPugpaOCDI6xHt2HWc13RQrL8JbiozKWAgRrLZhgVbMezw\njPrsAuHGmZAbn3DZXd8JXRRP2NxdazuXlzG/GdZjWkNnvxL/NnY8XI5z5tGB\nDZWylzeJwiu3ltpiJoVjEA3xGKup3C03z1dmeIHcsPLxz+r2/L2/RmxnMSCe\njAGj3x/Mfe2fIE5S6AfYfHIKybXVgXf5XojKt0bpbJxVkB4izK5EOc//5LNL\na1jt/8MjZccf3XRgKJQgU9QSgcFtAkxQ8jS+MUsLAzY1N8Z7HbbUKJotvasN\nO2YuHzt2LfCulmyLvdo18zs48TUyCBXB38II1JdIbhMZWZshxmtZGb579nua\njxfKWreFFmN+VS6pit60AE5yuXTG7/WQpq2KAVUi5U8bVtJTTtoQzNSoqxqY\nA1k17hH+hwY4409RmGGY50iVrCyh1uevcJDPQLq12Nz1XmB1UzyeVc/7Qdy7\nqMMvnl/2hocYeprPJ5lVo0aWYLlR3rOJCjQP7QlM2BOUlwLj4FNsrNxZb2zv\nvFNV\r\n=/Q5q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5dzBP+1DUWLFcjXHX0dMKO7b4oi382/3HK5o65Y2imgIhAKXUpjQuMmmFUNZZghrbyhYHtTMWV5SEJ5v0GEPzwxIz"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.0-master.20190704120909_1562242372636_0.5062103505690836"},"_hasShrinkwrap":false},"1.6.0":{"name":"@atomist/automation-client","version":"1.6.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"e4df58f53bd2785b0fde04ed7ea8f40f7fffafd3","_id":"@atomist/automation-client@1.6.0","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jhg0DXYfk4t/e+LLLp2hjUTn2I902U7b+6WNH+N++rvU/kz1Etw0oN1gRuKGucByLI2Ez5iTqvxyuxSdePDl3g==","shasum":"e56e5f3fde6f6256bbc721327332b9e4420f1f98","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.0.tgz","fileCount":624,"unpackedSize":2993915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHe82CRA9TVsSAnZWagAABRAP/1GBqHpBvJtoQsb2hwzb\nyLrgn1HCl7tlamNHKCnEpL5taCGoRPii1pkpwd2O148eHWndSU8uJlqigAgr\nknb2hpu0Dp4p6eFhtH4SdX7RYQu7U8+qgQBC9NFUQ0N5p05LI7QXlY0bwRh+\nhVrzR8d3chQ8TtGhlrbQ38ku8QpsYosSkPGobtYJTz2HkwI3sFL0UwxHlurI\nd+b0BOVzTH/GKHhFZfSSBVlIaP1YETxPJu1K16BMC+vwpPJThPqE03cttssF\nu3fwWclUvlLfVAoweZlYOsW5hO5bKovN7xyqIcx/Pp2yh5TvEehb2USVM1h1\nRb1xn3ST74kYyKvekfqvmZj6EZQVlbbjZ8AThd5qFK85lpHIFqCjPi+wg8Sy\nMeinBL2si8VB5Yy1p4GFTWXzqNCWFITjhP3TYfBUI2p63okVf6ppzcibvnxZ\ndo7iCWAhhnMOPbTtBLc2eybcrcl9i1B1Z7P48DzhyTEKAxNhW1VyRoiWiM2q\nTZyt/u6r+hhJ7hJYkxcevDkog1rz6eWsPsYujUATvG6kjeXFSokLs8RjSkCO\nGEjx5B+Amork27vgKSh5M8R5ZBsSeDNMGQtyhaFbvG2cY3IRyXjlzcrGM7KO\ntF+lzPsFeaxOC4p2zOgQdLOh0B92y6JfoDiKIvJW+9mrEng5Ld7bwbWFHDUx\nfAWZ\r\n=u1Qx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHaKq9UCondXouii7lT2zR+mqFkJ7Gm/5ZQ2cx+K/jMwIhANoHGFEWn1lw7yXU6xCuuiJCTjaMwNjRzXUW6Obowsc0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.0_1562242869199_0.687641939471209"},"_hasShrinkwrap":false},"1.6.1-master.20190704192303":{"name":"@atomist/automation-client","version":"1.6.1-master.20190704192303","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"46a920020ed613c7a7a6c24e995d946e4abc2754","_id":"@atomist/automation-client@1.6.1-master.20190704192303","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-WPdymWnKYxs5GILl5xQS1QqQrAMUrkMkKWOElYvrgbZJh1rGgbIN05bSfNtOw+BsNbAruCo517yaxnMTmw0U8w==","shasum":"ad139e65396696b6cb487c1328f42319de017c46","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190704192303.tgz","fileCount":624,"unpackedSize":2994575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHlL3CRA9TVsSAnZWagAAOcEQAIDTN2W5Yg1k7FAvL+uA\nR6vpdJhRLB2/DqYika8nejA764feEDCptwAupPuR1eE0XoIVnk5eJk1QtDh7\n7XqnSVR5TiQt95I+N17MfoxcmeRRsHVeDvnOOyf+NAsau1vI6aCU43SQlUgA\nMUaHmt7epIgx5+oEgclXslQlHh14nQj5Ay/iPjLMK3KgCO+5/mlCNMmL8Z9R\nTO2awt3cTwfPCtBbBvm7MyDEvkpehcNepx5QIJkC2YXqmhDcBQwjG86BuJY1\nlt7bFLBnjRDmPhAWqXRGmWp+czOyA9J2hYqjZpXXk8Swn2CrcC7a7Uwq6BbV\nDH8ywIpx+1xl/G2UMaTeb/rxhQdnsCk1nEAlOi+8ScJP+OXsSu4TGBH6dgSS\nuwPdUp+hdm4DCzr5yAJ5ZsvHA1mq3HDnp7LE1jhgCimrZoKYqGEVsCWeAnv3\nG6pE1njIq8pcz/snPteWkMIG2oR5owU4U8FEqor9Y6qd/XtnYSCB+kruoOZh\nf+w9sQLpTnPlScXU22DbhLgy5+7TcCFARERQY+yajEh46QINj6LgWRXQSlLn\nGB7Y2SaPPQHlOBA5updUm+aDq6kyePgd8oFyqO/PBnupzSn1MbheIrruLJ8e\n7GzcYj1QewBK5njY1RWVGv1y8LPkcbzL8+uWu091zVhEKOVfOhyUR962JB+P\nYjl7\r\n=KXSE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3NCVl5R0NKaLzXCrvnYpe1SeAXhYIQ9z7jYeLjCxU1wIgbDqoplMQ9Uvmgy2pKh4rkbtRJB0bvUY4ttA28vc1Xuo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190704192303_1562268406152_0.7229309636527963"},"_hasShrinkwrap":false},"1.6.1-master.20190705093803":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705093803","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705093803","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-7UdPyAFdIjqeGZy/Y/36TtxWEsGCU6oUUZmg4kFaDL7RyN/y3OKVvix+a4LZerM8ay9jBInT5nCxFNnROB+raQ==","shasum":"47b3a26133ebec7bb1148bd95a4cc3d605a6ff66","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705093803.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHxv+CRA9TVsSAnZWagAAdlwP/RzHhg3BGdCG1kur7ri/\na+3UxxK79d4z4sjWd0a7MfjJVdbFU7JlCx3bvM1wQWeZd/NXDmn4KkebEiGz\nAn9TIGcs8XAlreDBsK1QzCMEjQZFh1ZfjhvHomiiJ3ngOjE8al9gkN+Qi17q\nJ+DACulndsN+gu+Vp26zu3Ymll3FnCUQNeohLmjrnr627THMnWhQ9nfdNfKa\nkJXa07OJzDpsiw31nPivWPdrkST1U2/E6jCNG6kD05WGC6jqdj8C53WoVNHV\njkMt1zRJDchGClAb2Df6QyYpaVkDfYYrp/C+vTSV4w2oNF/qJGBp9XCY+Ywj\nxiHqsZHu5/mget9W131ZmVlhgkiXnrwqw8IXKYg2y0MDfp5mh3BQKJP0Q4e4\nW5ie4liQGUa9UVnCCjAavjjtlLYttmaRyXA1K6dnBjFMWW+m/7LRFGRDFDed\nmc6XQhFhExa3Y/a2XMRe8RdMEPdZjxqMCbaui8Bdd4A2HEevL5Ou40twUUHF\noN0OTZ0o9/8BAgQ8rqMnELOcsn98XKP26Png5vUBNDomumHw//m/bRnIbtvo\nuZ3r/QsY+XRshGpRsAjik+fBu5U3cJe8HIa3T/ezuUvhYiPzysG90ETeIQXy\nxxZZTYUAisUr76YyY/eldfSe8V/EXfmVMinCagmJG92cW8X/Id93poNO/lDe\nMh3+\r\n=aPyX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVuk21cn8fRqxSNLfrCZUt5sapTfGx/whiZhE2hzKBTAiEAt7RhLBRUOrTmUuIXkncQVHATathS/bL9LKcQGMBO6VM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705093803_1562319869245_0.14015577801183432"},"_hasShrinkwrap":false},"1.6.1-master.20190705093845":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705093845","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705093845","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-QgQWIwBq4RGnpO+vYgA0VkKjxWetaVlaUoPUUoMwm/O5XByx4GsJk1ppyY3CpzWlY+4Eljt3IPZXfF179l9nEg==","shasum":"dbc6941ee59b3fa0f3982cd6cc1afb4e7cd4caf7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705093845.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHxwSCRA9TVsSAnZWagAAIfgP/AnpNz5YpewA1GmFWRyk\nGPUs6T4QI1G2pTaOVSULw2uIre5nLhiWkeAtMcUyESj8x15YWW+cwMdFDpXM\nYQPbQxuOuKm5OmCYkLA2x+SIel6167g6og7Apn4ZfvLmUGZQ/YAXzJbvpNSy\nSwjHqDAGavV7FvpkkMIPr8oUXBoz+RHSPrDONFNorWY9Xv/XoVQOFpthTBip\nyiitrpBHpPKRg7MThMYHnkbEjH6XUa6zsuJw5iDwNTqUzhGsaaZNCe7Is7pA\nFs3edoC33v3RTHWUfaHO6EPTgHPII1DPPt5ZPaoeGa019s371ea5BFNlk0NR\nDV3AqoNtLjlV7GMwTuq/uoM4g6j15U2pREtTDCtxQg/iScqUkoIV7rpFUZ0I\nJnyiEJ9406nHFhBkGDs8xzgWhAEBrcHcdakrDvRVBpnT95sfTaHfR6uI6ZvR\nuknkreR6VhFF1EiyxnkgGCOLD3lYHn+ZTS404HxJ2Hnl49CH1uTdv7zn0iy7\nr9kKqMR9i7d+J3msMyyBhHV8fMIBGgHKzk7ZvZYSULsllt+B+XissA7x93zn\niXk/7j0T1EJ30vs0R55j31vf6xhDcUnx25pUArDvYM0PjY5oiX3HCOt+oZ6n\n8dUmoSPNI924u9dx3WvTwRShjqp9ozcNTybhbsZQ3l41gVMxT5618vDbZLva\nti5V\r\n=NRL7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0hYTcyzWwu8VospzkOnuTfY8hSWVqQd0hOPzafy5pnAiEApABiX1Fg7kS4EQeab4bz4nstE2N4eJ4HPar0eVV5p2g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705093845_1562319889655_0.1634085076914129"},"_hasShrinkwrap":false},"1.6.1-master.20190705094144":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705094144","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705094144","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-7xfkQsgoyuPkHeT4zhRhMxXDhbhhrxKGZw4XqXlIDnHbK0jPcB6hcJkSmaPd86tlJ+FoRpOBmkMbor3gdjiCbw==","shasum":"187916ef61175fef2e4eab791ea1a436615c8f1b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705094144.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHxwsCRA9TVsSAnZWagAAGPAQAI4S+Tx4JpGMuP9E8PPa\nC827yerHKaWEGMeLT515yawIQVpc4YAjxv+Ox1Ljfnr5KJ1ly3sXHLzTLrgC\n5wdbNlwG1J+Lw6Cf4sVQm8IQkcnI6Gw+Sij6GNFFNQrm8/pClefauKajvqOb\ntiR05FoIVmDP8dWcwgqrs8/5wiHE9/1ReXrP08h3pD2wjSz+L9mYog9vhVq7\n8lghNBP8ASYlu1rxL2xLidzherrw0hYkBrNKplKfEidTCn6BF6l9IYg/JcZm\n3eZeZjMc643Hd+bwuMuhjRpo0hCPscuu4JPZDmoEny0SUPWAtxXVGseMbhS3\nUQQlx+Am5/+Q5RInYNoyEDAw6QYxnlTP9XKm2enVFYU2x3oO73ZH7mlmw5qr\nwTQINRf9vGMKE21KWH4buRls7J2IaHkDgf7riwVGoKM7I9avA613xFeujBKb\ni+eM3NwJWd+jcmqlfr7+1NE5qSBAh2G8eNxvcIMiPGd/Aq7DR9P/CIXABggD\ntdDJ/7q+V1nyZ0Tu+OSQtMC192qp3YtzRKt5yQTZtqv8Ztcb6xa7r6V6e2hb\nC+hIopXH6Y7uXUTsXocVz9Fzn0Qi46WbhjI/rDCctaMX2hNHqNrgvOOJQ5yQ\n2P8+nTue+Z4VrMzgZ601rnGJdAEwdcbnj5Tmzz53A6g/aex+qzHM+lGsDfTc\nr0Mu\r\n=TKCN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdHS7S/QpN1ovd9329xlRkRn9W9bA1C6fLUIBu6sAAfgIgdVG7QaXH1wOGGW2NgfA3/tQoRqgXlQgqRC9dhDiA59A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705094144_1562319915336_0.82693298753505"},"_hasShrinkwrap":false},"1.6.1-master.20190705094856":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705094856","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705094856","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-ybYFyZUE4G8JpDJ7h4qLHsvtJzksOY0LNVfijNnhUyMWkqFSqaIhOefwWkvrh5EUpGNK/3Sr1fOlhR/vLoqHcw==","shasum":"429e95b8ab07bbc154b51ccabdc14ca556f351a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705094856.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHx38CRA9TVsSAnZWagAANHgP/i8AL2wbTXzQBoD3GqGW\nIaLQvhcAjLAnGIjRKC66f+AM4xtGenAMP26jg8FjwJDnzYXs4wYak/9+jm8z\nSySjYlOa6yqgaqtVCpQqZEqNQacUcYyrFgv1UiObJs67bjEUhaJ3HoCaijJT\n9kNdJNk5OHuFHhDsPA3/hZoaSkwXcfXUg0ti2sT1S3B1mZPMRHg+W9xqRMGi\nZ2hKE8Jaa/qUrlHB1BRgwP9Hv2FpVOp/hM7rnE1hhGsAV57/TqivAMay8bQZ\n5MGtoJi1n2C/2aFzgSF5uoFYbf+KYQKVFvkognQC20vKgxKlHgD8VyMtmv1W\nPxCHiGSHuRbBVH7FP0+IEFVBCS33zjGlB5dd7oVFS7InjBFHhUd4tYCYqAmm\n0ajVrXhIKHzXmBX+jWO9itE6v5H8ghdFe9bPG5bALsPeAaj6QqTv4/3/LxPk\nTLEP00owPVnZNNKL7tcwi1VWr0NzcqPzNXD5+4NvKx6PZi8VmDuGNw9SZ/Oe\nLxhCVbjZtDpTn0PI/YoQBFVYIZRqPYfhwBQOIRHuCBZTIRSK2MzYNJSKZqhO\nnWKRL0lgZUwaGwFiekT/BqHCXyUDjjJr8wHrp39b/7erZyfivcWVCRqatlt+\nta+Xrq5iSw6J4tKSYRfoYZ0gRxdiWYhVblXpgqXQC75ub3jjxDc4iSDMLcP0\n0HsB\r\n=XdiK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCIZBtwdj2AxL/u2iQ98XJ4UEKnuahtAavvM8k9hqCWAiAxttRrxrZNaKHL5CcpoFwtU03tPIbIm5I1+VnfZoi0Fw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705094856_1562320379328_0.6656103564912026"},"_hasShrinkwrap":false},"1.6.1-master.20190705104035":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705104035","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705104035","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-yEoAVs3/HKxmiTDl6RnoxSiTkftUb7uyPtTiNEu0UqeYhsuhPIFdjmpHUlop7EuA1moNmOaU+QG2YTA+eEAFjA==","shasum":"1ccb4ece385fe5e174a558d2c2221f8269683e0d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705104035.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHymFCRA9TVsSAnZWagAAItMQAJPSpGZUO+FPEorhw3dZ\nc1paAyWk2F1waaXjn+KgR4rY5M1oSo7T/Xp0VfHpiS3HlsVPA2DYg/I475sQ\nv46C2id8iyH41v0ADG8XU0mTNxmKzPiK7vIigYfqzSuQhYF52dPJCFLWBP/s\njYWcC/h229/wv5j4zf9scQ98qRSzJzngLHZnVCPLPBebpDLEIDzfop7SoFIP\nGejxBZ1ZSi3CzwU7W2c7x/goq0VEeyqwDguWIF0wzzvNyma+fXfT/lXy2trs\nbJj+eq1BkSo5eipN+YQ1r15UOALIy2mO1wa+LsmXDtJcuQhdGKFJo4zZqdOH\nx3CvTJzvs4Ul7WCPo9umkK+ddwAanMbGIXq51K7/17SLqT5G9Slvuzq9fmOB\nkStiay3tJ2SbsomqtKiYLaY40NF1A3hTD7nkYhHHAzRinuMhG9QGt15AjlnC\ngLaur5gWIOyO0QGUiBcs70KCYe+Z7RZPAGTt5YBjIsdeegdg1Z30Ajq1mEL5\n40AUyLfSuhTa1vDMgRHcrlsgxraCFdKnqpXQvUlMK1zPHXe0nERoinhZZhJA\nLhYR1uicVLhKdSF5uHuI54CZidVxQDyvaGJxY+9uBnWQ5H4xZycP1v7kxrUw\nKwQYhsyg3c8jIXfsz51R4UogQCJyLq9mYJ2UOpKsPokCpjf6QGITP8LDS9DC\nhWzC\r\n=XhfE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE4ybH9Cz6tLVcF4bquGC085v1rYmMN2Dy8bIlPvv1xSAiA+uQseVJFkmO+TbR8kvSU318cuIOvxH0Ukwa4VNDoE2w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705104035_1562323332317_0.05094500540556646"},"_hasShrinkwrap":false},"1.6.1-master.20190705104233":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705104233","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705104233","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-CtFTCYmWsAZBdkseWP92MaccPtyiya/8jxYuT6tDGnpSzxtmO5NRlbk2c455f+34oIt0/NNx7rRnO+wymRudfg==","shasum":"3cfb7c4694317475b4626fc3c31cb4b3da913f99","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705104233.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHyoSCRA9TVsSAnZWagAAbY0P/jMC8Q7z/yS8MIY4SH3m\nyS5xItcXexcKkSpUEAQUQXKUzkt/DRFbm13gzARqtUI2oMzeAGvj1Ai8eeDe\nglFAKFrHU4hrOl7AwqoEbqYSfh6rn1h6+frtdkfV4DtL6V7fqrjk1As/P+20\nWY8SmhoBBJVuM+zPKHgQL2r9sutgCExRaaCc8zF6CUYXdc0are7i4WRSrtJr\nvySIS3nmkslUq3Gs3DeyJ5ZbuxwUq8YD64Wiul2TnX/ZFTS1/7rMlUVn4BFZ\nRbd0uI3E2UKz7gA6/vNRyvyDs2cg4gLkVO/xRhW7RCVjri/QoVT/9A49Yz5L\nSCW6OLoXu4Of5beX+FLqMYIj7MFGYmIMmeSbCQgw11R8nWwGxEkRhXOLoYqr\nV2DIwfqe+5s8lBaycD8VKdp2nxQaYFyC5M3noOosZ+hQKVTUFQmb1AFnxsmv\nlAmaKTtZd/Df/judtx2miglv54gg7+Li3mLvz9xVkZ8IxzhmZgq1XwFEyV89\nUG+gtvJ5XV1FWh/Piqr4vpxhGkD9QY5nErDTisU67s1qWFrJiM5yja/vhNPu\neUQu41cx0GfApGAFYs989kIcdmRVigf4BzVMNCX3fQNQVxi6YTvoM1BB8X4A\nqGCqJLd6ib71+Ha3HZAxC4AvrSOPExmPCjErruaOmRUx9PJ360UuVq+qssmi\n9eAp\r\n=ldQ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmdnL0PgN5td0KdkqQ3b2qz94CqzHFoAx6AO6zHQHp2AiAlUpcvJ977/g0T3uNWgqZVBaJVvwVJDrzKu3pDUPR1Ow=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705104233_1562323473241_0.45697231554556783"},"_hasShrinkwrap":false},"1.6.1-master.20190705123604":{"name":"@atomist/automation-client","version":"1.6.1-master.20190705123604","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8fe91ec5f16e2e5db8eda32a8f6433e9226a8f73","_id":"@atomist/automation-client@1.6.1-master.20190705123604","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-aWkC7g5/zaKaVtE+OgPNDUxXiRHpXzuKYPy2BdFFQQKyf2EBibHkSLiqbRwd5lUthV83wvI/HQH/xMdkpeqSUg==","shasum":"20b56402eddc50ac0f13fb1979800ff50ad122f0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190705123604.tgz","fileCount":624,"unpackedSize":2994740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdH0UJCRA9TVsSAnZWagAAtw0P/RCsjhP0R+i6Y8tdgwW5\nD7IFMVPHAGZnww6Ste4Obnjv/Jrgg0AhCXKRrlanbnNx8ymnCMiVZGuUB4BE\neND4ZqLhkldF6QrxSdqQ2gYp3w+SyMUnogHSYE70mSTej8B3ZCytfB3rvwhq\nqcDl/TT5yrATYyHPNSKH/IK9ogb79iXeK0sXgEfMpibNDdJwnYaU0fWgtECJ\nLS3WD7r3OpI6C65n3vMT7tUSiK9u0D7017y3blch5ns3R3ykvmXBzvqB1zSi\nCqZK5INa52qfLzOdiPmP36mZf/w8JF4LFSqmtAfCz6TKe3LJvl2C95IBlbia\naIW5raC5HOPvgmVW4FnRQzhxUnJXq7RnTugEvMkVtbSCAnTq7PXSwngvriws\nJW3F9ynOsp+bI5yHvMIJKO0j8sUFi1IAUttR9qu8c5MeUjP1CNYa8DCqtNRQ\niJk2MFZml92KekgwqQtUMOiLkUoC/tYoM984HAWjL9ORhR4BRpWnBOx+vft2\nKXfoJOIFkwPlPq49woj/4HszkAI0t/iffviIXMXNCAbiN3aCtHXCDsbGpw0A\nkbZ/Xrb2W+hH9v4rrSk3F1XgvT10zw/ZKLkxMZm/TbLeF2pyPOXF+31O7tTf\nhSfGw4Tim+5TkFe4tTuRJbWAo218UQfowPVHPSLZbjtwjXZWCZxDoVVVSvOY\n/ZUo\r\n=jSqv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCdlqnGanKO9htG0NvlLyAiW9CRgwqiQ14ndhEUOgM+wIhAIqzoEcg8N0lhaWoo1AW9xN+GUUN+jZdsbjVV3UPz1tA"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190705123604_1562330377269_0.9622491490993834"},"_hasShrinkwrap":false},"1.6.1-master.20190708205518":{"name":"@atomist/automation-client","version":"1.6.1-master.20190708205518","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.1","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9db27a14c97c4130c58fe3f79135bf9b1f58b63e","_id":"@atomist/automation-client@1.6.1-master.20190708205518","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-hnSno3oVxEJipuzQQH0T4THotkogIavMEDtjReMJofPp7emXeWlAHw/5No6Eli8H2DTxclP2TcR85zHR/Kxbdg==","shasum":"d617c223da834d2723120d681dcbac9d7c7bbe33","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190708205518.tgz","fileCount":624,"unpackedSize":2995109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI66eCRA9TVsSAnZWagAAzaYQAIPFbNJQpVWlDAPLkh6q\ns7XOP3DQkF2JBbgIutseiLY0339D9VSz1P9SkvsJxm9l/aQHBQQkJPm52LOp\nHyLZ48wPRQb0GHBoeAqxJ8Cj5mBV3fOd+qDxP/VP09fxW6usoKjHTl1Ppyi5\n7tjmnRkn7wDFxkWfPXy3rNRubzi1wD6KP8BkEHfMVznaiEXx56o6XYqsNhQl\n1GHiW7HYwE/Lp7eDERsnQSjCEJXVeJug6E3o4vUQvHYuJMh1tRUiP/9D8/b7\nKgYeI9hVLw6AoACU2HENHmgGD5yubboMCpHShOeQVCUe3NFTJXaCZZCJGUdu\nnlOFin/2LrkpYPwMI2DrKUYnZiYefFUSkEyLi8Gmla2JHCK4/Yj1v91c83kX\n30vgowl6FbM+QMCPgQy1RB2L5qRqe/buu6Q/t3saZTbYEVCT8xrTw+V6Q9Kt\n0sJW4GnmpRZoYNBtGVNajW5/N5RdU9JpfoxUUDHYAFYkxBOZQqLfn7BoZ5NL\nNdTzmIUGLcYbsTTE0P8+1WRPBemdqEJsEvMPxYPRqYvVIJnEJOBcDCnMrgsC\nSCaJ7gQ1bYLyxucK4gmzm6oTFDimiwK+drxizt6q/edS+iI3s/nlOZYC6QzN\nKtbDQFWweNI9wQr5Jl+v/OUM+qO+EDb4jfqGynJ5xzas4Lm5xyzLU8GVBBc2\naffD\r\n=R9h3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwGlvL5TZg6sXOTTlm7KuyebqW6uHJ1fzsRj4cc/aLEAiEApCoZuXGSnK7Kz+N5eJ8m/GLDNdKvj98e1LEh89hqEDg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190708205518_1562619549540_0.34552786854160966"},"_hasShrinkwrap":false},"1.6.1-master.20190708211117":{"name":"@atomist/automation-client","version":"1.6.1-master.20190708211117","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"763306d12d4dbea2356479c7d1384ed39b1b8502","_id":"@atomist/automation-client@1.6.1-master.20190708211117","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jA87USUA6od3vVrRxcceEmnCvC2fQkkkK17hOcfjcUun8k8FJm6ToQyrchQPj8zOcHkSDM2IINyAtZjLulyWBA==","shasum":"7177a7f50e670b69de99ba45dc9587f3d55572c6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1-master.20190708211117.tgz","fileCount":624,"unpackedSize":2995109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI7JICRA9TVsSAnZWagAAmwsP/3iO9dAm4558WaDD0bp/\ng71jShwY70tZ/O8wR8tfiWDbJObimQt2+bXUGyt7LLzxYZrqB7BLMRb9bhPC\nBOXFeqbcv2Y+NALxtDP67b/bg3ZQAoHRPTKy8D6KlgV0LkSPbSfsOPRbYqde\nUoyZ2zKVTWRn5as7g4juoZ3LvJcXdiJnxoCa6ZtY1OaqTbuVcRxS0R8szdO5\nB/TIKc9DS2W5XIWauOsCbEkZQv9YMVANF5Cmy5OZ9aoP+Dr9JGJoOrY8ciFp\n9cQ1WJB5pk2/xVU4fk8RsLLXz3eKpehPCbOYC348C7Bj27IWimljrak2S4+a\nOLap7oyleKFhU6XvpVaoQ40E+mVejrPjBCmwAKpL10BGg5d4k7i5eS+0NZCh\nw5VuBP16CgJVJgt7cxpWyEpzNjYcvpzaqcXlnjj7f0KyBS6boVzaOGb5Tnwn\nAzFyIMawBKLo1AbL/GBFrnAswXChgjPhMMTio1R1YTxYAcf8fMpphDxCoxPz\nhjoXyLXQTzfYG7syYyjr3vNqbeSo067HFdTVj5EVDc52uSUIvyLhh7/+jwhy\nMmlmoJBQdGedXl3ltaXbge+/EYYM6LT2d6Qdh1vjveTrJ5fELhXTRplP3W+b\n1clDtzV6Y1cTCyCpIr2ddu/ICy6D+HILf8TQO1LtlxHF/FY7WyC5hOwMRswj\nZab9\r\n=JA7r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELfxpRQqI9jryZQY4d/7gnIMLQDz+sDy5FPWB/H0mbsAiEA1VZxWaXs0Xw04lIoWz7zp5PKTqa5bRmkApxDuBuRE4Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1-master.20190708211117_1562620487890_0.6327970016269224"},"_hasShrinkwrap":false},"1.6.1":{"name":"@atomist/automation-client","version":"1.6.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"6a3568cbdbe4f3a67b1f3481b19f797d39ed0177","_id":"@atomist/automation-client@1.6.1","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-6fdJuh9NHi2sIP+Uyu6GZqSa/vtwZTz84P6ppPGOIVdqs8OsStyb/tHRiK6rguhPsmaQ2NT7LF0VXFI18ocHrg==","shasum":"829c772f23500c219661c9195d1a618de1508dc4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.1.tgz","fileCount":624,"unpackedSize":2995087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI7ijCRA9TVsSAnZWagAAVhcP/RJaF+uDLOChztY9jTRq\nUyzGLerWrdX64d1mrQOA12UNISuQt24jFU4nEihcdJU3k9TTQyGGJB6gQlAx\nwDVWWv2ib+M658oBAMjjKbjaqW2xypskC7J5SobRS0NPQlUkYzZaSsg6exhC\nKWm1eWHPUHh5d4PRGfyQjq7vmySrAWXu6jiGaTWwHltmNriufUtc/oI0YZBi\nlvjqxfFYE8mwHooGyeK1RXPqcaCLPdlhYlssH5Y9Q5efgpQGPb7DelXMx8w0\nr+j6Cz2+HEKAgcEhWawlHTOhujF6i4C6FPitBT1dyjCglghzctZlExwK2ZIP\n44YUXfq3rOBppOfGw2S7OfJ22JqAwZKp2j+ekEn07Vi8S9EvmMJ3rSVnvoxn\n4iHAs0p90ODfu+dCl6ykWHPQvZw8AGUxeSONiciVoCmyA8VWPBzGSoAjI1JN\nPydpYJ4yqHCWKTO6SMdG62GfnciQMj8yOKaL0YKqpuNkLnixPO7bRkAfQ+Zz\neVf5RWtZMcuBtJNLCstDg//RM8p/up7Fgm7J1bTYndAyru9zDgv4jjA22ao9\nGGOng012S7ZMk7PXnuZHegIz6av9Hf13zjloEAS0q2w4IjKYIRj0cgdDPfsv\n/Hsj18TckkzsyABBkX/oaKZp9Kytxq7Fxq3MlnbiHWKBQmT11z+njAP1QLlD\nS3tw\r\n=mF76\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBWTyDYH/OOnO4m2qxeJVT38PUvsN39OL9iSXS/PmgeAIhAJEou+UfOChykzxLoXK1jSfbgx5m8iTGPrOhIu88x07m"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.1_1562622114703_0.8808094236353363"},"_hasShrinkwrap":false},"1.6.2-master.20190710075516":{"name":"@atomist/automation-client","version":"1.6.2-master.20190710075516","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js{,.map}}\" \"{lib,test}/**/*.{d.ts,js{,.map}}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"10460cf2f56671bbc0d6ec96b63dc598aaea8909","_id":"@atomist/automation-client@1.6.2-master.20190710075516","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-bACxnbomeKKuFnKuMyxwUu+wIDGcaJLLmZmNJYVMFM3mvE564kv2zby/JQ7rUKeoCa1hm9K4tEIBSYw43F8F1Q==","shasum":"326a09280dc2d8e10b29915dbf36dec67615a5ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.2-master.20190710075516.tgz","fileCount":624,"unpackedSize":2996998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJZsHCRA9TVsSAnZWagAANLUP/AkO++xqm3DafWlaqavc\nM1mI4Zwckl1DRJH+41H2ltrR3RWe8Lp/nzm7asLYzq8hfTuuvBunlPb8YGok\ndBzgVwzGLdgasRqqR1g7p7OXSu1v3+vNQELre8mdAv/10HXKBjCOn/rP6iE3\nm/hKotVtppQPOxMvR//5z0prEZ1VBAXO95j90nMUptxQh0Zz3/oSUXAqgkrU\nF4G0cifD6O7rEZaX7MCYCcs2yiepGQo5ETmbSg15UPR/8sgK3/83j0u9WBQn\nLmYCJlJPzIJADeG0r1Fs0/MkY/QJA/G+lloBR5JRuCSrMiE+JuJTSgTxGb38\ng+0yFEVeSbEKIRl0bkAf7m7diqHry1vC7bLVSNOVnQxZs8pzafDMYlYge984\nxsHPMGVBGIv6jeSB4Js3Hc3Pih7WOXPEbQdNH18W5Ejj/DyxQTbJ26GORYh4\nAhVxMjlyH9zLVQOR63UCwotB9+t4IDWmxstqV/eEiL7lLJXoujTiqLTk3TQt\npzVZFMVmkBJTMo44maENjYWqPc9PcAkiXdvK3en0BiInijqPFl8ERMH3QIoZ\nGKBR1itSVIqyR8pR/5hdKrJrN0vZnzFk7/JA8kv4T4d19/KnWNlu6ITVV/be\nlK0tJOS/YsJIDKuW+gfaPLoL+ahtjJJ4RHf7cF8avqNHAaQYHtj3UQ4UNtAt\nu+W1\r\n=zPlx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBFa5bNy8FQfR7cf0hBEkL5YTmz8rLJSC3RadjgB/Y2AiEA3m8/J01hYjfqrrR/J6ok+L3Xykviw8Z6a4CVtoBH0Ik="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.2-master.20190710075516_1562745606656_0.1490161837709807"},"_hasShrinkwrap":false},"1.6.2-master.20190710200038":{"name":"@atomist/automation-client","version":"1.6.2-master.20190710200038","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.11","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"04f58bb933d3ac229391e85246be9e35431ed304","_id":"@atomist/automation-client@1.6.2-master.20190710200038","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-dF7K5XQr5Dp3suMhYS3VKTrpoLYYyH+N7sLVABb/y/csi0n36zFX1ZGItb0iTVVzQi9Q5OMooYM6IS/si4PnKA==","shasum":"368f5ab3e1d54b33694455e555d94beb50979ab9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.2-master.20190710200038.tgz","fileCount":828,"unpackedSize":3173269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJkTjCRA9TVsSAnZWagAAi2IP/R84A44o4zSSiRf0acmh\nhkG5/Xad1VevMCxBhZQNBk8KtlKIEOlEPJSWkHYdyozMrKClUnV/GjH0Wt7p\nC54Nb8TQP71oRPyaIDhmkIWz88bbdepTiOS9ZUFKwt95NyofOjQv+xChNIl+\nliMMVQ0zvI0GfnoJCgltMVY+jHAFeu+4wyRb2PYJEZU4RfsrRqz3kt00Gptu\nl4eADQZmOlnDU9u2ULucB9aVd26mXRmWP7F8lE3+FhHIp3PY+KFjUKh4e0gr\nYQ1nNYeMwlTpFuYETE5K5xFE+fTQDvbiR4AxE7RSp2ZzybEe+Ukasl39fMlM\nus8zR3UVyUut8uMC1M/fpCD3lfMBhH/a+Q8yMJ4+0S/sowpi1Uhet7YmjNZV\nvDt8E0jj06XG1snXl5HaGiYLQAWLYo7ybDGj6MXT+77ofVKdNQzFvUMq8oK6\npOLyXylvzQ6qeJLlyFFDCb/nyBVvr+DGLBBrjx/yIzypoUpCWmBFikdwDltj\n0onHlVH/ZwJ72LUG/wjD25+7j3vyCCBxxtlZ4qCab3X3tWEUu4/THZiRlz39\nMFe4xXCNWOYLt/Y1Cjm84VfY4SzASRcPUzI/4UV80cwm7HKnzWm3R9Q4PBeh\nBuJ3Zu3rGUQcJUiXd9dmK3YHcu8lISGHejT2N31al1bj0k8A/GjvnC/+6kfT\n5j8e\r\n=JM6E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHPZYzK2EN83PvdF/SfA9JL4Q1O+4/8gj+H+CQ2oPa9+AiEA+3lR421+KdtmhHeSrZfZxzslv6HgsOvkb8LJsAULLts="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.2-master.20190710200038_1562789089927_0.5052903006433691"},"_hasShrinkwrap":false},"1.6.2-master.20190711065219":{"name":"@atomist/automation-client","version":"1.6.2-master.20190711065219","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"edf3b0f8b01ee29347068d35b69060ff8bd3a9ad","_id":"@atomist/automation-client@1.6.2-master.20190711065219","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-yLmNmj1sbsXEIfBgFOWa5jrqW6Xtzs0FKw9K0TjjS0DseJabZPyAx+I4F7mGH3emdsqHDxwbVvGljCmTdPffow==","shasum":"fdd18f2a68f0934821f8031c5e0a0e0eb0dc6182","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.2-master.20190711065219.tgz","fileCount":828,"unpackedSize":3173440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJt21CRA9TVsSAnZWagAAXoMP/1g05ozOmuZtJvEXrbf8\no5vZpjI8l3o0m52qF+an/OURsdHDe5pZUXFo/KTp1TJOfW0iegOUlBQKimKf\nPheMcy+hctbOR4CSTGvJ2PBkUylnmoZBB7z3+MWDehwvCJ5U1smqhHBeatMB\nK9O16bOG0cFE3dP2j8E35OnaIpoLzet+0A4rqzr6YmNmhBsHf7083iCTm91U\n78hh8biocmZZUWsYAd6OlsIFa6bShFMusgPQEGuF8f2YwYhRGjGd7KnK3Lss\nIa5lWYrMegKKyyGnb0pxKv5oGQKfaHuPtE9s8G1x80hQQ0iSimZ3rY6TKxNp\nDQnMivEaK+YH68Dpf4DRxr5RtUPEPOu4PPj7uV7rMAdUhf211cObvk2mgiym\nnpADCcrneotxxpSzX+mtiElqNHbYexbc96qM0ZNL/qbO0A67/2w1i+TR9oY2\nsdQpT4a0CQ+UAd8IFe32H86aejf5Lrz5TcLNysOv8wJz2oa6X1gQ13c3UXjO\nY2wJoAD44Lz0cqXrvqUnpn2dWKnUND2PnC2un+krADjRe3omLvidsXrLFOIl\n9t92NEKcMQVK5yZhDU+zy6ufgLgJaTv6VYP/VYxigV6ksCeaVR9HF4FAqWns\nhpDYFHlixhxrIk1g4hv4nNdDfBpSwtMN/+gGOd02QiBTeE90EXPnj6JQxdIl\nQp2p\r\n=40gj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICy6mJVCCFiDh2Nbgz7gxdA90ai8QuJKVfjbNb0r9BFHAiAPu/WRFhTTK1FDnDBej509bSW0V2o0DPNkQv73DwjFjg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.2-master.20190711065219_1562828212420_0.9780279481153407"},"_hasShrinkwrap":false},"1.6.2-master.20190711065453":{"name":"@atomist/automation-client","version":"1.6.2-master.20190711065453","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"edf3b0f8b01ee29347068d35b69060ff8bd3a9ad","_id":"@atomist/automation-client@1.6.2-master.20190711065453","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-LIklCGA9sRSxhfKUGR2g4wtoG8pb4LMgIMRjf5oyywUHQDWnitq79rw94CEuVewliKeAN7mQ/BI+TfnAHJaJNg==","shasum":"5b9cfc7f28e66b2b94627625bb495d5c77654615","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.2-master.20190711065453.tgz","fileCount":828,"unpackedSize":3173440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJt4WCRA9TVsSAnZWagAAo/EQAKT2CPzeNCCc5VgploYE\nScbp6ivl9nEtK6hgLLyM0K9+LhgrtzQRK24xDVdTSFqtC1eC5LxQYzNwt83c\n99yFgK67nwK9xPkhWWsR1p5IHpAHd3jJj1zBj8dMNMqw169JYOq8jonzyDsG\nJc2UlSyEUuuAXtnP0HXB7RXTclKhPf3sXIwoJqbx+UM2VHqZj09LQQNP5HDP\ntJU8JEQi5oBRiioEsy2BmBn7SnBaA+K8nNSfG85gUs5E53yQtDyfZGh6R9JQ\nSRRMX52R1RY2uUDIhgU3fVo2Ynh1pxmZsj/i9epAejloU6FGlT3Mz6YPcQb/\nBk3qCkAu2hAiNuBRxhnstV/JavMgg1z065+/70eINbQCJoF6mjOypAB8QMjE\nbWWGh2+9Kp0V0rn6BSALpC58NuE/T+ucpTDooyFgOQt0SUbvrRcF/JydcwBF\ngaRVFOLMM/SUq2TTQF4LFgjkJW5+q2ZKH+IhTAHXnlc7mDqokvJWiRTMHU8c\nRgaZ9fr2j1+sKM4CCrLFe4afEYqXHDaJAs/dEpvQEdnuq9+Hp4CnticeAdBP\n4HVariQzNrPN33Uwv7AKND76f7yX8p3hJaqLMDxiZVfdGQAx/Gjby9dpermb\niOTobCinIPEBdAltCnHKwKhBiBE7CNTx/PnJsEnvt3Qru7mLNgRL+PWrWy79\njaAV\r\n=40zh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDYmLpy/Kfi/BwLf+HQOFo0iyK4egSHaRL/Hu2Pj79WAiEAm8f4C1cP1XuRQ4EjwgV4LvfNObb/bqAiqhMAp9YyNL4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.2-master.20190711065453_1562828309934_0.6386916496606876"},"_hasShrinkwrap":false},"1.6.2":{"name":"@atomist/automation-client","version":"1.6.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"cc882c03189228c73bce62555107a233df13d193","_id":"@atomist/automation-client@1.6.2","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-1WtbTLXEG62dNK11j5BRfQuHEfxchsBmfXTMq7yYUin1YrXDifkXBvSZE25hd6YyvnXdPWBrTQPnk9+mOwuvlQ==","shasum":"80987a8020d989850bf540e460c7f90213b76bdb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.2.tgz","fileCount":828,"unpackedSize":3173418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJuSjCRA9TVsSAnZWagAA97YP/104SggLuCnsYZogBOfP\ngHIgc3Zg5cFtsFIR4vfW0KHefi08wADvjem13BW2L9sLKt7Kcm/1mN2leLNd\ndi6zTOgS+VDV9pk3VezazxnORSrqJ8ezJUCh3Q5a3kNAJeY+UUqscQ3SUVzV\nRAFpUapDqBA/IBZ1q3Nka9B67RDCH9E0vJpbDvl9rb23OREx6C8XtR+9TiGi\nlK0bQu58PJfHQjawFtiJYHnH7ajQdGfl7AYPOmI9HdFiKPUN13bS9/l0sAxO\n2VZcxVdy+kvCpoAnJ4WhKqIqlzdcwKIG7bsEGkyWdbPZRANrrjsEy/01yW4F\nmroW8J+pnbTQ+09S2AA/yWjs/tgDC31/cZv5I6wVqEq7ADLlVa6dZsRVgd9b\nifMkkGaVSrklr2xi9BeRCJBKMOY4vkGYgtgx8PyIpfMgIW4mpcwGHRZJwSAj\neoj8OejldhrObxvk7MHzR3uNcQj5YeDdHZ+QH+rKQ0J4LILyAv6dGJC3/JBj\nS3i3vbmPNE6hs8PFC9g5FwaLPU7XxNBJWmtnCzZlsNWO7qzCQ0GS81/w5l6E\n7CEZpKcKuNTEpm8r7gjGX21M13xPCdj7uMIrrwrLsESmkU3BUTWCr76ll94O\nqsax0TjZIG5V8Lr5BoXhoEOEPH3Ln+iO9LTmKO7L7iveSD0Lnhp7HbqSqC4K\n4jFI\r\n=TH0D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICigss0xh4Wr4//3wHfII8hjoiLktyMaZJ62P8qEA2dWAiEAvT91r0XbpA8iHT9nR5lR/83FW0Jgg8oU4n3rp2k70Lo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.2_1562829986654_0.8738482611667029"},"_hasShrinkwrap":false},"1.6.3-nortissej.no-single-branch.20190722232139":{"name":"@atomist/automation-client","version":"1.6.3-nortissej.no-single-branch.20190722232139","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5e3c22d221843a5948abc824f3e4b211cccfeaf7","_id":"@atomist/automation-client@1.6.3-nortissej.no-single-branch.20190722232139","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Qt9hdRWAQxExiPSku69ctuLLS3FFhSgRGV1Ni3C6CgECJAS2k5G4Vw9MFhUy6oVHzvwAXhb5wTVABT6bZSV8FA==","shasum":"852ad7a6ba23a50b98899a1a63f3a0004108634d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-nortissej.no-single-branch.20190722232139.tgz","fileCount":828,"unpackedSize":3174328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNkYTCRA9TVsSAnZWagAAnyoP/1KIskpLTOEwWKM1jjmy\n87zOM0gFnXGxFXzyt1Hdy9ekrZz4xu+bDt03xkJ5h05LHKPM/hSMpgQz74V5\nnnxFhP7DVdV+uacaFVl3TVa6KHuplBLhtyQ8GUQ7nnPmsjBhe2YevtWzFJ5l\nFQqDiA/nA+ifiQ/q/SBOZdMWIxu3yahh37hF/p2IN1ZY58TN9isJlIQIm9k4\nS/qwn5fMkWYgqEUFZpDTwuMOAwc5QW4SbKnvqvQJfGi6Pq6Zf0U1meTOCQF9\nrsi9YNEwfqvPt5AJvwWu9dVqChQAoe5ez4DVEMznc6GG7+xvmL6zqSf1ImBG\npXV7wbar0HX0zpgAt2L5z6UO1I1thEjJEVJWRrHF27jAmwfTKPbg7zNjn3q/\nvS8w4sFwvvBeQ1XFJUWr9RtHFbSH/4OdyCblyQ67YZbraR6xIVTzjqcsHUE2\nU8R8qO7KyS8AlySDXdwdIItbTUcFsOcrTTMDouq5AW9LzKx7fGF/TLoWTF3S\n5RoMiPKhRXoONC5DoklOC7RWkE4xr7E2rlshVd+CIAwfGrRdIQ/pAcv1CtgL\nzdadx/hx2KAGmk6df905X8Rqv9grNL3OyuAaTDKSFcZQsqbfkGjv9aVqhIhB\n3BfmQCq6YajQ2fTTRUKUHZAcJ/nL5pzzzj4QArB8JOsyH5FvcwQ+fNDMb28b\nURfz\r\n=gQpc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIE+yyAzvwhYqaapyRc9QvPZFc/ESH62WABztpu9VoyAiEA42IRtWIdOsFoBnzBeuUL5JQEnWPxLb+kvW9sJbooOQQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-nortissej.no-single-branch.20190722232139_1563837970581_0.8839430593214566"},"_hasShrinkwrap":false},"1.6.3-master.20190723055410":{"name":"@atomist/automation-client","version":"1.6.3-master.20190723055410","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3c1e74a8fabc6dca39c6885eea6e809a3515ebd5","_id":"@atomist/automation-client@1.6.3-master.20190723055410","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-m+wEEmngsZa8pyQacmilaP54X/+WtASWrJ3TIa3EfTzG+0NrhVbhWsLa1/pY7DdpCiTlMctHdNOA7SoZ6Tj+8A==","shasum":"50cbb67bccfd0ade24e362a5fbd67e9acf410d07","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190723055410.tgz","fileCount":828,"unpackedSize":3174440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNqI9CRA9TVsSAnZWagAAqAIP/jLK7L0K/z4RxCRCFK5q\nEmpQ94tfVqo24MUDkUzK3ccKhI8hJ7tg8mFMRT/qu6Hca4cP8dBQte59oZOI\nKF/BuWFVPo12wUBp/kZfDe+zOnUAgsNY1AGQkLVYrNk+w9KG274CCoMHnyt8\nBhO4SUVtNw0idjljmTfEJmA8UHIsQ5NXjFU0Y/uqc8v+6fKA42bi5eaUt8U8\nahNeJaK0QqWaKZDC7VhrFilat0LXjcCy+GsZcY0q2hYMX+2wr+p9hN4WQ+6a\nG4UB8pR7/EhrIzVgKXSuU/GwQWlfe1lPRhkEUiVmiw0S7BQwpYXON0qt0R4N\nZGLTvuqN/JAGjgNDyl/kqJSdTSx0+LapsTjH79AqCDuUGrvb7+slEXUCfjAi\n+ErvKmHnzf4Z9Guswxpzul1vUJ4ZMbSDxyo0TgA31WdybVeRAgsQFrUx1glb\nW39gSUcNFGTPVS5mNU7nAysNd60fECLMYObp+fNNjpvJwnD+qJ22a+APHo46\n2hLbbeMwaLEFw/NJRKyfSyo4BDY5dKsuflSCIdVJlHoWUI67HKtaP79ldv23\nU8fm8qHALZRdn9hFVoe/SA8Ne7OqsmNVudoSs2dY/68tLkx0GLtdBicF9p5U\nvRv2vGNS4KNcE7hrK1LcaHlGer7khbeC3BIuh0zXOC/EyfJ9vIAGOCfu2zaQ\nHSzJ\r\n=5GWm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8G0LSA6DGD/KFy2CX/GzsejyWPsuvEJOb8m2D7lCgFQIgcQPRi51936H9xNa+PLX74O06JtPFGL1j7qBey6ry+gc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190723055410_1563861564183_0.7750052233221547"},"_hasShrinkwrap":false},"1.6.3-issue-575.20190727070921":{"name":"@atomist/automation-client","version":"1.6.3-issue-575.20190727070921","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5bc0d03e1e9f95ef6b905ecc76e518b24cf48d36","_id":"@atomist/automation-client@1.6.3-issue-575.20190727070921","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lUZKIrlqFgdct0w9AQvjWDn7QCZwmPDLe/9EQ3SaKYkfD4AoxJcxhF6p0Q/bONY25pRoRFuKxB6dI68/9Fu4aw==","shasum":"961c018a718a192f93e97fc799bdd61570b6b0cc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-issue-575.20190727070921.tgz","fileCount":828,"unpackedSize":3173735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdO/mXCRA9TVsSAnZWagAAW7cP/jF5zDbUWWbf8SFP6TQ4\nb15fhK1qDqff5QaWgxDbaPrbdClrwp9fScVh2Sdh/QG5rloDF8n8+VCKItL2\nXGOdyl0Ei9LoknUt2y8yHswXjUcyxNsINDhE0n5cmFQe9lYQ4fW60n36UvIG\n5Csomfk2zpVPagkgVSNxGK6OhqYM2CzjM15rXe37flpNdBafxk4uKYiDYxRh\nmyeaWwiDfF5OjtTEah2S6I/d7hGrUU6MPTg1BRM0JNqSJFCsd10m8FvUKczK\n+MQ0IyLI+ZCAe8JXp03tU1L39Z9p7kMrAW1/K+B5kdTp5NIAYYkmhSVmOoBn\n/hYp2+3ho8ZgibDjpqUdVBovZRBQWSEk19zY97LUrZrrtBiXUmUbpd/1F39M\nweANC5VrRGJYtGgOLy+hMpxQ01iAAxq9T92Jja7h+vXrCJ0zjgsP8FrcWu2k\nNESfWUYZcK4wmvUbL7KovpPU0CUq3tgXApI858OdMTdtOAR5UIGT9Mjh1d9C\nPK4iHj3qkpyeeeZgzztHeejD7jLKBgqW/LWVW1HS5M9o8lN6Fjj9DC8Tut8N\nTE9xa67DnqEAoyA9gPTRRvlaG0+6LusvuLBeHsmZ0KyKPclpsBAui0JI6hvx\naVVfFOduGLtjxsyprGPzL97MgxR1Z0TS1jTr39LAAqkV82ez2E7tHXSjeu7G\niZdE\r\n=PLjg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQxXw1r7gDlfBuwNiBPRFaWP5y4kC2iFRzoKwrM1jFDgIgGXAMoY3BoP+/21A0dWY3e3+pHNSCFZ2dJ56yOVq0wW4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-issue-575.20190727070921_1564211606648_0.16695112349781782"},"_hasShrinkwrap":false},"1.6.3-master.20190727084117":{"name":"@atomist/automation-client","version":"1.6.3-master.20190727084117","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"04d76ceda343228a1e8406743edf17c14df25e1e","_id":"@atomist/automation-client@1.6.3-master.20190727084117","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-OtLOSj1cDoy8f0P9ZUbgxV/xylnZA/bnCVbPeo52dYeIPuf6pAnCvcMGMgJCOaFn5jLhT/A6POCdiLZ7DOOo4g==","shasum":"7a8d18c8cd3352ecea0bb5f0b9c3f240aa9e446d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190727084117.tgz","fileCount":828,"unpackedSize":3174807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPA8XCRA9TVsSAnZWagAAbbgQAJyRHSHrw3+eTryGxlKQ\n7tmrUyrdv7c5lVkJrUCP95dGy/5ylW08ZfLLVm2suFBdOVdwA5TkMrc5qDMP\nzjPxaZuqCgORMO9MQnu/Y4UVTbhet+XHjspnHaSxaKrKilpAKYQRuOBbgFV4\nMAo7PUEdEnRtzNCW2uRXtExgy4hyVNZ3ptuoFUw0qjZKQjCU/bU8HUcFp/Fl\nfYS+NuDgYAVOQ3asA09mFB40DxiLs1HdBD4eZSeiGAQUcvR7uJ+WUXb5qJGH\nYYffA71eyw/MlYcAKNnrAE/v7tK3WrCgAkCH7C0Ocuclq2dQhDyEYwwlBp+R\nSAKKUAwYxKfahHSwJS+HIg7wggNdsCGcqEwnOxQSMF7amUnAVbaXnctgfcbF\nXLF9QH/GfMAmRNfd5pjOwi83N8RlNmc9W2SjMaLZaIYf00Pt9N6JYOls16+w\najduakArDE0gL9KGzzpGHdSISqARyh2+0dPfeVDKCO6TdBGkNoTC3jOBoFMt\njoLUxWCGaKMs6KBPBJ2SOpKZDDzH/i1jqdWDx+vHLNkuMqooVuSbo90rKbfy\n7OdntE2hfIYXWbGPvXKnnyZn68YrBkvcc639o7eRCVy1WoI8N08qeD11EICv\nt+9kHPmP7z2QuuW7YiLZuUSWe4MeTxtfhMVxFemjpp/TnRbc5PjXJPriBrux\nLq8o\r\n=qfWW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPa2jtAKTV0ATKwTyHQgXR+rd2u890yUWbgkxd9WvGJwIgScDHcwi9D5RN1vIitb8cmeW+3BHVwhDL9NXiCUJc2uQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190727084117_1564217110947_0.5197380391080042"},"_hasShrinkwrap":false},"1.6.3-master.20190801153513":{"name":"@atomist/automation-client","version":"1.6.3-master.20190801153513","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8b0f204c8a8396a1a86e0731c483cd6802a1b17e","_id":"@atomist/automation-client@1.6.3-master.20190801153513","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-s8EVjLB2CNq8kTQOzz9LGyjj50NRJp+Fn1vZ1Fx1M5W/K1PtF/ckqXFAE7j0Cgy4q4uDxsSDtLMhBHKobRrtLg==","shasum":"e4309859ab5d26ae11797f59f230b9fba794cafa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190801153513.tgz","fileCount":828,"unpackedSize":3175239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQwf/CRA9TVsSAnZWagAA87AQAJAmlOmvnp79M6YRkh8g\n07JGLU5q+CYfe2m3NVne1gyICg5lOhMcECkXOhJh4g+SNtV6JwTNStgndqAZ\n3K1Ox1WkdLYSzLTEtLpWq1pjYW8Zexq/HnzrFZ3YOw/IdSqC6GKRP1jEFGTV\n9GJvhaxSoao0oF5ZjZZAwvT3HGTirSRbc3bq/prf0TBCQvhj0CBzauhh/ECd\nwQr+hjrnIqirTzNcbEQI3N/BqAOWvoTE8RmdrJy/Hzxmc9eK7b/lyDrYj7ff\nSjs74Qh6RQBoPMuvIy+v+Upridhubt78Y9WAdahcb5LzfgdzE18xW6+OYJNn\nD3qA83/jRAD+7i+0hC9F7TVUD1GrAzV2A4soNOZmjvVxXJ5S0biIrWWU2yub\ncGI1rcTRSRlV8NLNV5Knrwn69m84PQTXy4nMjJjninQE2xVDPbjORTkfrB+e\nEmFiMqgRUUNCVFinwrYapebYFTwOS7E178+C0P7l+zPC9WY/GgGhw/qiQtok\nYKRdeWejMsNQ/8F4nHggv1KryUgrgV17go7gsYB+5vTStwbKMcut4e5lxrua\nIRzd61oDQ4SSDUB8W8/suZaIVstbKMuLwCBdOrl6D3rVLzXFOmbMCMuNDziE\nIze2xHHzPxFJNMXttP6IJYKxZiJsTfupoyVCggxXp6vYQTXISIvq0BV3Duob\n9X2K\r\n=xB9u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5D/I13sbGTLEPMLxYPVW5rZTq6ANxgM1mOUKF0GVnvAiEAs0ZIwxtQngb+hNiE3TneVoloTKt+goXItgo2YEOptVs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190801153513_1564674047078_0.10538802814680603"},"_hasShrinkwrap":false},"1.6.3-master.20190801161527":{"name":"@atomist/automation-client","version":"1.6.3-master.20190801161527","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"820645594a81bdc9ece0c342823b99198e4fc86e","_id":"@atomist/automation-client@1.6.3-master.20190801161527","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-1HyBjRSJBD65j5cseL03CJvfNHonAYAYtPk7TVSftmm8rFYUXY5yrrlOVoj/bCY81a+upYQ0YOBPaoc2vzrx7Q==","shasum":"470144080f2fe6b6b7edee20d431c613fd07bd15","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190801161527.tgz","fileCount":828,"unpackedSize":3176644,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQxFiCRA9TVsSAnZWagAAkKUP/3Na8PjJs1kuBU5XLmB/\nmItiLgOdWtlTENo5bMZ0jOezNGsLxHY7CDJQxq1bSrXxIGK5SqK9X50mU9G+\nuFu+o/lOtmYUAD9YyfdUCxZ1FGKf9ocPGCH8RijjfXQGXx2wkH5d46l/Uk3z\nGBN1llBEmVaVrNHED72P8pv2BAqqARWxonvo3l0cOU5OM7WiORSJfFPPoORl\nkdUy/pIDbtEeIkHVKV+8HLO+5HlJsiKpNUB7JdORsBhg7G78ZDbLEcQgK3XB\n6Ybz+hL/0Kh8i4zV4BtsGD5a4XXS4XzeTPDUHfKJDUvIu4jJnihsOptIZ+jH\nvuB4P0rQsc6G3ZesXmKLLyL0p7Ied9ZjbWOVIr0zmBI6m1S6w7k23btJJj1E\nHAn+atCGd2aiKX6vrKgmf9hh0nLp9N2gL5Yv8w3j/hd9WbV7ws1cqTkhg1rs\n5skgH1RkKSX0YQbVpWiR2WeiIfHVieuutOPRLp7uzTEmoNiFT05uwjzILg6d\nwlqHUXVpoPge93uBVYn+XtOwYwn5pTclMSDvmq9jurSsK1NkORbmcqoQ+dvQ\n6+Uq3oHOe1eSm2B3c98XXRK06zqsBa5oblNUANY1hQqI26b0LxnGF/CG/qUV\nG3R+1wo7ltQSPLCMf2/MpCy2umE2IyUaF/PNn6VPVGeAsoIrebAcit7L4C/r\n/0NH\r\n=UNfe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwncU6lJhtrlJx6rUQ6vbh63nQumr/EhUhw3Ial5p0uwIgYZdUg2LZop3npSVzeQNEQBeGC1xe0940ey7rs+1c71g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190801161527_1564676449778_0.3261174144112229"},"_hasShrinkwrap":false},"1.6.3-master.20190801175921":{"name":"@atomist/automation-client","version":"1.6.3-master.20190801175921","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a5b7c2bbbad55f9dd81c1bc3af89e848a31693e1","_id":"@atomist/automation-client@1.6.3-master.20190801175921","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-5sRzJxI7xu+E90GYpRd40/T4iCDo00Icd0/9AqlG5EOPRiAtD8aFXtJyUm8iqFHEV5CSJn/+Dj0hKnDygFSF7g==","shasum":"e13ac0cd2fde1b9798c9c488469a82f50dede937","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190801175921.tgz","fileCount":828,"unpackedSize":3176759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQymyCRA9TVsSAnZWagAAensQAJzyI/TC7HIu4VVzFmgS\ntv9e87Ix32mVRV/J9zqsIDUWMMVXmxuQ+7CMLInrYR2no81J+aUAwD7WqVdD\nF7WXBjQGX4mEGfa0wLNdqiyQSFqgoAIqmfMAM4+chXxO230KuHOHdxiDJSQZ\nd+TzXmNGrC99rTjpzchhEjDLacjIJthki2cEX6b7O8XzSjTUgK3vuSQeVbpr\nWwAJuzZLxyw466OYq/7cWfP82uVPnXppSzJp1pQcKN9vDNeitBewDKyu+S3I\nkX3gbLIo1BWbMGFZXIk/TeNTQgyQnV5cgqAwmTAA2KJngiQnsTyxR19TB8Kw\nXW98Dn5pD604iyF0ipEBQxp2YqFMI2q3pjhFr/E2RQjhwlVN2OUQHmMlFOnY\nBC+vneRp6bxb71n7tLaPDje0ZtPx1ijjgMuW5BmNwNlONm9OmOSZiX+1BkGa\nLCnn+wihnDdzBO9FuOO1ZstYJbitSvrqWD2StTgAejz8zvYCg8+ReJYknyX4\nKx1MTiZ/0/sYieFdssdG9K06N9Z0cfj1WkO/iD1TmtbdloemE2jtBaC0ygxI\ndZY7xf+nNcHECEfBGuCT1B03G//qX6MY/CXIVePiwWR26TMJMy+5PPbIKq63\n7qtcnMf2Ld8Am1YYLgELnKipLnCAVcKcFaTOEPhLhubLKT1ENpQppFm6VQjn\njp9A\r\n=V7nr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqaVnda9j7UISRQfl5kr0UgRgt13qMgo5teXWIsR+EAQIga818xFFQwZ/y6NWsM2g2jsjXy2Ho/PZAW19AaJqyruY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190801175921_1564682673034_0.803573514387375"},"_hasShrinkwrap":false},"1.6.3-master.20190801194922":{"name":"@atomist/automation-client","version":"1.6.3-master.20190801194922","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"158c4b75dc236b58fde63c2ebb463613d701a0ec","_id":"@atomist/automation-client@1.6.3-master.20190801194922","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lKUiommuwraPv0G2XPRD+8Vlx5v4jxmTjq0el2Ses6juXyuCnCKpZ5c8d7d/v8MXFnm3N7Z4nk9tbVA1LflLmQ==","shasum":"866baee3465243f03987d9e7ca9b11a92e26109b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190801194922.tgz","fileCount":828,"unpackedSize":3176854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQ0NwCRA9TVsSAnZWagAA+dQP/jpEVpT66XoLHB7ebqco\nYgmDTHlcTLHVYOhmTCU/QiMrp8e782eI5G34iH6H0MdcsMTSURDYxDVOUaje\n0IgdTjnK4EQDHGBD6H6RVuOEPKgaA5RUr1tHC7crWBTfeLuWNEaodQegm/0x\ngho1v+cng9NmTdaBq9J4o2vDA7R8vG0w6MoxRffQvRoyIqWc0tRHHCQNa3Oj\neD46umNuIDtWvp14Cuut+7BizbWfhtNrDTG8Dik6Bd9u4B1O0N6WHE235WhD\n+yOdPwZrNsQacSIDQbCTo2L6tpYjvq/0b6Zjej3PkTW/munIjeIWc5AoiRmw\nX5Vn5TuwPTD5ll5y2Xmk8sOOR3w4+73/q4OFFFSNEvCkSgNcjZrq6+RveGUU\nPcRN3dliCkejYGuYy6J+uuwO7YxHb9iV6Li4Zm2IWMmMHBCag7snQ+zJXZL7\n69+0ri/aHYny4S9v6lsebXuoEJD125T67bIaQ2/2Wn1Nzcw6zH1DO3ZLzo1X\n6Kse8yifX4/wReIVHZMhvyH+lpeYB7HRwRNqDWV9h3O27ND3JEsAdde08x1z\nENrpa+malo2tvNIFRVP2lZT6ia1ee+64AOWM1GRa7998oBJkadFw5G9bIk+A\noEUxzBVcAzGgTv3tQMXnEocDVpxgAhrlBVdQaoHElWOYXSo0u24jOOg4HTVQ\nE5Qu\r\n=MtI6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhX8SMBiiYx5i/ijRu+HF1KJShFtcDisCQBcTXzXYKDwIhALT1XUm7NaUWitGEByh+BiscbP7aQodnJqD0oy0AHHRz"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190801194922_1564689263307_0.8805360631974362"},"_hasShrinkwrap":false},"1.6.3-master.20190801201049":{"name":"@atomist/automation-client","version":"1.6.3-master.20190801201049","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c0728ef8da16c3858e8dbb9575920e0f61ab3679","_id":"@atomist/automation-client@1.6.3-master.20190801201049","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-bya5ID7JF4Zt/4sWPlgNofcVKZFZAW7dQPQyzVO8QLHLVHHIyXY+J4EbDjICRGR+Y8CBjJJKragveXRWJpxKog==","shasum":"72eeec73405dbe6135315dec05349ff29b02cd53","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190801201049.tgz","fileCount":828,"unpackedSize":3176857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQ0h4CRA9TVsSAnZWagAAC5QP/22e9jZKPX+74kPgZQGZ\nOD2TTMBygodKZDCnbUk1mvq8z+S8GUYZ7542aWFN2fyqgvTF9ZzGmrvcHjAw\nH51MK1MpR59QXcNE888lZ21tkZx2zV8ppIwm307/6ctAf12b+PJOWEzNiuZE\njc4fJB1qTSrdABHawqECmyvGk3gf8azoF6+KWFEamop/zaySppjYbOGaDjnL\nmuY+c+vZfcBwtWLG7TOC7vCpv5myKM4zgyZLmuNVaJDXL2IZANES3Y9ys43X\nMmlxISE2pU5RsVKFo+G26lScXaoMj6CAN5bu7sbD0AJFq8J3zTuroSjhxoFd\n53a+LOraF2Nfd9kbSqfMVLF1IUcjbNWpwI2tT7mp94NfioI7AeeG9BM5MEuM\n79EL6FkmZ0CMnSLqMflbPJ3QrVgVb9KlyBMQLMuSlDsepxQB0+th11fG2hZW\nD2yQan/pWMy4272ah+66tF28x4lnr+7BnRLuUooTPJf7Vis7ozqH6wBdNMPp\nHJ2zXAxpj2eeP27fQxRu2iX5V9tMxzQsMm33NjDWwj49xF1t8jR64RA3o3US\nT2Ilc/2zmjfrZ+RDeevexIEH5F2AjpNaiLdEd6tgFMrSWR1+cxApdNE+dUTH\nBe76RrdRCGGxDk43+Pq+1TvuIiy6QAyosSISOJqfKje1qA+fFVq8SE7d1pxR\n9/FY\r\n=r+yi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDt/3szTn79U0pOMfnV+pfdgReJLf3dxgWKSylMySFoAiB0n2iKzP4P35/nDfFDu69wUl9wylomrabZKOhL4FTX/A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190801201049_1564690551283_0.5117543996463965"},"_hasShrinkwrap":false},"1.6.3-export-isremotereporef.20190806190109":{"name":"@atomist/automation-client","version":"1.6.3-export-isremotereporef.20190806190109","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"453a11b1a7faf84b2b4a6b9814fd1fc5da1d040b","_id":"@atomist/automation-client@1.6.3-export-isremotereporef.20190806190109","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Wf2McpMq1fOErXXbKaYVQrDysNvMJ1+6yMQwYCKj7ggYtLzzEKm+r+9iwVaxfHmsDh8H6EK7n4Z5L4/TOl4F5Q==","shasum":"0fc4b8981c37eeb4e3c688e1233f326564297955","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-export-isremotereporef.20190806190109.tgz","fileCount":828,"unpackedSize":3176973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSc+jCRA9TVsSAnZWagAAGNwQAJiywVcXbEqBq060tWhA\nq7HnvQEArfrg9zdgfuc/qO6ZuMP3N734lZ7Kk98RqCNN1CP12esiFdh/yRhW\nPVjMxRDIJ1dfOoH87+dpGBbnZB6cahQA+i1ngkuRSko0KhKcpeD89UXmYKYt\ncgYbo5cHdye0CvpiCRmCIyf0UmpatZActcc+/xR3uVnbL/LqLsCB3y+ES6Lj\npP88J2C5rILFjTtsxmCTr/3ke/0cO0fJvNhJtqcq4ZEqVUqN6p9FxroalD4U\nUNsVSHUqa2lHdhX5Ph9IW2NCA/DbPCgyd6mUcKR4jf1J80YgD4c7MsRClovY\n4gJB+/rpekN7C4i3t5ku+3Z0B5JYIMnG2TDAB4YTa+oK6oMe5TamrIXY4pg8\nchuTUJHzfKS2406rlvclZgvVlNNcFNBuM7gXJcJcPCNY1F/QSYdU0y6KaAv+\nKOHVdK4VZ/TNkq1RZTPpbXiWZx7L1jTo8iguVJQPg2rENPEs15KxYnCxQt7V\nA1BTpZfZ32x/Vha1fZJNLCYiWb3W8zl9/lL4VKvmjgdjOSIJfW7IP8gV6x+p\nBhTK+BJYUbTDqb4YRuDkHdLYAID+xCXg5KJF9xdS1HQ+XfPFs9PFOybMhWXj\nEiX07b9HYanFPqoTrKeQuCg0DEbn/Oh7ntXZapFFVYxRwQS6WccL5PUsbJ18\ncvM7\r\n=Hzv/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW+FstAPjwggc7xz3vhvq4jwmN7RGbs4bJbNTDaLHKyQIhANbIdf7zH1VqC5pTzEZa1gU91pKoNy7Gz3FpgxaQsHg3"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-export-isremotereporef.20190806190109_1565118370847_0.47170784009939903"},"_hasShrinkwrap":false},"1.6.3-master.20190806200153":{"name":"@atomist/automation-client","version":"1.6.3-master.20190806200153","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9521f20d4cc11f0177ec1eadfbe3e3b1a2a7a500","_id":"@atomist/automation-client@1.6.3-master.20190806200153","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TNGbHBNdul51cZbj/wWVf6e9IfNdIgQhy2YiLulB6/g61tyKFpI3c03D2Y2hrjfiLPACDifls8MjB3QWULEanA==","shasum":"d49a617c7aa5475e8b6d9320dec681ce29f61277","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190806200153.tgz","fileCount":828,"unpackedSize":3177049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSd4XCRA9TVsSAnZWagAANdgP/RCRV7Yo47DCq3yrDPDN\nZrBvHlpTKqo5CkE3EQYn1Zue5KsHfJtPd1NAewd1FJq9gldpyQVqwI7eg5V+\nks7kyMErcMMj2MXHmPmuxWHmmeWi40oO8cyqmmjYG4dQ4RPAVXJOlEL+Ns9V\ncZrUzOSQLdi8059DJe6X9lGxmT7grgZiWMkZLuoBn0+KnErqPG1JuBpzjF5u\nve+RcJvxdO62FanVsTrg5Ad5yep7Rb0GGhmClBnSy3RhUNcRTw49prK9p4HI\nlgPD5XO6yc5FDNe+kWckgsXyfoxVvx6ZkdVPEWZ7r6uj6B4ml0rN6PTXduJz\nIsLbVlVwdJ9hHKUqq1BWIS1SXtZwFkZcC92NAVtVgxsLHZhdazfNAnYpvfp4\ni06aR68euXOU3U5qtodRiWfOYJ8tXqP3U1Tg47M7MplBrHW/J09AAJ8th3vi\n2RqyJhqjB3dbbNE0Vj0B26nS4nfjbvH4gC6Xwu/dqlttrqWqsg1cgfWjDlYP\n8cQXdml7moPjKLxdte8ATGSjTgho4XUXyMRe4G/3fTnwPfitsPORLs/KXx5u\nZR9vtdg482fp815DPFcRvpz4vrpaVTPQT/gTUthGukDWl5+HlpK3XRiSsqr9\nqADqKMcXjjQi/pJ8Mn/mMgwoOhxjyyDDIRMLSt/ioUwHMDNpeDKdXgJ8mHOg\nxy1w\r\n=nJ70\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFByhbPBtIH68NSo4i41LaZ5SglaYDWncpwjr10rgSiAAiEAlNLACzflPJt87Bhrfhfol1Q5fcIzXcXxi8P3GY/kQKg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190806200153_1565122071139_0.27325437090375004"},"_hasShrinkwrap":false},"1.6.3-master.20190816081741":{"name":"@atomist/automation-client","version":"1.6.3-master.20190816081741","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d551fbdc05daba8846ed2b930ff0265a4036e7f9","_id":"@atomist/automation-client@1.6.3-master.20190816081741","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-oFNQVL5BBX1df/vVRux502QNnn+bIAZ15RzSvw690BMNquqssXaxL/LT1ehrXGcMH2kYK/vc/UZ19+UUVxm1eQ==","shasum":"0c711e4715fd67922b217c94442df54ec40bb073","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190816081741.tgz","fileCount":828,"unpackedSize":3177049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVme3CRA9TVsSAnZWagAAYOkP/jBaI5jOPxEERgMvktBd\nXZrKjeTMpxA/dORQZou4p8zmcRmfAs1aNZDutDUYFrvbUmc8fwasRq0nKW84\n+2qOjcHLFvoEJehLrqSM1KPpmQAewc7wcPCxKvAGn8RAdrMauHHNfw5ZbPm1\nq3XHcsdH+y32yf+7k0jdLB7me08EsHl1p6piHnUq/Qf4gFyL0V+mrRR9ynjA\nb8X9406J9YLeFqzH74cTyfJK5ofZoAnifvYCDPw3pXz7mkCweWudRtO5dO0o\nBE1GJ++4dO34YqNM8OBG+VQvfxSkZPPCwnB0WzspDUHBs0NM7f1eT+1yKHJX\nKYChCNKHFdkViwDoFICRrndNrWS5gyOVvg5PumYMQLG0iGNpd/lWKiiUHqBc\nuUBnh2a8nPzn5inCrZGNHECce8LagpNqOTEjv+HHAZtuixzs9mxyczgWDDZI\n61Dsq/cltdLgBDu17stVAK0sTqN5EEAWAnRrWU9FkzDAFbfHT5iwZY+gAAQ7\nNu/aL9iYvPTvHXECnieR+tQZcoG5VV4IcxGiZaKmwniFa/Ni/s4VJBz6h618\nqdJwWOrFjsFk87R/cp2rDBo7QeUVjvfAeP2IIyQuNQNOa3D4bL9/ZqaXaUES\n0zTXeRMHlZK7cuPdy2VbGPoHmPesnIaQCMCuTM1niJIBz4EHB3Su8eaP2/uk\nPhD/\r\n=R9xy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNcZtTpblJFekc3ZAvBda6RIqS5P6P41PD+KKyT2djPAiBrYzb5DtKsT/9wQEajpGDUDS+q9/a1xUGx32Gn0bftyQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190816081741_1565943734288_0.34645334216674306"},"_hasShrinkwrap":false},"1.6.3-set-origin.20190816084317":{"name":"@atomist/automation-client","version":"1.6.3-set-origin.20190816084317","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f19fd0874e742bf5c1b0bb5808ee128fd7e5da59","_id":"@atomist/automation-client@1.6.3-set-origin.20190816084317","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7xqrXImiqktujUzj0u37Uy6RFHruX36/fPHoPWPdGfYqcoXuD4i1VzZcO5tYMCX1/F+ZNrUoLBvQGJOp3QBtSQ==","shasum":"6fffe71401647e7230f80c04c530fe5c30392943","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-set-origin.20190816084317.tgz","fileCount":828,"unpackedSize":3177057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVm2mCRA9TVsSAnZWagAArwIP/3vlXTFQNtEGm15LiQ4S\nArK1fVpE0nJybjRjfYVL7+OtNNRUEstklC5CWz3DLK5gK/zGMGE1B3M/MPJl\nfSEh1tMxKohPJdA2V0PWQUPEM3nRQnwk8InyfUcUIfMLvLdaF4Zn/n9k5WEy\nSQ4QBGmSBZcUFC4kQ1tdNchruIM0tHyBILg6hBl0hdg0anWd/v2xAXdX3tvC\nClo3QnCsRytKdSCDgWTnXy9KcMr+hPqplKT4OlGtbe3i/NvELj9BT7I2tmij\n1xmxEMbi7vGYlHUFeD040KEGc1RIkyz/ZzeWj+rYwZCy3RtcN+gWlX9rEdld\nF1OVOEDiRc0AzlKcf4qf0I0ZEtYxmWr8xmd4et4rP2k6+dBngKRwCrMbGNdk\nDkAQzF9b7RYuHcJbVyBwUb3vdHfdfhkqI3tVb80orj/KIDLMYGrk+3xrVwxJ\nHLTE7Uy+1HpTcaoUOoZvvncy1cnqLaSjnoYOAVwKsuUteg/SbyVWxKfU3Yie\nL1Z19U8r6kj7XL23AxZ39lXLpjLOrNsbCvvoZk+CP7vl5Vv30vX/jFxU/Kl6\nDt34G6L3a6DzobeIxrvNyBz9b+towkxRP9K5yP0FijGmVOrb5z5dEgNQLppf\nbFdn9Z/jdeEaG9jFcL1dumFvN5uy5tn/zAtm8S1KbYWbc7aTGdpnNTNZefO1\n4vBS\r\n=2Owl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsyEQa32rnWE4mJr2SO609XrmRR99S21UrL00+VllLcQIhAMr1vdMYJY8ulrydsmfDTVVMQJ1QcSWSFV/ecS8JkxQ0"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-set-origin.20190816084317_1565945253951_0.40973601504674595"},"_hasShrinkwrap":false},"1.6.3-master.20190816122712":{"name":"@atomist/automation-client","version":"1.6.3-master.20190816122712","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2859ca48b9017aadfefe2f3ffb468b8e87f79300","_id":"@atomist/automation-client@1.6.3-master.20190816122712","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-76K2xwCSHuNaK/7KHxPKipe6KsjTIzWsDaWrN8fv7H472fgvTpNBk8cfR2nxLQ7+LuXh1hEakAM0h7FRISw4HQ==","shasum":"a2770583ac9ea8e349c6091d446038aa84bea1b9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190816122712.tgz","fileCount":828,"unpackedSize":3177053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVqIwCRA9TVsSAnZWagAAvkkP/3Sano8gMzzSBzH/AQYa\nQasoVcyGG3VsOIwQa2HeEC8JXSHNZ9/Xh4Wo5rYt4xxGD0gnHdEqkLLFzeoI\n7R7Sa/SB3qW2fnyYGBD8kAn5d0j9XJEIzn55fjvv8GtobKWmDoB7WAUVUywp\nT97961Ws1ch+5xE3sLELpQj8M9r1a4sy4efck5ImtFMyF2aEcwUjWiHbo1/l\nvteFHcOxn2gNjykz0pH923Xw4YjKxOCSU+jbz0ieDHa+QxElKbjGHJyKw5b9\n6H4hRI5q1zgO/WtljX5YYYFTafbi0i2l/qkDarINyDPEELR3MJJB4zWW5rdh\nQC9txsZdf8y5laQ5ArC08bJxDmE+JwvKxvD1xj6GxMCROFghrFM2JMKYccI1\nGOVLug8pvYiRgNNXTWWnKIj6F55o+Hx06Dt2REAiNWqaxESO8BBKDIQlmXn8\nNWaJ4u7zJxReGnkG0Keo6LfD4e+V2gUopGrhvIEOv7jDPhdRP8FtlM5C4ntm\n8TrrFp/baXLBw3KuPsWz+Dm3yy4SJpuAMAoHlyhQgJPc5sMWsiyQA//YNYfz\nM7g0UFcBufO+4C2yeLjB3xODpyFpx9OllI3h7FUbGdkz81YDKTCTS56usMPI\nYQ/SswOxzLGvQY7iZ7K2SNiiWsUsr1o8J86yZg/Qu2e2sKfBkT0CVWL+QFgM\nWoQh\r\n=11/X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEXLJs/MYJrW2R/7q88JEc+X0DLimsor+0FIGvess6/UAiEAyx1scWgssXo+BYkqd+Kleo0YyZxv99m5zhA6W/qdg60="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190816122712_1565958703927_0.1818717852589311"},"_hasShrinkwrap":false},"1.6.3-master.20190821065818":{"name":"@atomist/automation-client","version":"1.6.3-master.20190821065818","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"62c51a75447b86685b266537172cacaa42947f14","_id":"@atomist/automation-client@1.6.3-master.20190821065818","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-6QrxaSJXusTBvb8Z67neB3aOIx5EC9H4/TLmJWz/Q+UuA40BisxtNS35RpIMPwsNZ/EDR5FtApnaXsrpeDcipw==","shasum":"93daa9ee14083313564fc9c9ed48500adcb874f0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190821065818.tgz","fileCount":828,"unpackedSize":3177057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXOyGCRA9TVsSAnZWagAAkokP/0T5dSSHXSPqrfYfIHOv\n9Y5pojex9MS50lOyjFGQrrFJN8jzp3plu5tlMtIX8BTIPOK/uy2bpNxAgp23\nn4daPyLTJIQ8Gl/thjJv3XJ7aFyDEwtwbReEMM0HyRJ9OvuQnB0gZfHxfeiM\nbPF9wPtrcfZL6GB+eqdk8JPwfCm4lb6GtocfjzXG7ooILytyZy9ABGMPkatC\n7uxI1ICgCHEUdCDUM7AxQvfZvFjrAqHGIsNHwYE3PzK/VT2bIufCgXroVGPP\nKcgyBI1oAIwkFV0jTSB4wgF+z//UA/xJERygnQ2czb5VuzLI+JZxkuXnxkrU\nE6mIahoQPIUATJkTLvK4qyKkF8v4Rznoqak29UGoLTI+a7eJJnYwg7mWlnb8\nK4FGtezGxND2SludFLgG1jlZnVWI966ezF2gL8eUUAz18B+17II7RcCUk1tO\nokDly6GFHLNM8KS9JfWFXEpUcAuKsvROIAYRqk1WjPkA98TnlXpYa3X7exea\n+ip91f7IbPqe+Zt38ROi4E8XSEqnQfx5STANscX5VyNA5wpeVTmoXSbvlNVy\nuUQW6DL2JSap94lQ9ufeA6Otfx8YY7QCTRIk5fxcB+iJ4sgUj5ZSGxfSwHu3\nHRmx6C6sYyAKC9w+nbLmVxff57U5woqb7KHBEMVdzAUyH3pIqpErEO4PGUnQ\nZyQ5\r\n=DQ1l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7IWsROaZMQ3is4CFYpF6cVbNII1jR9BKMTp5tbJQ0swIhAN7XyR8OETa1mBvkkz2aoCcu2THOvkbjn0VFctxSqjo5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190821065818_1566370949912_0.857659507279068"},"_hasShrinkwrap":false},"1.6.3-master.20190824151043":{"name":"@atomist/automation-client","version":"1.6.3-master.20190824151043","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5b943677d1007a57079add01c95a212c4f2f0f83","_id":"@atomist/automation-client@1.6.3-master.20190824151043","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ZO3Peb+qJ3R1JmHJPASF9V821DaPpdUZwCQxkv7wM7ZRn8bCZlD6MhbyAEr7VB4oNd2cvW6aY9HrCYauwM792A==","shasum":"3d108b4742c9990e22d1110aa37603d3d0ee7814","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190824151043.tgz","fileCount":828,"unpackedSize":3177061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYVSPCRA9TVsSAnZWagAAvuYP/1b/ofxUtCoWM3aZAHca\nALIowqXEKKAv1ZRawecl9d1YCfj4DUHMq167s74jumjFiBf1kfjLFrnB1MT8\nI61FDP0j3fTlvbHZM1hYBdlNJnfDEs1TCxGyqVQnMtHNdVwzETqYpkjTBNNc\nIQTGH/jetsPdtkQ5KjZtTLHucn3Zc3zzfJCGhQrloIQEmZdnOUNxjP85rhHk\nOqPJmbEa0WLjg16gLMfD0Tyh1LyfcXDcbM7z7TfBp7rKeEFeWDRcC9AfnUKm\nOnLX527IRwc0LZ5dOzibpU1s9Uw6FmTnl3z/24ruj8KFUHhCB3pP8FbX38VT\nJyHZY+yEZCAfQ64kSSp56JsxG/EKGjRZdFo5ET8a8fFWcTNLE2EorX4AllMS\nWSF13a2bW5hNctAyEPCq/st3su2df6tlHy4T/ANhVZYW3rWR17oRJVYlgqyK\nG8viiiLdDi77+qn2aW5GpwJ7UHx/Bo0INVa5be05WeFB9xgusyylRtBdlPhT\n4qn/m0zm2DHuMOrt5tdfEcq3vDJJOBkt395BCmjwQ3WXCLeLdwTOgfPzgwGj\nYVLRyy2ZBiiPvORabeaHSvza01ob8kM3QcsWwfsF68kxbcFlq6mM/xaQGPy0\nmcSJy11L4Bva8ExxzLYChLhl+uC7GJ0bSXV0YBVSaXtufChLPQUy8VWl6cUt\nR5yj\r\n=YtWO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy69P/9xEXigbCBSkm/2qOOnbur83jtVpOWOwzDNHs9QIgLZI0fuMr557pE8zeyBJAoS/h5JlMb1bPv2FEMvaKovY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190824151043_1566659727181_0.0675393604010055"},"_hasShrinkwrap":false},"1.6.3-master.20190825172206":{"name":"@atomist/automation-client","version":"1.6.3-master.20190825172206","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c42f8a36858adda864899421cd37f0140318ed08","_id":"@atomist/automation-client@1.6.3-master.20190825172206","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6ee+1xBBRmTuvXoEv8L5QXVB5/0pSddLq3WjdKkgrY6+VXbbPpU38778g9DSJC/m8i6pJqLakSsLqWJ+7bCUsA==","shasum":"dbfe105d1287fdb55cee6d2431878b618effcce8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190825172206.tgz","fileCount":828,"unpackedSize":3176960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYsS7CRA9TVsSAnZWagAAsykP/AvYtcrle+xLW3Os8k5q\n8BJf+aV1qzIKiBv+LPpXL1v+w+XXlKBkahWRUZyOEhs3XjjLbKFQVnqZakVK\nVGcdvfOgXaI1kGzxrcE60fChzGIWDEnU9mato9HnlFmaE4nM6X/VhlzXtoYy\n0Y8H6uX8XESpfa9OoO5GPVap3xwUhK+Q/ZfEvl82dBKIqwbHY04xP7wgo9B1\nCtUL7jFfJzkzqqlOL5VBp/6nKN70ZgscPVhszrLV7ubLAznh1RGuvr+M55Q8\n7bQ8sJwkk7FDWgnsHkYiPDv37noy3nNpwOFVUpIU0HtL5wA23oQVtHLaWuZO\n3ZJ/U6d/K0aMcZHuTZCaHmmi/Gb4I7gurCuxY6x+Uh7we5jmfDp8JhfQimN6\nP+B4C1Y/XSgSGUQ9p4Yj0sxLsRcdJ1hpfRl8k0+mzce34jZwh5u5yeQEidjq\nZFSh1gUyzCaHtGxJ9ANA3QNIx/d9RF2gSYgIUVHPJfK/ioqZAG+0iRj8I7c5\nIgbtcDMGoQqPZWR0A04M9CH4vRe1FaOeAlKCg5igJha2qddTteQaAwSXUxdY\ni55Ap5WT6k0sHaLQMPaGQXCkPoKTXMWneTsZk7K7fhILShgexCq42TFpskUi\nsYWb8B64DY+FPtSoo+Wzo483dXuMOA8PiM9yYc5ruJv+MJeligTAVs8yc0rl\n5Hk5\r\n=Drew\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHu3hyjJkK5lfx8J0/oElUrcOlHtLi+0zrk+PnqpEFPzAiEAhLvfOluImFyvVLbEMWFRa83Rx/01t0VPtpz/T7BInbI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190825172206_1566753979084_0.06613645579240912"},"_hasShrinkwrap":false},"1.6.3-checkout-rebase.20190825225049":{"name":"@atomist/automation-client","version":"1.6.3-checkout-rebase.20190825225049","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5e3c05a73e90bae8140fee93943a50c2c966169a","_id":"@atomist/automation-client@1.6.3-checkout-rebase.20190825225049","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rJUjO97YJFiwqpqFMYrlAV0ZnaMED3iamadAIiMzVPs/MlRS9um24NfuAfpXMQiQhKTHb1W3+GlQeX60IN+Ceg==","shasum":"1f445346f2248dd4af5f446016c5d780812f0f15","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-checkout-rebase.20190825225049.tgz","fileCount":828,"unpackedSize":3178181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYxHrCRA9TVsSAnZWagAA/QkP/jTIJCf1awjABhUxX+MJ\nNbr8YY/03YaPnB1hAclACOUil4oGNx2LtoqwYX4mZmr6ZkxuUqNRr5ymDvZF\nOSrYaMulMA+z3lnKlk5thISXC0lCXsoKKKNi0ulYH1EnBLrqJ282nugFp9BJ\nKNVCfBg7VUhpnSK0QzYbVuxE/aQedesAoTnwiqeJ/B7HvUxa1B4apq+fUhVO\nhEgok0TJ7KmC+EJVtP27m7vjneuhr6bl1BboXqEB3T4LUDuv6k3v7GMDgtsw\nMi+4xCaMgJEy9PRP2I9Eh6ghrI/OIF6K+D/as3RftBo/KRP/lLAcw9Il/LMZ\nzC8HMFc85bH2iI5jUB9s/L+wKv/vyT7ydm1n++XNzxJmSKP/kX9XfDqFCkAc\n7GHdpZu1iNwdNob3rkgXF/kXgOhRSjXNVZpfocV8NP3UKDj57g9fbkcJMuqy\nJhbxsXNOWc4J6gUv9yHsJUZMlpdb5nI+WpCM1rPS7EJyVLfxiOFYOxzplokO\nM4p8BCnvIg+yLkcJpBhGmih0bfaV43cA6XYCZr5i4IjjyCK/dvbkEE3vbYXt\nm1qoPPDrH7JrHcr8ftIubtZTsf++jWA6QchF0W9F9hrPeZcGK3C7TDGzZkP3\nn3UEbrIPTmtqMNVLfO7+oCqwHan+sTy9deTeN5o+z9++jNEWXIpz+GSbf75T\neYJw\r\n=tbwp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpSGw+fV3gFZwBMIE/CrnGK6ktpsk1aUncadEklxn06AIgZuGxBc1E1hNvsfFOuTybCUPvRLlTs3ifYsEGoXJqNyw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-checkout-rebase.20190825225049_1566773738380_0.4539861777669203"},"_hasShrinkwrap":false},"1.6.3-master.20190825234034":{"name":"@atomist/automation-client","version":"1.6.3-master.20190825234034","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.0.5","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.template":"^4.5.0","lodash.merge":"^4.6.2","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"62534c4fd052d86303d5a2580162da9ee4b2d3af","_id":"@atomist/automation-client@1.6.3-master.20190825234034","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ihZpwR6GorZNQkfADbC2UoNl2teyL2wCZSfXhfI7Zmews+/N/CaSY5ihntKtaoHOoJdR3L95HxnJf9okHCGxsQ==","shasum":"21bddfd0499e4ffb6e4fa86631cc8632b3bc9244","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190825234034.tgz","fileCount":828,"unpackedSize":3179320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYx2gCRA9TVsSAnZWagAAqJAP/A0o5cI4fWBq/AbUSj3s\nXZqLGBmWdg8iPqiJl9c99T6XDN5gvnsnZJjVkl8QRQy6vjCCy0rEJY493RnY\nse+JSJTMLpL6ZPy+ujYL3dH8IAJhWm5tBGWz5X842Jmb2vaMNXIapXDXEwTk\nIWMa6Pk3Ci0eqtt2VSgzqQle09jkunPyT+xwE0YZ951wSeYQT6HDHxPVazto\n6gZwVyEgoXEM0oQrVFnB1JW9l79jnl6KDFG6/Pi+bKtkLdLo1Mz1ov2BA0+3\nPMGUQhsiYGWVt1Rxc0nPGPbAESF8wVCXOAMh7MNL7jT1zR+b0yW9cMrVHISz\nq4/vA1MtLhRn5/Y1gpPwNhSoXipUt1+ZcpMC2GkjKB31jMNev2PPEqnktvUT\nuiK4Gy8mrcF81Z2Bj394SFg7Erlm0WY6dU5K/1GnNpGyv9R4XrbvdCHRDL3L\nFN6aj0iPE/TJCu4eGVfG8vTHIs6XwdrOduE39DVXreocRkw9ZBibyZth10CA\n92RcwrOOftSI4WQcBQKVVbAVwxeIPG18eo7AXUq4Dy+PL++6xRfHFReTo2WL\noZ1ugTZC3dwE8pMf6k6tugHa6C5fLk2VOv6GH/ChJbTf3l83dkM2y3ahRwSL\nUan0d/Hh99+4SR+8JRy0+Z1IVzqE0gtF6q8ojyos9/CW/fWM4YJkO/JV+QMo\nzjOy\r\n=RrHa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc+Uh7JBo2s6aoAvIGkU5jFcSg0WWImbP0f2oGKDT3JwIhAK3DWIAe0dYIvIWEkgFB3HZjSQsDtu+SXd+A9IvQYGxu"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190825234034_1566776735810_0.8306182053635351"},"_hasShrinkwrap":false},"1.6.3-master.20190827160545":{"name":"@atomist/automation-client","version":"1.6.3-master.20190827160545","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/graphql":"^14.5.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.2","apollo-client":"^2.6.3","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.4.2","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9b19c816d11faef674a0b5856f1425b21cf5695a","_id":"@atomist/automation-client@1.6.3-master.20190827160545","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-pvOuHNtK/p62TSyQEYRFxHT9hMzlHeA3UcBlTA8tNT0IQHIyysgnMsHI1195ws2ZUCAKJOVznn/UfZYVIWigwg==","shasum":"69783f78d1bf4c31e7d16986dfc8e79c877d147c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190827160545.tgz","fileCount":828,"unpackedSize":3179294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZVXsCRA9TVsSAnZWagAA1S4P/A3Tb/KwBhlSUDcMfYQl\nfBJLkF+zT/6eXFJZ2hQ81KCn1sZk4dOkqBRd5IPl2BTIizaYMgcT3+tI1uXZ\n0zwvwm3uOXU97DY5kqtUrwerFS0fBwEK9XmJOsAOOWcKDvL4+3TavZ0tb5jm\n31g+t5+uhNqfRG4nR6/fzKei7rnXeHJDro4Q+x24HkE7VqtjvSwzP3aFnwSE\nBxj3kA9VtBR1xqv5weqf6hVTH7zm2xMEGPFg1QLa1ohDUVtVQ11MVN6oDgCo\nwo21JflxYv5+B1X8FRmJPwJ9MO0CSNIjccTbbVstmVx3iDPX8tkIW/rmJGcf\n/afaB6qo1pOLnfgyJoM/QfW6kSWs0+RPNMmhwa5grpIPuwuz4nHVYhSkJ0tV\ntKzWB1z5I1lb5IPgvzgUeTk+PkWDsdMCSlrPbQSKTfsSZfQxKFeob3gg4w5u\nXX+h0fAgO8YVoJOia+Ytdl+fV6IiGzGNFcS5mcxDzI7a/8F+iXlX7/JVzbNq\nw9MDblU4EsuAuoSbluOqkXMXBXNcTlmOayQE6xMy6fk4mgvpddi2gyd6F1y6\nM2mLfncfSNXs6g16xhX+qaDJIexCnY6Ly+JLOObqE+kQY2QHkLPmK7Jalkp+\nro9iy6u/Pr9LJouRRF+OUlDIm4BLFX8Szd2bCJq8aXb6bWiWMRJvkqkxIgXk\nt6w7\r\n=3lhQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9ei+8v6fXsTeGveVOlDa6SVUJJ7AS15u8mG/1BodDnAiEAtJMi60NlnGd4M1EWU4+lB5G0fKu8n98xBgESbm5mVMY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190827160545_1566922219459_0.8380630422231887"},"_hasShrinkwrap":false},"1.6.3-master.20190827162443":{"name":"@atomist/automation-client","version":"1.6.3-master.20190827162443","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"727bff11c799c7c0f7974b1077f681db25ae28ec","_id":"@atomist/automation-client@1.6.3-master.20190827162443","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-B4BARBXo0zuC8H6HjMPJQtmZfSO1fRAIezFExwd/sb5GBo8raUl2GguqxoWUizra+TQwMS1VYvtiQFklGTHzow==","shasum":"d065678e9706ca2c0cbcb89492ca1be27eae4c75","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190827162443.tgz","fileCount":828,"unpackedSize":3179154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZVpUCRA9TVsSAnZWagAAl3YP/2WVkuv0PBOHOdPnNlUZ\n3WgVaFVitQ6L4ww8DS00JnQhg5UZnYvwhyoBWNe7pj5yd97tUvW8ZWv42rYW\n+qj3fL84WOxkZBYs/t4wpZ8hiT+fQmpGelHk3TMbfJmZ/MLXvK8hXXwxJuoE\nuVGJ2grH6ecsehNxjdaMrgmHhTv7kreWaiwL3kDIoNZRPSbQJWsTDMt1WFrg\nNyAOADVB+MNWgN4GBm0Qw6reVqVryuTufqCwZMKiMqdM+f09Hv04UvLSpKxO\nfvcgTr1j9vHb9KqMM/gTrV7ivyecaLmwuHj/iZtBiWdsaGMzsa0qB3UQ416L\nqpIw/fyK6rcaCOItS70VuyIo5tMI58JxiLB2JD01+70x5UTxAF4hkufLxlWH\n8KPPnqP9AjAxunuQdxkivrRaWKh9I0ThO52B1iwO4m2fizFweZYY3nq5Y4yg\nk1W8YAPWziq46xyRAuFsqlz8Q2rpAwHHJgoKjYoMyU/TxvVcw86p9vuWEJX5\nxY4WSTSv5CIeuprq4v3QIX6Juc07oLw1BMBvFjPYBdYHp3fJ0PWjfI39tMhG\nJzv9nh+WD+yxItcva4PMThbQ7sZWeqOJw6VozaK8ySJSSJRgtYAn3OCKqVGn\nGZLmMihHp6fdXR/mLzXnUh5pZY1eGqx6zd04pBNO/jU4fyg2h5HLDrEP+G5g\nybLR\r\n=sfev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCewOSHcFKhhH4MBMP0ebVCfz0XUtJg4kYMZI5y20vJLgIgeLXOLMXfPv+PiZNB7qiKA3mHOgwG9DGcyE6ft4GBCVo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190827162443_1566923347028_0.4804496194823735"},"_hasShrinkwrap":false},"1.6.3-log-headers.20190828193609":{"name":"@atomist/automation-client","version":"1.6.3-log-headers.20190828193609","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.2","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.6","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.16.0","config":"^3.0.1","espower-typescript":"^9.0.2","gc-stats":"^1.2.1","handlebars":"^4.0.13","mocha":"^6.1.4","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^2.6.3","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ab6b84b1585bfe6214ed5d0b9f96dc129e47d095","_id":"@atomist/automation-client@1.6.3-log-headers.20190828193609","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-yBZqd6nWhSkWfL+CeJcQlG1GCKGz0bonnZCN9TtmTK8DEp1IgZJO20ubJid0kfk/nqq8AWINqHiAjA5FV5JFDg==","shasum":"1a312fa2b2ba9a84585fbe513f5323b5602f2b89","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-log-headers.20190828193609.tgz","fileCount":828,"unpackedSize":3179472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZtjvCRA9TVsSAnZWagAAXDMP/2bsK0YhEydPh0+cEsPV\nNbi7gS/Nsg2ezJ9YfywFrlaAwQv5Jqxfj8ehKVVDpNVzH6+OPdoxveWFJ7P0\nTQdcCLO3lBnt3v7TZmoUAxAL/61lvIZQ1bCb7SKW5OPSqlF82A+SvPLKWaTR\noEY+6I9IxziY8BdR6Z3hMTuGTQ1cZvKJQ5Kql9xWu3B0/6Uq/xpsPt5XIm+B\na1H+6ly3IkLTqWZ4bUB4Y3WSLG3bMImu4KFAWtIRozoPtEkPZ3zZXsXL0teX\nKtZ9+wwUKuyhsX9Ty1yGeNZuub71wnvYf/AQV2s+h0S8sOYzJUp/bceUmqOL\nihE6NEoMFxOPumpXAK1QWczadPt1nWxtjmqGnq8dCMQ4/s2b8cFusqiN69rO\nAEAcrAFpdSaIoSjcZ4/D9/DH0rVT9BxyLA+1eAaN42pP5c4o9LE7X3UmFSE4\nlLRiIpnVHSZfsJ3HZYP8hBYlKU6yPAcXe6Ez7xs+cAf804MBgO5XwcFdKS3c\nPt+uYGUkWyLokKG+Ui/oYYYsuZ80dqAoyIhuBd4Wh4d+REIM+70+Lnb8Xgm5\nsIFCI8reVr0Ohn5v2GgOCfZ1DUN75ZH8B0/PiUoRo2E5Cws/Dir+tT5E3nEY\nQJ6NfD5XzgmNpemvzciLqOzYNUCwlgjwTf2cZdqzEGbt86+1TpUfBn5p3nDS\njvKP\r\n=fM+F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC++GVsy6dfAqxdqrhiXUcVh9i0B8RRb0egFgVwp9SccwIhAL+CAXWOQoMd43fkl4xwQFCnGNev8Y7K37MN4j+dMevY"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-log-headers.20190828193609_1567021294480_0.09894913039436082"},"_hasShrinkwrap":false},"1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034":{"name":"@atomist/automation-client","version":"1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.5.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"aa71075c3effa8b562195af20af83502653440d2","_id":"@atomist/automation-client@1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ZysZkO+ukN2j5c0UpUDHxohZ4ckQktfn76AZXtN4zFDmvz72kHhww2o6PgN4cg3m5+nx0jm88CkhWE3crGCw9w==","shasum":"292cd18916ee2a64fee657a73c0e207f2d8c8866","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034.tgz","fileCount":828,"unpackedSize":3179297,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaUIeCRA9TVsSAnZWagAAwWgP/03y8DvCGugnXIet8blE\n8t5cOfgQyFSuGSctl+U795D4CyRei1qzyFV7/ow0eiWWXI17wfn1YWg5cX+5\nLHb5gz1mKWlGNmSfDMu8t6wkj+HY71IwmznEM2i0Hbl0Cv/kZU+aeEtvXLo2\n3A4atvZSTJ7D9F8Dthyzphvd5zm671hWv4kgpRT9+PTvRBcDZyfUgVCXX0tF\noPQF+1+7qsMPLFOYfxStckLj2+VW6Xs4Kyh/wxm/ZGnTCfdD/qivVVuYVgLo\nKMCSLhtPD26I6YMJZPySu3jmfP1mCiU9bGBny2DgfH0U7H+lddSwFdNEl/+C\nlQ1KxRijKaIJliSa0euGEz/Rwhc4WwG1I+GLxSy4rXiSXFUxILFjkm0ptlUX\nrTcYM8oFgOwEGfpyh4C50tIuZ+tcNAUomlFMHW6M6Z1qapruxp6nbW4f32yX\nWoH0vrO90rfQ3i330HJd7Db/g9X0fsNKCPCp6ZB1KO2P9UafWH4ufJvNTGPa\newL7W6EvlRsJgVCPOYbybr3v/8c4GLBSmxN3+NjYPGUN7ZOpEs6L+9OJR9l2\n+p+sJ+HZdmMAZ6gZfjptL45GNfUeNiuSgvunqIftnCbjJRBYhrT3Ri8LJO70\nlAYBXkrwWE9Yvs46p88VNeNlty0aJD9iTuMnF1jLBp+pz9zWD+RBaO4p1+7f\n/7dx\r\n=QcuD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+t0WI0QRaCoh4v2ZkZU0i8yiAeHtHvslKE1eF7HNusAiEAyKNgEcMVcip8e3xwTIMvvy0tmJ433y0V9W9f5w5xXws="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034_1567179293876_0.4757521451355391"},"_hasShrinkwrap":false},"1.6.3-master.20190830153127":{"name":"@atomist/automation-client","version":"1.6.3-master.20190830153127","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"73fc5bfcdb081c82012d0928ba410a34f3cdb48b","_id":"@atomist/automation-client@1.6.3-master.20190830153127","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-77YVRZEv3OGEuaC4bvBmdqnSak35PWKoR8QSngFjnH/gbcIkt6UU7oe3lj3kTu3Mib9zCOI1hNDr/42IMeAS0A==","shasum":"bb6d47d39bd6e41c60a1b0ae1005e844ff481339","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190830153127.tgz","fileCount":828,"unpackedSize":3179259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaUKfCRA9TVsSAnZWagAA/Q4P/3q7wQalX1hHV3bEZU3j\nqzz2OJMr/MyjZr6VqOq+7ZnNfmVtMmw+2QgO/A3EuHPnDqfnbm2CVi5OGEkD\n0Y+zJQuyBIYpFBqdgYbJ90kCYcizGln9QTlh7SUUVzEAgfZ2Vjsiz2q9kHLL\nvtoeV7f1D5W4XBi7ykYjizCfgOUHLOa6coFsmtoO+wLBhSpWuX4NmIP6AHYf\nx+5K4JLY4yu7MTaBzjMeWrZdUiF3xxNduLc52q5hcIXex058Xb0b/8Jjteu2\nU+AGR0g5nGJqC8l3w1qmGItzzHIj/dOidSvjZ2wz10M9hEgr025oR+M2UhYc\nEQPqBMNxVeAg4RiNk2T44PmyAS+Uf3U9S3gjpXmSOHmzvSY1dn0sJutuhwH9\nldDXJAvC+NU4Bck1kev0qrCnED4L/gUPagG146bVROYMDOHclee4lP75eTdo\nThPGWCX6my0wF5bW8d3F0OBuLHboRZHzTK+hk+9ZmPxJRFYXX53M47xnPXcA\n4TD66jdrkH6dyPkJZi3UuoRCd46njsM3lwmaup2+3yc+ovGKjC2QU7XRzvIy\nBfxeDziIfMGFaQkpgckGPktVK3yc4TjZAheBKyrpBr/7tR7EheQszWos2uUx\n4jeIvubtu0suU1/XaGWQF2v4CC12zldf5WMGbDk6Num9ObwB2CGo2saMW/uc\njBt6\r\n=Wwaf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhX5kYDh7P5YKLxYm31vzHmt3FkvfGTIE6OAKtFKamzAiAGQaRHOpz8s29Rmqgg5W3Mr2RUEVihVgPvHQiCTgknnQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190830153127_1567179423001_0.5260463462234748"},"_hasShrinkwrap":false},"1.6.3-master.20190831063433":{"name":"@atomist/automation-client","version":"1.6.3-master.20190831063433","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ea318bbce1b2cbe3cd585d2bbb156d2dd4e7ffe4","_id":"@atomist/automation-client@1.6.3-master.20190831063433","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ppgu5Uaiu02RuRYySyY9cpy38RyDxbaJLvDy7mrkRQk01bE9TZBYogQKPL7xy8C6PreVc9pBNZisx+/aW7wJhA==","shasum":"e7ec09fdc8600af2b65885870f7542c4aef62cc9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190831063433.tgz","fileCount":828,"unpackedSize":3179754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdahYHCRA9TVsSAnZWagAAE8oQAI75y/+c8UUehDlHIB/t\nTvbxTbnoKjWzLFDRfPx+FENwgKTnbuEQ7VLeobWkhv2+CT3Vmoxz6KNAGaBz\nkunIExs1X3mmpXxImKeWxpwXwm4b/il7cjUbgEG9E3QuTY1JCdpFQxk/VObQ\nmKnVnfLyODiekJYEHDP7p9qC0VR6Kmr4kDeUQEHTlas7sbLbDf4hfHtMuYWV\nMPP9AKi2FQeO+P/6j6AgCfeAs5YYdqndWPmqlfmThf/Qsr+Q7GhHoYNynBGg\nCadexcAtCU0wCp3hCW3SJ7PhMxMNm1mikUh3LPJuY+gGoJi+ob/gb+DWvdI0\nkGkIF4yf3QRWq0DXpevEWgQJkTayQLjCpiENIrJWZ+CkWJTQs+Oyv2/aY60i\nsU4UOn6JdPQJpABTKqZhYZdCeLwOzdspNZvfdOSvzcxCilNEy47JIRJJr93W\njiCwkFBuVwROC1ErfzKNLuHze8uisTF/NAH/lFEpujBLYXphA+iQ9cLmXIKb\nJ7loFKhXWeZX8oEZ7QEEbJ5KZcXAC6YdZrqoBpPbYWiAMMh4gyBRqa8v1obp\nySOlyLixXVOBbML3Dl80+cvSnWnWh7MeivmymjvoEMDKwW0rqmtsBMwVgF6q\nw8G3lVadKMglmT085CfwYxQsgX0OQqBr8r8gkoCPDMnhuGr4i0WMrRdokcdS\ncPCe\r\n=oPyF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHmcgT+wH565M5QUODVQUYeftOX3WklvxR8Wa9gB/i+gIgFRBRu21ewDLQdwUdockX034eI6ti51hUVkh0/Pmxcg8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190831063433_1567233542489_0.141267081399012"},"_hasShrinkwrap":false},"1.6.3-master.20190831063237":{"name":"@atomist/automation-client","version":"1.6.3-master.20190831063237","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ea318bbce1b2cbe3cd585d2bbb156d2dd4e7ffe4","_id":"@atomist/automation-client@1.6.3-master.20190831063237","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-LDUZ5ekHRPRx53priDH+bzQCnM4yDQVjSyzB4aUVe5iol8wXjHw/izfghvuVNLqYpgCzX1H7ig/yOUpA0KI+dg==","shasum":"5d6d82a71c2a7e93335017e5c8ae517c60ab1b4c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190831063237.tgz","fileCount":828,"unpackedSize":3179754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdahknCRA9TVsSAnZWagAAorUQAKQNajfkzLQXxhkT7IMr\nMhV2dEORX1C5/IFvOxeD3EVqjHL3HHsEE6pcmI6URL8l9EfqSKBwSvbe1wP8\nnINL030tfizfc1EsJ8Uf2wpwJA4pSMbok0Va4x6D7mGTJjuSo7Nda+ffSZ8/\nFuKfh9yAnpbHEGekyjp+rUg2o6+ldwQsEUkT3416pyOMBPDGpufnBesaEKqR\nNzxiLfWUTewiuSLTzmBzX2WCgFp5DIMKlfmBGGLccrFHO7I82mSrhMbR96cw\n5fWOiTRUdQUzS6uoGaA5jgWvcLvYzYA3dGs7W9MkWvhHMz97VXFPpYYYieAV\noQJncFRIbKaM7qAQ72mjEDeghVAZ/sobK4kysEIheJ0PhSmc3TNHz0W3n1Go\n5EHzPFfYdJ2eEzVKZ929Zds+01VbhaFy7igQpAaZYiyq5EYBXYCCWEUmApeL\noP1+R7Fc4q5AEu0OtQRyC7I7P4fhtPgYqZp6evC+iNkZVYeUZIDWlnkNpJbW\ncyLxM81KELH8elSy6QWveMbSWg1kDS+seVHFlnrvmQQt3aoSbdYX9KLiT55q\nXroFeVNoWljqthGy+Eml8hKrjMV/omiBCHJj8ty/2eyw+hTMTpx1rNe+TRv5\nyFYv1F4trQ4Cu2cZ1xYFIZ7unN2CrSHGKfTi6Ks7C33GO0yhvhhikrH6Sdtn\npib3\r\n=vkhE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkzPJeVun9AqQHhgrUSInk+OHOVOFNUZhbYjz/e3odNQIhAOHaL5LYoiqGaDOfhy8uPFdGSA/qQ2OjEk6kkShsbyLk"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190831063237_1567234342938_0.21891261813662521"},"_hasShrinkwrap":false},"1.6.3-master.20190901170820":{"name":"@atomist/automation-client","version":"1.6.3-master.20190901170820","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.15.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"14.5.3","graphql-code-generator":"^0.18.2","graphql-codegen-core":"^0.18.2","graphql-codegen-typescript-client":"^0.18.2","graphql-codegen-typescript-common":"^0.18.2","graphql-codegen-typescript-server":"^0.18.2","graphql-tag":"2.10.1","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.2","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.0.1"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5d243d7524645fac95002152e7199496978a84fd","_id":"@atomist/automation-client@1.6.3-master.20190901170820","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-eLAxM0mA5BhT7K6pz3o8eEHAyMJ1vN/JgOoGXDnWQN38aT6h6KgxhuGddlm9lkHGFVcPvT4gZ0LWzA233Pq8xA==","shasum":"230f91da4b106fdaa937796c7c3d8f8a4ff848f1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190901170820.tgz","fileCount":828,"unpackedSize":3179897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJda/xACRA9TVsSAnZWagAAP+QP/RJI21YJJJxn3vEgM7bL\n0wDJ2Q95FShuw1Zx/O1fo3GX+TcVZQEdC3URIAByhLJg9M3Mv7FNPatLxX95\nVov5X5fE0xwYCjFpSZKSaAyTMViJ275FZgHcvgxIUM9eawcOXaQ/A2tdVlCl\ndgSaZw7iDwYSDNAJVxIPb1uQa5A7JrxBdxi3cSeVK52lityLcvIygpyGbzCd\n4DaVYyYriFA55xgaPbpzeodhVfczj3/CI4QC5RgVCQjisAmqUm0+bQtmnl8Q\nQ0GKeB3T2yDaxQUxf/JKqBalVcQSuI0JALGC4l649vzhsGHkOJwhw98bMIKm\nfY5nGFQkCF2bbZMZNdDRvdnUt47QeiRMG9ep0PrjSDCzMuj5gs6Bm6ukc7YC\nMDmjlSHYv1NN1hWnYH30jFKu7F7Y3LPEgeF5kwpP7++z67iU3fKFjdfSd1BB\nm0dQhOwP+z7/J6LeWKsZFegbya9e/zSolt50VUHA2eJsmfq6DrIxGoKn67Fr\nZuGZ9Faj7PdIk7CG4MxjPjHS/okx5C5pmFrTTzllqIChycR1CdlbPZ6ukaCu\nUkSmmXQ1tEknPIciMrKCp7NqkhxPFhKMbJBNW9HvsnzwByKUygFWkS6hUQLV\nRTUd42Q/dOTm8RPP1irBelkqK4WBiIOl9n5jkRgm4W6xKViyvashrK2IaFtt\nlMXc\r\n=Nmvb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFqOcsI4L4YCd8R8wJyBQgEz3lgGlgUgwZjivMfDf5KdAiEAyLQBhdX7ffXUlzD6ISMVhm7iPhg6Ntp6Hr6oDNua6kY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190901170820_1567358015588_0.5309991358611612"},"_hasShrinkwrap":false},"1.6.3-graphql-code-generator-1.20190902132944":{"name":"@atomist/automation-client","version":"1.6.3-graphql-code-generator-1.20190902132944","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1ed088c0b738fb067354e2cad2e674164efc7f42","_id":"@atomist/automation-client@1.6.3-graphql-code-generator-1.20190902132944","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-oriZ/IsjcCOjFO42A8ma1K5oygMGH2zTSFLM1oB/vbGLPvVJ4aC7ruet8MoKvlYdaiROU6nAQtnmNMaEZN0xDw==","shasum":"1937fcaeef3498674f3ca1e31c3b5b603ed2c3aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-graphql-code-generator-1.20190902132944.tgz","fileCount":828,"unpackedSize":3180758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbRpXCRA9TVsSAnZWagAA/HAQAIiMQBElE72vaecbgPyW\nn9eS0hmWCU7vVUekwgOnCeAtR6pfe3/eNlojkNsHm2+dy8zzRqYy7EL/Kxv/\nNO0UR0nwr9s0zZdDAocjgysrjAxBfWT0ript5+RDvoh6rMSwm0FTcdLJo4Kb\ni/j+pVQ9q2QXyL30o0jKVU5H9kao2kzXkclF5xRYg11Pxzlpcg6aynXi9bgl\nVVgcNGFpP9MRFnNqecZXrynOwyLVJ23FRslRGB/wt6ylG31Epj17v1LTOI/P\n3xFZ9jrimsIYAZHNvaQdSvhwDTGQ32muGWDw2Pikdi28qr94XKrtjDte5W20\nWhjhq1RlRX4Z+Bu+3UvdstyquZAChwylT3iJjRaGvWUpCxLTDu7Li76UgabO\nZWzOefRW/DyDovSocDzDSgbvWHkkfufcx4JWx1Uh4eY5B4lByO+w1EDRq6Ii\nsJ9niMiPL/l7bEWYrRpbtqDmxn5abwR9VsTPj1UcYQjlYodY8blAYQhfXkLm\n0ZJ3YumkbiHfMW26lCQ5+CbsyyRrZt/1pbuwFOVFm/YzPLyxstVvDdmM67Vd\nEuxVKd8Q/3aZKIchCsPhJBBM552X4U/iIauv6QguM89tH3KXoIJ1DIQAevX0\n+GfZd/ftRil22XZl61Kh2VZsJf2LrTdrnj1vC89Dux26dCfYpt5BNodiq67L\ns1MA\r\n=6Y/C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDelaRDX/+LzjnuGjvfP9rB77A/vm77WbUuYGG1NTEcSAiEArldiD9O29OEticotkTRRNO9J4b6NhuXURoChwzXfhrE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-graphql-code-generator-1.20190902132944_1567431254552_0.10729891667729241"},"_hasShrinkwrap":false},"1.6.3-graphql-code-generator-1.20190902134121":{"name":"@atomist/automation-client","version":"1.6.3-graphql-code-generator-1.20190902134121","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"91372c56c1ddf60f0111f16200b385d02e0bd25d","_id":"@atomist/automation-client@1.6.3-graphql-code-generator-1.20190902134121","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-/GbdtDyXASwdtLonZ1wF+6018irh4b81yjOVAdcoRz94d75w5wi2O2jvdiJb884+qZ4lbTld49pUOo2ryJEaVQ==","shasum":"b51a131466d01df11d321d077d084db5c2775081","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-graphql-code-generator-1.20190902134121.tgz","fileCount":828,"unpackedSize":3180793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbR0MCRA9TVsSAnZWagAATl4QAIYb6g6yk68FnQ3SfggR\nkVD8myqiG9h3/WvTSv5e8K3xvpbJIlBCyyooGhXlC/blyAMy0xTxZelrt5KM\nnPyNMOwFgc7aELX6p2r5ePDGqJ2YZZtOvNLkOxrQHScQZPZ39Nb3tG7iveD8\nVVQvHgPwi1wR+P69rWtZRcfsLKf23H6mTMReJNAtG4xQYQ7YrD1LVpjWBLyS\n+PkZBe2zkXiuifP6u03tinxDFNB9r1HE7V3ggKk8We6t19yIdTFtpw45NU2o\nwyG3cuC8COUNz9Zp0SJqNLPFlKk5UkCUuAHNEhRA5hArKIlTTDQmCRH0VAOw\niY996OrUTMSae5SW8KceORsakmJ/Fs5XamIsIXCnczsV84j3bDuQMUlLroDy\nbugZXjIFbINg9yGh9Gjtp1sIWt4ovC1h0NF7n513DXXnfGHXOUQP6/18cad5\ntMAWX6bF9wlsuKzHOqZ4cgiD03VA6M9FyqP9dN8F7dUnbReQ2QkFrjhTBsQA\nJxOgRzNVjP7xD4Kj9rCdl0wla3dX6m85Wmqch2LFpyZnDvrYQQ0SP0R+HGNi\nDWJXpsG29iB3kUWpI4+3xwApCdUaIlRGOQ3CN7aKVo6mjfmiXQTBraNwXFog\nyrZxfNfFrbhza3S+ZHX1Naf+8ZDxo299T/w/WgLWHCUSlhm7yiTopj9Cwsod\n8Sff\r\n=kxup\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDes0aLI30xpX4DjGiPA9mnHtSWyPMF74sNcmk10ODlRAIhAMHZ7k0vvzqqLmZRvo89jqxh5YIiWdlgfqRAxUvk1mkG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-graphql-code-generator-1.20190902134121_1567431947249_0.46213578512347686"},"_hasShrinkwrap":false},"1.6.3-graphql-code-generator-1.20190902141916":{"name":"@atomist/automation-client","version":"1.6.3-graphql-code-generator-1.20190902141916","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d4cf9b5bb2f5f8415b2ee2ac35b009f1e063db34","_id":"@atomist/automation-client@1.6.3-graphql-code-generator-1.20190902141916","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Syn/p5Znk2HC+hOhu2G2ztuNtRrqKvgmi4NcP0JML4TKyIVjUKiXAsoloj6WKM4/G6lQNEQxw4MuFajhEp9Sbg==","shasum":"2de3827dc021d66f4f928d78bc9413e0ba134ae9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-graphql-code-generator-1.20190902141916.tgz","fileCount":828,"unpackedSize":3180824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbSYICRA9TVsSAnZWagAAWcUP/RSg0NCwS3W2eNTuDFDq\nyUKb94JsvQxFVHJ/VbN9zqWlWUzuDhUy+F/TuE9JSI97ov+HrCaQetsgGNK+\nkAUx4isGe5bm5/S+IXIvTpGVclTWyKr+XPNfCg24ix2EIzbXXuphn+dXqQoz\n3cJQ8KdPYn1g0+2AQjjTBFHsX8Yr7S6v8McXOoDeHuc9oQqytDG4nw29nzQV\nvNndFt0PQAtWGzITmW41i6z/k/SGXqz84/nStCCMui4bB0I+GbapmJ6DUIJv\n5CTKOpdIz7KgQayjaUKkH9lG5ZnkGQiS96u8D+DHCGXl8+fPB5GCrG1vYVku\nZXHVgC7MXi9ntUL0+ZkUm0bnswkg+bVA5K9NImcSvmPBgZ8bovBROvJjbp2I\nUwzQysahCz+cwZhQw8x+jRb8Myg9Aiy/r9v/dIf3Euazn0u9GnXe35yt7QPS\ncVU+t3fL49tCL9ub2i65RBxsNVbkrUUXanqCoXBogLVV+yxFYHi0KSvwjoIs\nb9gw75eRj4b1G0P6f5irnMfKfLARbYXA6w+Gnrm8+I2V2d3AoPL2ApYBZkKk\nFFoq4w6P/lLbNxx40XZe0nfsGQFxVl4MvRrT2NfdNug0aPaAFm662z4tiBJR\nnp5CpVTAJ6AFCQ0I8tMIMo5aqZsWYGRHNv898OdYL+Rw/ZTfOi7bC9j12X8y\n8hBy\r\n=79/O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVIzm7iyEC65bu411D0oUE4a3Ot6bUKPFCdhcRlDb9pAIhAJF9s0OGr0hcKyHd6+MdLTwV9sYxYiwdlK7UlcqbBoSS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-graphql-code-generator-1.20190902141916_1567434248156_0.45372127063937207"},"_hasShrinkwrap":false},"1.6.3-master.20190903132130":{"name":"@atomist/automation-client","version":"1.6.3-master.20190903132130","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"3.5.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b245b4b7b6b7972f6b128ea1638ffcd3fd4c9d1f","_id":"@atomist/automation-client@1.6.3-master.20190903132130","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UbHU8W/KtSTMEj2Qjb2AXF6N6t93jtbHcKiq5Q1Dc1dd6W84Mgq0hvBpRhqB8sL9K2YpYzHtYSd2nNNhLKSqcw==","shasum":"673ec11585b143534420fbde43b09edc98dcb81c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190903132130.tgz","fileCount":828,"unpackedSize":3161534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbmoDCRA9TVsSAnZWagAAHj0P/iW5k3Zns+uYLGiwEkSJ\nG4GE2xSSQtRq6Qtf30QmtD/Ioxtc0fKDinrXEgRW0QVB7X/4MJqkS8d5F15v\nz4CJZgtxU+/ptHrNugTuXHzz2Ixgdr15TR+s5P/8lyorVG4SCOqJ+ynUYdpX\nF6r3A7VuCQb0mq/Sz0CM9pzuNCS00XGYexTleBZEzHJuwFrS1c4sWy5bxltx\n5/EQ6ucCuQKAdTPtilnQCCFbgvqkigiLeAbQXB7DSn/mLnCdGKhplhT4POfP\nzBC2dFodFTxw+KUnRJGhm8qi8qMe8dhwVIsPaH8VdDvQi9lL7paLHx2BhVu4\n2qJfneuVRaLQZM8IVUvx7JbsqqURD3IcK6zyNEDdbRLB0CeJJCpefFVbkzt+\nhyE9hrD4SG0CsXrKhPYNEC3sVJo2f1kymw0KZVBUMYTDPQ/OA1XEX//4CENQ\nloK2hG57a2gHvCoF1Yi2YPgMUIiTXQL7twvL1y8yeQDv/ShQLsJ+xz0IUEKd\nB6oysbgUtPaYZgMqS7Fd6q3dRCSalT0t7dbF4KjbJ8A3K/cH23hlMPGFlxpx\npv9NJRYVmx8IwK56JC+uraTCSkTX+dAZ5S/k47GVvzYvEJ7Z6NgbqTgL/8PM\nSkxUu4vzeg5WqQY3hTvhPlpxLegPIFGPqi+ywApCoMUmpCzLwAji8e//SY1f\n0tFk\r\n=phij\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDya6Gc73JiMaeBg5XhzwCu7a0Gd19Y45tudXNQDaa0pwIgINA24r4xPYQ1MKFr6L8wyC5FL1of/N6cK+PmxouUbZU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190903132130_1567517186538_0.7069021244360305"},"_hasShrinkwrap":false},"1.6.3-master.20190904061426":{"name":"@atomist/automation-client","version":"1.6.3-master.20190904061426","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"096e4dc51eeb50e852f592729cbc8056b5fe84f7","_id":"@atomist/automation-client@1.6.3-master.20190904061426","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-FDqnefgpC1EEMf+lXL3FbOfNykk6SzxkDMy4YtwkSuSMA9+r7GfrGP66iBZdY3ttkVS8sdzMcthv8SIBRH4X0A==","shasum":"f2eb1ee1e3d1ac52d1054bd065a6a29459a9fbcd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190904061426.tgz","fileCount":829,"unpackedSize":3165729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdb1d/CRA9TVsSAnZWagAAGF0P/0ErGfnxoqXGgq4yBMiJ\nYMr5eFhdYs7abWUcTVvwUe7kwtdwarhbHvVvWZTIvm5BIhYjDE3Pn6cTlFEg\nhNYz/eauRmKwtdYzAimaXd68LsNp14jAI3tqjykeoSI+c8iOjgVxrkrZYyH8\nKeG2iEYYyx6GKb1TQupmBgmVInUAsk4xus+AN6d1qdpqpjzMYFFcanDe1J35\nnQzqiXvWuNDaCesbWwLTTQvOhEWYzwGbNTGe/qFHMX1l5JUR60H8wOAWJOSw\nuaGV4dFxYhSqr90rEmetP6JGsRwpBUTfth+3Z9YdoX0HRdhoNlM96ypuAZga\ntIp16v7f2uYZZfqCD65rGvsLvOyMBVb2zFJDqVF8TUlx2NJf4wSJ8OgbHs9u\nC3KHfZFxyiMDPJYA5j573s/FnkcY2mFMgaiPCUacKHnKtem69pnJVnBE6NKH\nW2EFyDvVueY7hvBeXRsm2c9KNW0sFk0CvkmN4Jc444T7jHqrc2hBBOeg0TrQ\nJcHZqiAxeUmCggIm8ulhBf7IMIU42RtmLNDjLAcAe777mhCeITCpQ73yvni6\n4OOwBcMBvNhmRJcUhBZgVhNK+fLrBK14JumY5VTZ+W9R9L4/T1VDz21SykVq\n6Hpwml9C0cXFRkHYybJK5kTILUxdIozHArHxNL1JnQHnmUdLzg/Lb7ZDO3w3\nsyvy\r\n=TMEe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDaosoNfwqE2TpaykaRi44fnwW7/vdbYr4i+c318Hc/gIgKJNNw1kTkCxwvAdYOKxmVaHYrn+U/MwDhzSp0u5YrgY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190904061426_1567577982664_0.7428419191442739"},"_hasShrinkwrap":false},"1.6.3-dev-start.20190904184449":{"name":"@atomist/automation-client","version":"1.6.3-dev-start.20190904184449","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"af8473f5e9fc89f88e1e6cdac2672668be7d5613","_id":"@atomist/automation-client@1.6.3-dev-start.20190904184449","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-kxfdHll/FhZHVVXwjdQVE6Euj1/qYhodbGiDHNZ7MfC8J2p/UCWbqcaCR6zpbigNnBLehoZWW5g7Q6Zd6NdopA==","shasum":"5d6ad133c8a0c1b910ecddc4c9a76321fc1e9dc5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-dev-start.20190904184449.tgz","fileCount":833,"unpackedSize":3174163,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcAdHCRA9TVsSAnZWagAAMUUP/ReuF3umZFgGyqQG5eXo\nFtESiON7GViY+kLIm0/v++o0Drnd6PiD+ekZyTC5rYbhKOyip+kLr/oxjQQy\njwK2IcXdO1byQUZZLxvxBVrLi8iTEpX6DeyykjmwFyfAMgmtV7XSo4+1JCzo\nK4FtL816LB+WNF7Rpnu0n1Fct56H8hRAZ7hrX0PZykFMlBoiG2F9hju3XrfD\n6zcdpL5PPQoq23lNqXwx7j7x6i1hi5PbEhP6/vkI8r58iHnndwVlYOMO3PXv\nVSQJVO1XkBwMjqPWmxskqjycnNFIrLmrXTdBC3ZrvKzR0rVZakcgUnOCDJSA\nzi59ivkVQBHHTJ/J3lWDISVg2aROjDjbSFxNwZAW1ciyAqpnQbZybdfABovY\ng0NytSP0qT9cmZWoeJmedbHb5+t0wSvsP1AT1VA/jOEXdc2xR49fXEh26lJe\nQZl43yDIg42SRuqvG2aYCTaKA9eCj1vdAJDh6M/MDt3ZLQB1tiwMyK8Qn4Kw\nGeauEUAWY1LriEfD22firJqYx4fIn8sdhMHWkmPRYoloPye8iGRNkCTvLy1V\nFGNBR+XebQ3/sbq45vXaa9BxKZeAt79Rtc59P6yUd5N5mCroBz3KHUjU73JE\nfMkqbMJHBROPRsdb1F4uz2rDw9SHdZnsyLzW9JE8C9LG6ooh4AQJ0qfqo43C\nbJP3\r\n=XpmG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARwc1TUNKSE+DPnRDWNViX1AstKhH4sYshSEIVbYi3oAiAnBP3N9qA4ws6XgyLP96qEyPARZSS2tjy8JTLLl74C1w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-dev-start.20190904184449_1567622982346_0.1492765684934605"},"_hasShrinkwrap":false},"1.6.3-dev-start.20190905065824":{"name":"@atomist/automation-client","version":"1.6.3-dev-start.20190905065824","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0afe11f2a7e0d0c19a419908e60c91cfbc20ee10","_id":"@atomist/automation-client@1.6.3-dev-start.20190905065824","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-eqnuDVtqgqoylHEsnQsLPy+2AuE04Fj3fAf9ZxVWDqO8d1yqnUg9Lw0gx4U3j+f6Egdezf5rOC+diasM1kAP9w==","shasum":"c993a77e33d0be379269a09513e4eb92999a1ab3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-dev-start.20190905065824.tgz","fileCount":833,"unpackedSize":3174587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcLNrCRA9TVsSAnZWagAASNAP/24lLEIwA3Jtf1uxTFzG\nUNio0qwT5exFIo20gPJskyu2OZvb4p3ke+VNzDNpkm42kou8CKmPvuLkoims\nvVWYnciReLGKNSW5eUcYUgo54c5blJWG2cqW/ZLLExi0b2icwwEzta6x/i4v\nj4sJ9W8TQ9U/Eib9+X45EM0H5ooRwK1ZHzQ1DcK+W8KMBTdQGzJFWeQu/lMS\nIHZTM26TQVmkj7aA3pAwX34bR2Lg2ww+BEYjvjDly+3ves0hJktXF26+kEMT\nEdG5p0+14D9EM3KKR58ijk0UaPJvW/xTqNznjTHTzShCHBBIizscFAU40kep\nD48re3AuXZVq/52PP28v73AAW2UZsj5W1jr60K8Z1qeSbY/GS2zhZsagj2O+\n6k8XNAVgODESt4nCFsygilISsbQ38a8eUGTYxv6RioPOZk6YhaNxKsovgOVq\n7o9U70o93kzsc/ZiRV+uDpLONFpUvsbsg78MOjJM0ohJOmsVXcAanQd288Zt\nSNdDCbcw4spWc4QkMoH4E9gX96GW1q0HLGzfptcmtMnQpaal9nDrAKmV7PCQ\ns811NmvDIBlOa0dRjGfhIft254by6kphTxssoVLs0byYpFovap1ONr12/vAA\nG5aL/rwMKG+/QejXBJNLFHVl2lgizQIwJshMI0TLkmUpn1b1rx6vJ0JEOaDC\nSi8Q\r\n=CRkW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwmFjw5YPezQnn8J49kghYzQUcGyLGqnd2b/4a7vWeWAiEAhPqSjJ5Gybj2OEu607VceRdBfAVU+zCui19wwng51MU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-dev-start.20190905065824_1567667050665_0.8482156876545437"},"_hasShrinkwrap":false},"1.6.3-dev-start.20190905113409":{"name":"@atomist/automation-client","version":"1.6.3-dev-start.20190905113409","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"20ff46d9c1f1743e5de32f2d810bc55f21f5535c","_id":"@atomist/automation-client@1.6.3-dev-start.20190905113409","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-KNM4nmQ8U9mf1DUFBn8/XuKEHrJaQ95m7YyObFDkzLd3FDEFz+eIDozaH2OL+WAg9Hh9KxtfxqWlGIRyjQDyIw==","shasum":"00767e73c15b244fe9a87c51f1277c29474857be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-dev-start.20190905113409.tgz","fileCount":833,"unpackedSize":3175455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcPPQCRA9TVsSAnZWagAAVwEQAJmXNye8fTfioNWeLdZg\nEaxtdLReRma4v0tmrSep5Rnd+w4Ue2BLnCuoeYkC6KrR7aDYm5BdERgV0yFQ\nXiLpMvPmoFPHwAJnjAJVR7GgiVLdZgTnOJd3rfgHd3S7oP41jgZqVQk1Ato/\n0PzrmKFTvpDtLMaV1shBj7eZNztpXk2lu5Nz+AOHMWZd6YvgWkqNhHMVCoh/\nWAbElVimcRPRogKqpmkR4euJs593/aqzxq8+GQIUGNMut1+Vm/0moYnGacB8\ncjzx1WrRc0rNiF8GSctTiCbCDbfUli+7Z+8cjkvhQq4C45ps73QDxLG4vJxn\nQ1waawjM0COvhwM+huVxUFd9Yh2SG1wgpkqMwJBoUldQ3qlh2QEAyPxNTtG2\nTvV+whOgS7MzR5ex3RySiz6u8ZUe/C/mp6IlSpTR0bHvN4Vc1uBnnRL+4cr/\n5ovWD6iQ51Biro75b+IXZLvX7EQcPfrvbAilJlDPcMPm/C8IM2u5suw8sqe2\nomDYAO05NAv4hDGHYO5w4u3DFctjHLYgDCLPmKL7kzxnJd36s9KsxkcgWipz\n6WoUSkOJvNI3HSUKzHAWo64K6JJ3plR21AxCZp+uzmfNnZIwjYjm7wrinVI/\no1UUhmKa1mgp/d8gxAfon4t/FneX47lJMyjl+NeTqRvlR6Se6rLUggCOxDXs\nSqyy\r\n=Cnrp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXQobNB48Wfnt+Se8Eg0LSKWzwf4fYHLAhQSvmVXPswAiB6Mi/RApTXgfcmMHmLtJVoeAUSjk/hryDLQ65cOzjU1A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-dev-start.20190905113409_1567683535836_0.6713328664976908"},"_hasShrinkwrap":false},"1.6.3-dev-start.20190905134812":{"name":"@atomist/automation-client","version":"1.6.3-dev-start.20190905134812","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0d63282fd903d80cc5cbd0193bf18e944ba3d07b","_id":"@atomist/automation-client@1.6.3-dev-start.20190905134812","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-79N1BNuPFim+U67JzXFNIHX767jZZ4kfNoPERFQhFtzb8sDeWLCX5yU66cXODQhUQDYmBkC0vAiTQMPU4rnUmA==","shasum":"21451254992267dcdb6edf139fe7f957188b1a4f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-dev-start.20190905134812.tgz","fileCount":833,"unpackedSize":3175455,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcRMoCRA9TVsSAnZWagAALOEP/1fEYib+FnidK+KjOZIv\n+kSiOXoMVFoI6D5ttjRai8D+VEdIaXbXiFeLfa6EY/PGSmhZOouSDxFEudat\nFzXEzoOAipoFwHstoMiauH6UhrF04HoETtvdX/vvrjomYiGUtuD+7BF5tydo\nahfZQcO3EdlUg8G0j65KzDMMVCQrdkObGZviyiCs3EGxzhwJ8Gz5AxBFyGma\nEK/gT22kI5VIstILnMtRjQ16jieBvcqMOyUwB3fA9p3GBiigbsceem8TfHus\nHCItYOiA2ivFYeIu2fzVl4YzgjH7uADUCYKqRHR9imlg3/PoZm0QaWiTLzkb\nd/kNB3/UAtKKApGUTCQVanSVlHAHNY74rr+d7Tt/+WlPlcPLtE+JN1zcgYb7\n2NUzbZyHYhzG5wqUmaC3xedfFplQy4TPVZqJz+U2ERO1mRSlcbkTlTbtIwsY\nWzuO2MdssdcRvlcQwB7mge35Y3cPCWAn5pQnlsB7K5N2QGcTUIfTrrhyaIRM\nANtZhqAOS3To+U1hf585neoU4FPnpVegd4goSOGgEULD0tghyNWmWCruzV77\n+KtLhT4Ba8TOylaXDW4z9BtQk8UyGrrdGUFeRC4RKEqEn+5Phx8pLQBG0aC2\nwoQX3GIEUQiOn0AEnzuBxy6OfqSGXxgHrm5zWhPbxFaSr+cVkd0Js1QmSqmh\njuMX\r\n=+okL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxahW0vwuVuAtcLTvnn+cs9UNQBBOAO5CYm0/bvVUo2QIgXsGwhvuz1BGWCZ40Yp35hmde0uLcO9BkwiJDCuMBYf0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-dev-start.20190905134812_1567691559441_0.22777521475443052"},"_hasShrinkwrap":false},"1.6.3-master.20190905142108":{"name":"@atomist/automation-client","version":"1.6.3-master.20190905142108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2743b097629f06604821db39aecc590eb41c2c8c","_id":"@atomist/automation-client@1.6.3-master.20190905142108","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-RSVXBs3IbJ53p1CDZTpdI8DClYeyET7phYRje2nfOeKgHUMVfapt58c3ygBmAbZRKXgSnxH1NwAVLABMBhz1Rw==","shasum":"320af00074745242a17dc157a151da41c7bbc704","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190905142108.tgz","fileCount":833,"unpackedSize":3177559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcRsJCRA9TVsSAnZWagAAHAkP/13W8eUIxOvbaZ9Qywkk\ngvgg3vz+UJEGshXre2FcvZHkaD0LCp2UxvzTuOPyFSdqQXYxjX8QtV/4VWB5\n3G7XpzyxVlA13KaMajz2ReH4aYpMfjPda6O5oLRM+irRFEQMOy7kV5cgTdo9\n2CgZUnux3uA/vDX0tjIcyQGa+2U1XJRU5fYarpy+w6gxUwvpQuXt9naDATIs\nwL0l0V6VQLUqun+u6gNztRxwLcu9dMFk4k0E7TsqXDTWV7cxuNrBF4kFqWX9\nu2f4adHFU4wMzRq0XqrNBMEC3EkuR08/18FTMNaG9nPvCTBuSRPZU8lsdAn3\n+x+z2YfQXg2OIheaIK/ZATGxg2zHY2yiG/4AHAfMJJHHhB6uW9cCdYrrZGh9\nP0k+89M0NEqUzvx6r1/COSYDjXVPzcUR6Lj8xcFKjxS3HBVV4vb/jLHfl7s7\n5EVdVKIX+ydVcyZL91GHzYlHnsrFaN7n8PEDVs6clu2TnpU3x7ujIL5pCGni\nggJU7mTxtVuPFy4OAaE3MS13iKcSkUQSPL/IADIbvSoxPJC6mTVYiqitwWkj\nyb4I5vZzJgUHKhUbWlBhVB/Siph/aO3zEORsVP+3G4KS1vFpKwLZCX8/SSls\nn78VleFOCxkpeomwR5BXDSZR+L3TUgSqosSwuKInBQSkh3bglxUGkUQASVFZ\nzpKe\r\n=y7q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCa4CIYKYCwVrMzODgBTKCyCnl4sKnLvAEE9+WWZ69hhAIhAIhZR72LnGtAbuUkIB9mF38pDvor28IyRvtVrAaAOlQv"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190905142108_1567693576762_0.7145157844959833"},"_hasShrinkwrap":false},"1.6.3-master.20190905142444":{"name":"@atomist/automation-client","version":"1.6.3-master.20190905142444","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2743b097629f06604821db39aecc590eb41c2c8c","_id":"@atomist/automation-client@1.6.3-master.20190905142444","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-WILo6m5rmG6dEpWTJknfHArRpKchQn/+/Ka3HMSTOXOnxTUPk0637w8IWmTHSmLbjTZVbVlknqpXQn9CM6+Gog==","shasum":"7c309fcfc118113242a68fc8c1d6e6b4903e999a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190905142444.tgz","fileCount":833,"unpackedSize":3177559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcRv2CRA9TVsSAnZWagAA138P/0R4H3WBYNGEirgi+FXn\nngaHynUJ/DeW012neE0tMNkzj6lGT/r4vZR5cn8LAnUY/XcJ4q7y+2KGtRDf\nnUnl6NCRlvt2c/Ee/slR1UEiJiZBN8ZGZm/DwLM59aUY7MfZHHicgL5UohLN\n2VupVyl7bTKh5q3HC90EN17eNCU4bWciUWLY3lB8chV5j0KCevd0PgkenezU\nkPp3ABlZOj4m15WqgKHhBx2xTRicDHLShEBwBjoo0UmFQP7aJ8O9CqyXaz3P\ni3lyIGIe2quIddVZGz4NRG/SnWwi4N85NbkEvxAsJhZr1Eh+YnYYSva6/XR3\nJXpBFPLzFWWmvC6NsG4dV69yZyxENpeDUgBBqXwqPWBIK1XLLBIUex1jIq/L\nbn6r0gyKoPnEfx+6yu9GwO9tZ59LgQT+gCUT7cZRpik/GdHEvwgV1G/2nN0U\nS60sSXef23rhCTefG/yX3S2uub2/BTOAqQWisla2PERipbXUSiDZ10lz0NWe\nFm11RRCZ/CPkmP5mrjUYgJvoEjlKcUyhnsRsMrdrhQArR+dj0+O/mBcWV6mH\n8OtLPJWMEOHripa8qCe+hk9mdzrP6ZFx2GhwgiHwQsUoZkyFz5qtPPtRAzRY\n0MSJ/IBOnY1THaiR1yAJ8FR0bJk18vNJ/yHlMXT+HSjKjKmyS+230ZU7A9Ug\niJ5g\r\n=k35E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvU3g8WSk67DUcNdnwOZ0J8VLTMPmoukBsAOexMy4h5AIgIyam72Den4ekOa/G7jnty3yDkv/DS4bCsCzTETwNGQI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190905142444_1567693813767_0.1760484795221955"},"_hasShrinkwrap":false},"1.6.3-master.20190905172037":{"name":"@atomist/automation-client","version":"1.6.3-master.20190905172037","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b12913bb59dac7f07b7dd9460a026930e3e8506b","_id":"@atomist/automation-client@1.6.3-master.20190905172037","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-r8ny3fnV9X5X0RCkp6pEBHi8NW7kIhyVEl/oV7KsG/yUbsCPR6QeHP6rA68MoSxgV5hejyVmkotGyqdX/bn6uQ==","shasum":"fff27317d1c89e0649da67e7fa53bf161489af5e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.6.3-master.20190905172037.tgz","fileCount":833,"unpackedSize":3177877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcUU8CRA9TVsSAnZWagAA4v4QAKC6JdVfTK3OZjlqD9ut\nfthHSZvmEgDGfPNh+SQHyP2miNK3e3SmY4bgQ/Ruvc9g7LnCLMMqfe4mac/w\nYE18eOOTNaapsRxbYlNT5WavT1nlx0SwYtEb6Ewayq6C1euHHyRzEudrUuYE\nrfow6eMZTM1uK9LVh+YJ3JHyYFF7aPjmoLdv79Z1mnnvF0KVF9P5mGro6bIB\na5zAaMiy+qqW2l7WIXmyOMxA1pBQRxAeRS2ipC/ovP7yadR5bsogIpfNJ8Eh\nKt8Vkw4wE20h4LF0dbwrp+9kRlfDrnhwJKKSaQFTB8PgJ8nY78W5RtR/K6P4\nB4gYvKa1fpEAn7fr48F9JtN0l93TIJ8sZWky0my0GqUlhAjph4sja4Mjz4Wi\nB2V0s0golDe3x8ojed0VnOO9Qfy0D5BwBjinS2m+mGE1Vvr2WFClbJkpYWKO\ncBqFxOnoNEZIrQFbQ2t9vWuq1+DBgQt9OPo2vQhO7u6f/QPRNcZxmh09v1ay\nfqm3a4DAQ3IFPdR0pbtamO7UYwyTFCJzccejO/ifNK1/paL5uIVzmHdQMaDO\n8MFAkRmb6LozC0Dfz/BMO/CxKxI2lqlR5j6dRorEUnC+/HhsPGXtupZm0LHT\nV6Dd4n9/figqp5TeDkMlIdpCeno5cpd/y5zciO5IB4J+QZiqywP628/gGqNC\n/xQV\r\n=mc8S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ5ase3eBn1TQMGhK4ZO7YvZy70tJ8WGjgthYgnfb1lQIgOtZ/7DlEyFrC2M55TyxcBPhIPDGIYLMnBjk3WaiUzLw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.6.3-master.20190905172037_1567704379419_0.9678893303676752"},"_hasShrinkwrap":false},"1.7.0-master.20190906123829":{"name":"@atomist/automation-client","version":"1.7.0-master.20190906123829","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"51ca4f08bab3f13cc1e0bfd869d6ecde650b4793","_id":"@atomist/automation-client@1.7.0-master.20190906123829","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6rVIWnTWl7FsNJIrBlBXOrSx0olVjEk+fUeGdrwjiNP+RVLGx7KOJt1gSyiRZMNrNjPNTP39YdFwr5YnrR+xbA==","shasum":"ee06bd0d2b82e85bd763782b587304f0905ae839","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0-master.20190906123829.tgz","fileCount":833,"unpackedSize":3177877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdclVgCRA9TVsSAnZWagAAoZQP/AxMdu9UuCWEfc3LTyIs\njdu0USk2rehBNmG9EOcdHPcV65TwtECF2QFC4sQZvw+PHjrgMkXaOMJnUeI3\n+WcyYc8o8RDoHfgiN35RRr+kzWyKu33Lx1OfwJBIHZtPPNVebsYSAaONlF0U\nyQzlT2hsMjsMR4Z6eYBdfpPLkX8ohZHAZAu5yNsv8dpg4eJOyl4ucS46NLu0\nJFdlDj4zUpY5mehNP04bQavTPlTLSuElKBLLOr4yDjl3GHpnoE54t5bohxfk\nbZmW64G1sM0ybIqGttD+4BO58+TQylCIkal+UesTVFKCP1LSlEWc6dv/TmIA\nTvCkRQDqhCq9VwrDSV2GTjoozqEWWqINEVwVrEdRkYl0C7fQUdoRj/zZdcKS\nYjKSy4r+Jwpl3t6Qc0dzvbquPyLRKfSD1/HfQaPeYewRt7xLHdMDmR81czB4\ngQAac3HYTK+aVL6ycuwMxJRgdXBd4mVq/Qk9dmMcxVChGYIQG2e8Xd/tDozO\npbHuh7cGeTqldnvUMbXQZEt2qqtCcLEbWh/dUDN1nrW52LQoi5b63z3OHCcz\n1+f0oK0AEPxlFt3SdcDhfoUXF2R0sN9gplnJaTM3LusFWrUvw4eaH+kG4Ao2\ngl8vJPo4zXo1B6P3fh2n7uV8u0CJ81KlaMi2rLdvlhq9KKrHJVimlWeOW8Id\n0eQM\r\n=I756\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSt/zRuuP/R3MsdVFZEGNBYXHjZ9l/TsEjRNJXVX6yTQIhALjqKgSGNc1+/8eHr3J4adcPbRyMduAKhf9PjzVtYJEZ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0-master.20190906123829_1567774047382_0.6546963167800635"},"_hasShrinkwrap":false},"1.7.0-master.20190906130604":{"name":"@atomist/automation-client","version":"1.7.0-master.20190906130604","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"16b438fc42a4092f4e08a58f50d486a232f8ca1e","_id":"@atomist/automation-client@1.7.0-master.20190906130604","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-MYM50moRdJHZfFTUsURPffKIZDjDnqoKwU0/HNSgB+/fH//nUKr9GfkiPpezvU38C6bsqD3ss1t1I60yBnZtxw==","shasum":"3aa67f177fe539540130c9ba7f533c2cbeb88258","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0-master.20190906130604.tgz","fileCount":833,"unpackedSize":3177957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdclq5CRA9TVsSAnZWagAA5kYP/1CchHpPf2QY0NYU9rFE\n8nnp3vaW4HiLhGEoPaKSw3VI77UitnzBFkdtsDOiyWyrrl3N3ks5pFn/3Nbi\nX6l+TdghhGfzk5kyyVEBMKgYLWnqB7Y87qE5MDMe8/6MvcAPayutsLvHCoWm\nfq7qKh1EG0y1Qn0IM5mohufq+oedIiN+8Z2UCcJ6B25jAlQGLDRoh0tofuJ1\nsdcPg5pgOTya5RqAqCTVcezUWmygsH922eSbWGcBJX/44FjMh0FsNpEc7wTu\nEFy5B3a1g+hqp/SZBrvTMagOPdGkFD9papd1YvHe61jQgDMWwS1f2cYuY/ee\ng5rv2wfr5Ot6rSFaZwd1QyhNiXz1AGTast7ACFHGSwC7ApNrQe16A5s6xzLH\nM69KBKxnougJwtTvi1FhPrn9eJ+1ltI/PYO/MuJF7lgTDZWGOxifrh2CTipM\n/QluVsJCPMNne5xCDKgI5tVQa2JJrhsHSYgRB6HT8NWQEwf7nfWZelZLpvxV\nKAOnED4klkNad50aLnS79ETWAKRfZKRVHgjlGeSO2RjzJhrUpUhYQdmPMwXm\nVeiGjhvEDzjqAmx3JUQop7+/JYmTIQ7DPXzXXPhTdrIyOY9f60zwZ10NbZzt\nYl0GrsTOJCu0XKZXdY4mWWT3TxWaEdwkTA37gcZykMgASJXAR0Rcabg8SPTq\nUpmm\r\n=ojm9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3iwCOYpj4jlp4LOjS5GuLTAwmWnf3XAH+Qu+SGNqGdwIgSm1m87qzkHyN2YhzgWLWeertz8BK5MGqqCliatv/tBQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0-master.20190906130604_1567775417065_0.9191935812708252"},"_hasShrinkwrap":false},"1.7.0-master.20190906141311":{"name":"@atomist/automation-client","version":"1.7.0-master.20190906141311","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d7c6b0bd8a7eab585e0f0e117d50b2ce34ea7193","_id":"@atomist/automation-client@1.7.0-master.20190906141311","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-2rGuw1bCrvfAplQk339vDBwnRCCQkIB87LQ/hcbYDAwRAgETUZ63KpKBDr86JEU+yzQz3+/s55L+kmMuvqM8ng==","shasum":"2fcc4ef7dc8dc713bf36387bf20362ee8f942edc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0-master.20190906141311.tgz","fileCount":833,"unpackedSize":3178322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcmqsCRA9TVsSAnZWagAA6HMP/07cuioWnJn4a9wylS4x\nfMBqx/pxwzPiWAt43JLJXClRxFwKwsu8uyCEUxr4cD2MfZCsID4tx6yo6RtS\nyjJGzVQW5sdz5Xo9TV5yob27ylMd/OP1SwKOsH9tWYbduoRDm6SfoR4brnhj\nivWjN2aoOZ7LrFqUcOZJmB3APCX3IZZi8P7JsI412+gh8ObptqEgYPT9hWqp\nExMh+iZix86vVSHqWEqTaKR3KUifMwlcinOruO+klfOtjOaG5uEzPshBZKIZ\nEuQR3c/l0iNZDwKAC1p37aKnh+2ziHapyMUFSggKiskmBpK1Z4eJSeqcFb4F\nmS1gbkXG+1Xdjd6WTJQd3sulXcXFSO/rBdzht1N4alQzzeW3P2vTRe0aaI34\n6y6ruFupeZWkBrQKafeG/ztNahttRqZzxx0FiOcWojYo5L9ayvtQY3+V/Ohc\n/Lt+mECNQyEvHE5YEQcE0VFT4VnNolfaAiWXi81UJqWfAN/1IGkecGH1ft87\n2gdZn9aPrqqiMvozjUPS8rPeS+lrOz7WYgibQbuUvWlGN4cP/UDH9odq64MN\n9trTBMSxXfrlqLkivTtFiSqqHVVlJqS7lTcxCpAtPgpclY8k3+Qud95kfkXO\nkDSnNDBbrsUgshie5AkZdJMYYU4bWVm/I33UEyQdX1SQlZQvlny0WDU7io9o\nCsES\r\n=jQ9J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDP5IHiTvnQRUcaYeWyhBqKM3er7pr7XQ4wq1qmIo+P2AiAJD9Kkq0Lrjm2ij71SVfVHhanM9+jxEnJQoOIZ2oS++w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0-master.20190906141311_1567779499398_0.4832646323932568"},"_hasShrinkwrap":false},"1.7.0-master.20190907124351":{"name":"@atomist/automation-client","version":"1.7.0-master.20190907124351","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a4fa0988632f65056a19ae0cb723dd71a73cd455","_id":"@atomist/automation-client@1.7.0-master.20190907124351","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-9BzMN4PNF2HWIIWfJJDJeSPhE3JJ58APlQs4Iz+quH3Womm610abT5cOt7QtJoi5iiDgpgDJDC+nnth6ARWbmw==","shasum":"ac0732f120fe123bd894b616a2a53dcc5499953f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0-master.20190907124351.tgz","fileCount":833,"unpackedSize":3178318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdc6c2CRA9TVsSAnZWagAAk0IP/1OQ+VThMuf0Hx0Nneg5\nDldFEEbzeqZryr5kfwa6JHnnNzWo4N9HJuMZws8G0NgMzFwu0Fn/+02spi72\n27csNR1rKoScjPABnWB0BFqidN9EyJm6lN59+mjsrml8wrYzervgXV1VAA5Z\nfH7+nLvB9fJp/KEOvvAguC3VKCNfu4NobMFNFtLsacrHBv9UhlnHqiirtM8Q\n4zZc982v+6sYrwjdbctHByypXtscRN5ormNdCGVh9Y6sKnT4Z/JurTIdxTtF\nar44ZvjSx1skLPeyV6F/R9fnmc8XmgEEX94MH5AGhSPelBihSNclQKlnGBA7\n2LNlbh5LhhapOlTB/Rd4v8RHX6PFSaRwSNWJLU7rvTNUtaZQPOdEAiPdronH\nU1ivTvVuL8bskVhCJH36RQcWkB+S77NI//jzL0debJGUoAM7kELAJd/PDfF5\nO00y9WHlQTX9ly3EDGyt3BKB899Oe0lY1eXKO5ELOPMqH8dQIDO1HIZMC1MH\nP9ZRUW6A/bydRUb671Mp9wIZnGb5QKe0BndZQRVUK8vFGGLMJ/nVPgO5T2zr\ntxuWGfAonDhThD5zOcs9KGovZLo3OXwhM1HJZ4zh4H/gEwduk9bRffDJjNP1\n/KoVevF+HybW9lHw3qFS2wnpiVvl2XODx16Df6FxI64EHQ5/ej8Yb2PhNq8b\niTIi\r\n=dIUx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHYKLrEqskkqnZeb8vEEVmKjgU9Gyhylu60BDEKLdOJNAiAhtS7kbnQIeG2VzJh31H2DT3of2ZDamsdxu+JuqPunPg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0-master.20190907124351_1567860533460_0.22594949561959976"},"_hasShrinkwrap":false},"1.7.0-master.20190909084408":{"name":"@atomist/automation-client","version":"1.7.0-master.20190909084408","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9f18d79c7c2e0a9463ec2eabf0d68045c87cf93a","_id":"@atomist/automation-client@1.7.0-master.20190909084408","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-pBG578NA22LJEeMtenmBcDR1g5iWfhPyZ1eW0krC3sp2toOJN5jHGmLB4udQLyNgsHQKkIWIIo4hCj4tX8f7kQ==","shasum":"1d8b78e9339d8a2aa975f9268d1338c5ce231f77","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0-master.20190909084408.tgz","fileCount":833,"unpackedSize":3178508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJddhHuCRA9TVsSAnZWagAAwzMQAI9gB9xDTWyAvcu1T514\nXkGyNe1TF863r2cJup3YHccRjFBOYCMB6uwELw4S1LGRJCHEWD07xaF05Kl5\n+u/+M66Wy02OuiyanA2yFA5SycEB9s3dqqWZFWCOfT4yaa375nQfSjI+NhnT\nVXmQga3JYT2Z+TvpJCENFiqHxK2gGa3YEJZOABOORcfjxROGvZukV8C/VGq1\nekEG2R/C7VE+Y74vrRxyMtppv2k5WgudMU3hP86wzYEYr+PTquXwcJHan70X\ne5M2Lsq9r3MaxtaEoWZNVEc1b/bn1t3zydeeSJXY6aPIh/5fgAU0bidlUgFe\n3QOJVSN+pXCP3fZ2kKHzRtnvjg2YhOr3/xLjgm2AS2GJSH4PhpDyuJiBAChi\nJHerQnXY45b6L2ngwRkS2AiDM86e2RYXNOGITwlUMwQ2ahT2pGlMuR8z091T\ne2B5bmkgNE/6Zan5f8ACKXyyPxmjNvboTwX/xSImQuMepjVZq04yJGSK7m5l\na22QIQOdYLaAwOGVfbcAu2otAlq0NSh4a4YjaKu+9vdveeJ6TqJYNF9dpNTQ\nWlJNKiIM+aU4bIUphtfMSWvfj0T/LwT9SwS+PtcvqSEJGUnjPoIy12N8RDUv\nMioekIJBaagXEOAXbmZjtviWFHr+WkFBzcW9ijWJXcDoRM1Z0Lwes0v2ChbL\nXLli\r\n=+iGM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMfJYG6/0ut6lFCpZ/tqRWw38HuoU7WeSWxMPaQybxgAiAy+mFZtCZw/i6Jfpw1J5cdNfP0fjeZNh8vhtk1MJpW4Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0-master.20190909084408_1568018926000_0.07316269479314652"},"_hasShrinkwrap":false},"1.7.0":{"name":"@atomist/automation-client","version":"1.7.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"8eaf062fca240e5980fc029e03bed7e4587537e4","_id":"@atomist/automation-client@1.7.0","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-54XTm8m01T2Rg0CuliLs/pguqKR8h91K3ZC3vWnyIK3GYUSlkGBrThL9vFaHp0spEABvlPy265+dwFLJnDc6CQ==","shasum":"223aa5b25dca013cfc217ab624597d14769eb5a8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.0.tgz","fileCount":833,"unpackedSize":3178486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJddnz4CRA9TVsSAnZWagAAincP/25RZ5DgShPfXkDO/vRQ\nd8etoFZF+F3ARFEL6MIdFWCfUVe6e5+hngvYCYpk+rizviIXOgqJSV5vmejI\n6Rq4F5ykH3nrNCPblf3ytNwhvAwvYLmA4iZR+Cv50kS5r6Rv3QIfVP9l8UKK\nB0h0XmREr+ZDse0iSv7s/aKOUEYOElVWjMx4q0mQ7GCyefKDjkMQFgO9uWmE\ncSYho1OjislQyGyIGwfcCbaVDSwT6gW8D/+5zib3wk/TA1GPPIXGJ7fsyYTs\nM2TnIpC5YMRzOLapZsca7yO8PMOsmLTVi/vLtzLKEOZUwIb3SLJuyzH4bFqY\nGs7I7V8XvWTOZUllKBo85HzMWm8izIh56WyDwcKXTDq8MK9wZovZ4Zjgs+aN\nFTuD7xXhdZ8esDwnh205OceXLX3Vhy/Sxo1fKH5t8kvWPTd9uCq8MKDb/giQ\nkIn/R0K8HOYUas3Ajci82mETTOLaR/rfC2bf8hS9pZTijrADClHyhGSOuSUB\n3XgEMpDl2QOTYRUEqp0z6khjXquRyx8q8HsUwjM/MBvqmIiJKEt8eHm/Y+gK\nAQfv/McnXlbNYj3a4g8+bHmC4HYiQPUKo5siOMEF0NgmKLFhwgiyh49su7W7\n5XOIVR0SY6Y+3gSRgb9UptqTqbpikC6Rc/s1n6vHRJ34toekglVwCbJOwZ+l\nQgFY\r\n=hvNt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID9fFun+2ZbdvVLgAP73T3a7liH4q1xJEkOAB3Y5pVZYAiAqUyoJGthoillCQEQttxJ2AFQ4fzf06IiG/YxodbQGQg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.0_1568046327983_0.9224980585499498"},"_hasShrinkwrap":false},"1.7.1-less-verbose.20190915004949":{"name":"@atomist/automation-client","version":"1.7.1-less-verbose.20190915004949","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d1e1b852a03584f3d6c56ca380ed44b49252d3a9","_id":"@atomist/automation-client@1.7.1-less-verbose.20190915004949","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-z5o+4vAS4Ub/+cBliE8b24EP2VWmc5DUSbg9r6Y5ORzQeTxlWrfT/DodWmYZu090dOGLh2aRsmVTH34+X4+mKw==","shasum":"f4253da8981663111b647986b803db44047609cf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-less-verbose.20190915004949.tgz","fileCount":833,"unpackedSize":3178626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfYvWCRA9TVsSAnZWagAAf2cQAIOAg11DYUy9AiXDSxLP\naNnO/bSO1NPYzfoxDD3MxscU2oweMLhcPKvo5y3pjg0yX+8xaX+0vnJBAivn\nykRjucZuRD1d/C64Ou/ivlSzLirDDzRAsRNeKLTjqeFKV4gOxNFS18Q3ZXvF\nvptlaFJmZGi46S/OcYdFIWQeC/sJ6/GXwhfl3Lc6/AbSqPASHO2kC6CqZOzO\nHB5OfC3WM2Frdg0fD8aOb4xt5Sp/76d9a6ETBdOtsWLz2oP3ddIlyWOUhFSV\nPHxt+mk8Fmcn92arEFtpImjwf6MPk+vnFs7bIavjPbSCboxuvw41XBFTnQ38\nmtPsgX1NosbAIlmMAKl+KmkL0Uuuk1xInNZ8ALvcO+qA39hfQSqO28RBeS51\nMGip73QTpOFPhLy0zPdCRpH5FD+ptMih5+irGfZFemUsxcGXc3LhI4mKcuRg\n5R8JC3AfcP2p1mGWCQ9f+ozwc1FRMzyAKpzlcV6eD0Zw2vQJSU+NLREPsXMq\n2F+Kv9wMSeOu+CcJDFBnR9sBOJUlt64BDPthNgB3j4RTkW9a2nwyyGmWIRX8\nZtAV3ru/u6/GaLDvn+ceGSmJEECb8LjIyufe3Iw63X2m6sYDDEdWw/gHSxh7\nIsHa7AfwfAoheuB/5INqN8jawNyc7LjEAV9vc5znRuOQ6rVf0p4yi6NMlZuu\npKAy\r\n=z8e/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9cNKYbmX0vssT/4YjaFeCDczgvnTpSLxY6gU/+6gI7AiEA+hol0Ek4nNo00wF8QOUNdTPEGFI3qS9AALKq5vweNQE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-less-verbose.20190915004949_1568508885484_0.6036691691731646"},"_hasShrinkwrap":false},"1.7.1-master.20190916030926":{"name":"@atomist/automation-client","version":"1.7.1-master.20190916030926","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3cca505dd5beee852e4d5a21e62e6518a9401089","_id":"@atomist/automation-client@1.7.1-master.20190916030926","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-QMiIMj0ftqDYdaJ7bHin4+Cx8Ymh9hgHe1TD+m291DGRIpkHbg+SZsne2sczehSTaTTi0yy/MK2QdsL8nOx3JA==","shasum":"12c30e3b49f0b01d4085837b868f5fd7cbbafb12","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-master.20190916030926.tgz","fileCount":833,"unpackedSize":3178604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfv4aCRA9TVsSAnZWagAAYjQP/AqoFLP4hfCjHwg9YUc0\nvgcCEkviDOS7PHa8pOUzxSfdK6dLBGqAkkci5KRLf5PmfgWKumX6QRqjAAQC\n5l8zW464RAvuR4zM7iBkOVAsWOd3zLcGVX/2+j6UREFvqR0tbDOl+snRk9QQ\nJYhPHL6LRuyxQrasTN5Ad6CMxaBajQlb5MXqQTK9nKe1T4uD01Bub/Qh7ORP\nyl0jqDT1DqYRa1P0aR1Mai6XsX4NORe6GIdhkFSYQAxWQW8IheFq3aIJ5tiQ\nQUzi+tdEMHDIIPmK+SJhM0NujkCaMmJThVPIEMsRkOcAffg0mZNjFpETRdfl\n8QtRpov1hXe8mS0ZWXx2JE3ghJyvecYieD13DLNR+zGszhUzEIf3STKNx0gp\nC0U5l8i3ERUQFTUL4uSBPudiD9/dLoU3FVBdDfZBnUWzp0Ngo8FhkzRrovA8\nyNtHHsQ7OQGnH0n5aDYlYrgy2oP1y7yrsZWRMNC8qKDua1EzgMC0196Mit30\ntspv2Bf9ljWJqBg0JuowXrBTGcj07IuN6VeTiyKocxNMHgZteRmBqCzXxGXQ\nqVOouc3Q++lD96Iv+irY5kQKy7UxfBRLnd40kCXVv4ZetIg35dFY0bGGzs4d\nfYzK3j/8ismV3VsLSpIQ+rYZ4MWRC990GvqTNG74q/1PLPetOjj8C2CVlwfE\nf+ok\r\n=lMMi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmZozEVE6JZqcs+zOostrCxR5gta1+JCPaaLmj8z2lKwIgfv3kUQBJauGrcO1gO8fLE3/ZiI0vmtYuykbeuQQnFqc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-master.20190916030926_1568603674181_0.9022814583578849"},"_hasShrinkwrap":false},"1.7.1-nortissej.flexible-gql-gen.20190918220049":{"name":"@atomist/automation-client","version":"1.7.1-nortissej.flexible-gql-gen.20190918220049","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","@types/yargs":"^13.0.2","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2","yargs":"^14.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c6dca6f4b09db35566b8649b7119e6db3bc517b8","_id":"@atomist/automation-client@1.7.1-nortissej.flexible-gql-gen.20190918220049","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-A6OthNMW8Dd4xHA+tGqXGRhsoY8ROj9M+GQi0CmOgDwfepwXJvPrV+eMOWL4qxNmYhVhhz/WmGQrDJoK3+VHJA==","shasum":"8ba9ea3980608e38ebfe0c0893d5eafa1b777eeb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-nortissej.flexible-gql-gen.20190918220049.tgz","fileCount":833,"unpackedSize":3179259,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgqpOCRA9TVsSAnZWagAAdUUP/2FOkYt2K9PpNEIkEZwr\nboZCIWp66G8WTKrzI23ceTZunpg/zTpAoNDQA1VeVd4baZM1r0ziLDW1d+0Z\nu9uzF6M2T/lOn8ihTK0/znfOan2SK2G1jE/N4NKaIwuxAjOLN9z6zBvSQo3C\nZzZTWwn63pbSGC1IzaRPVWJaaW+eVk0T4dJQ9buhphSBnyH5D6gAdhWj00RF\ntckNzzLSthKOoFBrTYSB9kD3F7uWo8jIUF9KdD4UtKak6Ym9WjL6TiUfSZRi\ncl9gqOHupO0B1uoOOiamVAZ7V8jDtpK40Cv/Svdrvmie1sSB+OJLecGNGMCK\nya3sLLMWiAfbE7uP3KCE/8i5oA/e07H7Hj3ycae2Wf/LLBrelK3IrapwJbtB\niWKVxO9YN33dTsEY6h1/3+KEk2yFWiwfT1l0qdRQnwC0QC+rNHvglienBlQO\nlltXxOffGfI3MbvI/vhkocKlZohYyBM9XHvdlLz9QZPj+F44ckjs+mkPA3Yf\naJRyQ8UgZc2rh3Se6ulV3rfNp+CaMKReFwvo8L08rMoBFPOapjgLM3a9AINO\n1eeBn7jS3eFa92C3X//pkFCwu50MBcnDPNsdK6sU0maCLEdcujE7vBMp/94G\nPCJMVcenqut3AES6OnXdrTFAWA/83mb3J23qJ2M4DNUlcKld13QPsAhq7USy\n7FUX\r\n=fvX+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVYIadRcHa1+n+HruM1gP5qmUywuSRv77B4W/8ZGm1igIhAJQn4mIBEAWkBIjAJWtxyFnweCd/scVF31WXWaHaNAeM"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-nortissej.flexible-gql-gen.20190918220049_1568844365758_0.5243151069087619"},"_hasShrinkwrap":false},"1.7.1-nortissej.flexible-gql-gen.20190919003945":{"name":"@atomist/automation-client","version":"1.7.1-nortissej.flexible-gql-gen.20190919003945","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","@types/yargs":"^13.0.2","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2","yargs":"^14.0.0"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"632d55c498bf38ae27aa9114828e9a3411db4b4b","_id":"@atomist/automation-client@1.7.1-nortissej.flexible-gql-gen.20190919003945","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-/J4mMmbQ3jn8LNJoqOJfqp7mjjLx8mLmx2zCCe3vNSvRhFNuzXGfPyU50+RvuU47LB35ulv9pSPUQ0PZzT6saQ==","shasum":"5818000c45b7a6492e994d4990c65754dfcc153f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-nortissej.flexible-gql-gen.20190919003945.tgz","fileCount":833,"unpackedSize":3179170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgs9aCRA9TVsSAnZWagAAWRgQAKEpnmrozmfXZ8VWvnzY\nzttRs6LvkcVevG+vWLXJsOOCXznLCsjQe7coK+YG+IAqUeFNB0bFPc3thCGQ\nrrqlDKb5K64ERcqKLNbSMNMwEw+M2EFOGztY6r36ZE3EdS41zjTybx7seYl1\nNNEN9EyarZTz1enfHXZaWvpjBUcALyk4CMCKYevZE7kqAbi43pu/cUTyNffy\nrJ3BGkZ0+S9xHx8QB3e+55eB3bcuDIV+hVO4zL5EItHuldOOkfEBCY6NmpCA\nYwuHfrwzRcQT2/PfuYuKugeD0E0hvR/ArFJoLSLPxG3WfEepl3oqDclVQLNG\nGHU3E7fnrq8wC0CgohXN1xF/7V8kLJOVqKXvLtjnE9UVDbA2OWYvr9zP4txV\nd1l/q9Td0rl+HWu3dX/TIz8EIK6IDP6+rZT4uiZYwJb5H9vq9BXH9ecDjvSK\nV2YCkdetPYLYKJrYFt9P6aPsjjBRtgrBO5RNHAs7Mp8JtCOr3tujmHSOGOp4\nzXdmnSfrRAXovniFqosVh0BUzJ4PS9aUuEOL1CgKEF5NtcDc4aJ52aAnTZMH\n+83e1cJZTX30SMwJxMnUIfLJKkXRvXlsohdLW9GUpmgtLrOEiA8YtxMd3x2D\nM/kO5kYKkAwl0XbmCosFtd3P8OMJOWylgaZUbjWb2uhoLlPiD4ezQagi8d4c\nQ3q8\r\n=kkAM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMPToSN4uCEabMD7nUbBQKfGkO2Da1eUONIycWkxYelAiAjWM+9qLtLPDqQMUvmWmhrMqJnR0irzIxKBetxkyGDFA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-nortissej.flexible-gql-gen.20190919003945_1568853849676_0.05906871595148555"},"_hasShrinkwrap":false},"1.7.1-master.20190920174359":{"name":"@atomist/automation-client","version":"1.7.1-master.20190920174359","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7a10778cf8d867e5573174691ca3991e25a50353","_id":"@atomist/automation-client@1.7.1-master.20190920174359","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ewvn6yWm5FBRwFilMUvJLnJ4kftXaBklOOKwqd+2Jd+byKPHcYO2TlEYXfzN4R8E9VZmdMKqo49I3CoMRc1sEA==","shasum":"6ad3621a6ec904eebd25726c7356d5b3ca197a54","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-master.20190920174359.tgz","fileCount":832,"unpackedSize":3190712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhRDCCRA9TVsSAnZWagAAiawQAIX1rz5VYgROvInXeJEI\nsgQ7/YeCJ482qfjh5odT78AjXQUTQebRGYB5Mi+0ORjf/qMzOAw78w2S6H7O\nFgpNsi6LnARJXIj71UJNrRvUwkfLKY4ExMwo+xziLGi2DbwjkAwsjkI7tazT\nC5OZbyzfYsvhAT8vpKMcpkP3jNhdD7LX4lxOFLpa2wyThkPQLT61FDEkuK+O\nUp13UvUd1pKhRLAvNTbMURwbuzpFNnKJ6vWXqL95PHPVWZIM4W9Qh6A/Hetr\nGtWYum/raEZXPggBpf4lKyJ0x/iKNXxcc37qrPk12QeA41PrMoIZuUHOIP5S\nD+XqWDw3EDcVaO/4K9q4RPThT9dl3+HuTrutZlFBAcHAopinKc0cr3mCHLT8\nnAKlQ4tWab+Gig6AhJmbKo9G3FI4vw1NGtb9UPJ+873MJKGr2FzBr1NpSDZx\nUQ5/oUFJXw2BnT/rwLNQB7JD1H9jy0pBbLh+5X95abUqfE903MqYd1CwzSkn\nn4IbybM2q7Tu4wyZGVG7c6DS2aYe0q+G3Nksq34SQ60yITpoWxpgVMAe6lIL\n39MjhkgmmMwnkWRTKbRuDPAa4QPcKw3Jz79lTxoJrLwcPlEAFFHz6pP6eSjg\nb/+uzps9CqUpZ+Z4mti8cGiXpGPf1YMITgEY4H6ts3tp90zBln5fG5B5nvRu\nTADv\r\n=o8Xz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzttr8ZGhhT6fgL1AtfGQ5zESItA08jh+xjSywyciMoAiAooj/eJsZb1XcGZmBIaR3uwQ+qrUGzCMMCHIPSkXbMSg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-master.20190920174359_1569001665886_0.8195484958894235"},"_hasShrinkwrap":false},"1.7.1-master.20190920175552":{"name":"@atomist/automation-client","version":"1.7.1-master.20190920175552","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.0.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.14","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5d44a2cbbc93c3f531c66632509745953717ce29","_id":"@atomist/automation-client@1.7.1-master.20190920175552","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-LkrX11EqZJYIRpN/dsHMEhx0NcUBxgFXKxmZsbknbGyHeQXssRvi/iHGHFKWTeAB9PpKkx+M8fH1JJR/E/CZzA==","shasum":"2ea18d72356553139becbe2d9c216b68c0c24067","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-master.20190920175552.tgz","fileCount":1037,"unpackedSize":3891614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhROfCRA9TVsSAnZWagAAjUYP/248RkpeIuMX1DnewA4f\n3HLxm2UOBJulSFE+8yqIf0Yj4vAMJmhuCPQNURc1cnbs0CHBgXzs1mKiG45m\n0wzLOxsQzmZxg8+H58TxSYRunER4hZ6u2drOdgaKHok9ZmwBFMVA/PaQG6xc\nzLF56ORGioNTvulQKEQsTKVqa6cixlE9uAkB+HQvxp9vgIhVycT5IRvwNVqE\nQaasV2iAYhDOnTCDwL9lu4v53Y6fPpjo0CZvvskc7v5p5Fy7IjoOclqZFdzk\nOMS9B0qJKidACbOm93IjuD9ERmVyMNimamXl4orWYNoERmrlFmjqRo8zTWvb\nW/pW1NwvNFr0YEoX88acx+bx8kWzvQoqnwXfLpVZMNEGa5+bd3mg1hxbQTl5\nbs4JjdRhYQ42AeRmSfCw8Zd31CeVYxFR9beBoBjB97LZYss4UgSNha/VcodZ\nFAlbQe4lp1W7w7KNrrpohJO8T+vGbbXawPStJl4cNe/9DAfUB1V4F9NzEHi8\nPayV8iXiveuhY8t/H2HgilsFjd+cbZvp7bhXTv1kii+mqYJhUA4Ak6ywcXSF\n6Y5Ek83O2R+jcNn6MzAWyqauXRmrZZ12czWoGU/bxK9Xl4GWNuGZEuA/W/mG\nf8egWvr5oEiGMnOD4KHoJD7+FA8Pv844bjJOzGac5g/8tRBFSdHE4TOqDBC6\n3NTF\r\n=tvkc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBl/XdzDcXVM+36Fbw0C7sbM6Xj3G6i/MCO6KbIORRLRAiAqvwpJA0OG3W3fBKU1PohOPgS6r+1gRh5ZX8YeA7Pjkg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-master.20190920175552_1569002397796_0.9241836925926008"},"_hasShrinkwrap":false},"1.7.1-less-verbose.20190922191500":{"name":"@atomist/automation-client","version":"1.7.1-less-verbose.20190922191500","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"762d114e1adf3140166946ee2ebc08c749a86198","_id":"@atomist/automation-client@1.7.1-less-verbose.20190922191500","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-MWGeJV6KwBDqaaY2O6pWr08egK47uSSyYR01a3oc8jZzsrOD4S/3OHY9NXlf4gf2tnhSjuw+3shR+IVj+OvVeA==","shasum":"d4dde3cb10b9fb6f9aaf1e64f2954e563eaff4c9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-less-verbose.20190922191500.tgz","fileCount":1037,"unpackedSize":3893776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdh8jyCRA9TVsSAnZWagAAlxcQAJMOTFfEiwQUbunWkgAO\nAZi46dQQg4kTlEUYNL7mox/IpbLJARrzIkO9Jt/kfjJ+aDLpwDOBW5V0DND/\n0jRR4Z/zGGm2Ep+U0LQf97d9/sKi3l2MPko2wI+C8BkFlrBjWf2W3af/hpW5\nQSvqOQIPwbRs1z12EH7IX2/OYjIrbPyAvW3NdaCJqKl1kgY3plwLjDpvWtEu\nZJ3eJyfrYJagrfwlg2sTATRZqk73N+cOTM0cdRJbwvgIBY0i/vxR5aJCsTU1\nXnUk76MjtEvRo2MYUp89Xb893gZ9OpnSrbenVbK31cQh7ztewv8jLVRbpZHm\nE3RF7OPhuTMiQFfCuzv2ZaJwE/B7cohpGJv01PBtdjL43MwI1ohpM38oNFCu\nAMKs4FPR84MsCCoULuZM++yfIjCSKiFbv6Pqj+3jQlgsuFokDvt9qScvRUmZ\nSHLXf/Xwtw9sYnuREk3KkWxtw8IY6v1lEluXJmTmXBS5wW0jhk3ya3y+UKKq\naMsqxPtECV4pWzTilFsGiCvL6g2OZp1FXeTx9IIvpP6GZJX1S7G/Q9Z6VXhG\nZjVhLUzRsBN/DXvM5QsSvso0HCs6OqE+VnUkuAEq01Tl1ibXjpa7UNlLZwCE\nGu6V6fUhnxrCdJxpyKGWNArFVEQzcs6IB83YISsEz/AZZ1oPdkoHJx7tHIei\notnq\r\n=GERA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC73lVZ/96pviPUCv1tSZrq3/rxmK5Q5hhEZxvIHmkC3AiAQVuHNGWetN/aqQql55pHt2Y2uvpDAckAD3BtiFjmxzQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-less-verbose.20190922191500_1569179890135_0.22023385930816963"},"_hasShrinkwrap":false},"1.7.1-less-verbose.20190922223448":{"name":"@atomist/automation-client","version":"1.7.1-less-verbose.20190922223448","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"547ad8c29ee97fd9e9e392b7bb9f00391113b2fd","_id":"@atomist/automation-client@1.7.1-less-verbose.20190922223448","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-jjxv4E/3jhM2oRnFqxebbobNlIeWhuLwTKEQh7AIzOX/47OLJCkdt6LcHO9pWZadoknBw4/sbTZhIRRvPs7D1w==","shasum":"d221edfc54e7a529c5f1c8510a732ae8cf372cba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-less-verbose.20190922223448.tgz","fileCount":1037,"unpackedSize":3893776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdh/fgCRA9TVsSAnZWagAA0m4P/1S9M4lrvUvE5U8CdnED\nM94+mTtbPJnYc59PJuueyZnARQZcnmLxXr5gOPh3B+urJTavpEu4wG08i0f3\nVx017FgqWZThL1mrcXJyfO6RIFApLkjUGMEBGcXWQBvyiJvoBWwo4eVInpvV\nMWBiKsxeC0VBFyIlhDOODQyK+iI8TY0Cx36M1L/daEWAF56zlsyFzJagmZk5\nwmpCoMDf2lx+Ma+wBa+++5bN2hOk600ciDl5Vm2mohu0vEnqSKdRL/p4CYxo\nTqftA6Nhu0Zmi/4iTVOfxxgtWSXBeYsBfd25plNVYWYLgw3sjqzWvtuohk8E\nEkXC7a6TLcBvTXRX6JlZj6dwt8LGttANsJhVjR8bBK9Ny9i658MdHxr6Mhho\nkIHq33rQEZ6xGJQgDUVu0YeAW+7regm6l5x/Y/EvgaGg4bCTevJyIfOwXAGl\nC5KPmifSe7JI1WeYOZkJkSWqTR/qCuBcTjEC2GMFb0qr4V6roBSxp4vnz8OQ\nqEceEk8fZVFDPbrqvFaZMqXbbltJkjE21vCPQ0DKBJ1X4b5P3W8ERhKeT8zJ\nyVXV9V27XSxIb0yDr/hpig6L+9bpN19FOvaWb3iluXIDh8itOfGy5K5On8bE\nYNz/EVKAqJZkWVdvRVmSHxnQQAUQt9m/lRDDu+bR5+XdaZevCY2yKxPhy3qF\niyQv\r\n=V34C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdlLMhYJOMOLXjoyKxpoWtSFJR23V10u8Kw5dP02U77gIgTQBB1P2Y7k+EbqaL/QdkiaS2d6GiahJUiWOB5FC53Ow="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-less-verbose.20190922223448_1569191903253_0.21958781255391546"},"_hasShrinkwrap":false},"1.7.1-master.20190923001603":{"name":"@atomist/automation-client","version":"1.7.1-master.20190923001603","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"860a0cab14c7f6212fe838fcfcafef36d378bae3","_id":"@atomist/automation-client@1.7.1-master.20190923001603","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-RZQ+AcRcZv1tH33CQmF8VgP0uNsmHvlcpB6bPamR4tYQeZfMyaiUi3ENJsHaq5+xw5JfwXxo2mowdUqO9VMbPA==","shasum":"180379d767679634a74c7a8f22f189eb7deef65d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-master.20190923001603.tgz","fileCount":1037,"unpackedSize":3894070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiA+5CRA9TVsSAnZWagAAyIoP/R5pwC5mufbrXmHxwYTj\niSBHMuql71qzP8LVBIXDF0MaXB0hRpOpXWvWM9LzuW1mwrkmBVjZ96v5VImU\nYothUtJnUbmEwCyY7Dp9j4V16+cHY3TfsZT5yokMdJ8Lxe0+DrX8xsEpvZuq\ndS0ig6offr/5gS96G70xRKiMhp2k+WS3Z2JQlciG2Vx2bK3kjVDLmgpgtxJS\nKBDgh1M1qVSqGS/xvUb2kS7BngVNHu89naJ1FPzUNV8A4rajel53zexiumKh\n2VNZ0IW0t8dnc4RaaY13Povm7diw/v5GzZX8FSgJPK5a53G03IRwu4K12P5y\nK5o6voMbMo0KR+2GM5pxqlAseShG3BxyhfpdgnoJm9rO34uEzhp2QM1nRgjZ\nm0OddyQJTAJYmR2BV+m5YukxBkuE9TelyH3AN3RMh0YwP4Q8k63OxjPsjVao\nbKxQ2w3XllbDhFaq0hV9w1jilkBfBtb0S4SfjIHZ9c6ce0ZjX2u2sVtYa6hJ\n80ELTDAGzn7V8X+VpRzWkOQyaZY1dHViuBU8/KCrbQ1ZShTk0AXdlssB6nTB\n5JO8urJbehMcU3AiyXt/qqJ1mN3nh9IHXaUvKcPyMoBeOss9OvB2PnAkZiMn\nN6MiwNUYUPMjpVSLLcxT7rdQVkE9HES+a8orbgo6fKnsP0lCsbVDu0AqriN5\nxJEc\r\n=UAxb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAs2jq5c/6TJEmvR1ah3oOJhrjjkmbfXBC67kEPM6iLPAiEAiaclVGhRgIOTXxlHebsVOOKugG9/GpuqLuOLf1Ovxmg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-master.20190923001603_1569198009005_0.8605891511745396"},"_hasShrinkwrap":false},"1.7.1-master.20190923001835":{"name":"@atomist/automation-client","version":"1.7.1-master.20190923001835","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"860a0cab14c7f6212fe838fcfcafef36d378bae3","_id":"@atomist/automation-client@1.7.1-master.20190923001835","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-XSqdXlOoLCyrE4J8y9DSEEp9XqBi7Lv7YFRLdJMp26CEQX+SRsYwcPjUFU3mnwrmNtF6Bysia2v8vY8yYxshJg==","shasum":"ce7e50cc896a58c1842b7ac4f8b108fd3ffb256e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-master.20190923001835.tgz","fileCount":1037,"unpackedSize":3894070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiBB8CRA9TVsSAnZWagAAOjEP/Rs3+3uLyp7GFapDqrHr\nMdDVSrCb02po7ogN+UB6zcZDQ/mtVk8KLec/dz17lFH+06aEkfLbO5k7/d51\nZor7DtfhJrEJz3gq1tMoBOMemb9+70xGfYkSrnCJy93/HjCQaY7qtxVzoAEl\nwxX3KPHjcEivelnJoGpH0W7o3pHtSYo/OUCPltmEGR21C68vJ/0XwEZIch9f\njiJ/e79AUmmubgSg+toiJY6gRSJ09/W4UqzWAxLI8oR59c18plc3uOYP4bWe\nCf7cdwmVT8FKwbWOSKYNgD4SOFDjwTy3pO6dNB5p1BBN8vou5LQsw6aBVYEU\n68T4NfUc5w4ua4etsMSKBZgP53osOeGp6W2IBgCDVu1CgiUw7PBpEv2qPVol\nnaWxkKpH1/ddkMPr3+ihVzvTHw8y0vWnsgcrzExbapbF8WAaJA0Bqket0hY3\n8pBz8aHAwQfQ+6ssJpEkYk04NaPPAQlB9gyVDplyhMyUc1ESlVBGCbVbuL2k\n5qm0r5bFWULN/r20w5PmLpYSSzEwuRa1N0LWiShGgR7NL4cGyehqgvhGMH/O\nV37xCuWRxORxTrlaJJreqvaav/kEKGI8bnR6uXN/1OMwvBp4ZAUXWFNW2sOU\nXttQMbnIsUX26zcRqdK/KQScRR6/3WHy5HtDzrODe9UtwlmEaGckoIshFc3N\nv12I\r\n=b4w7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQq4dUTOeHm/0TrxTKzkyqW+0eLVZZkQCng0ox77UP0QIgXR0vUWNWsbbWsvTlVMCH9O3bnXMmNl4AQEuB5X5e5CI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-master.20190923001835_1569198203339_0.10629791436252778"},"_hasShrinkwrap":false},"1.7.1-perf.20190923064131":{"name":"@atomist/automation-client","version":"1.7.1-perf.20190923064131","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"84b29372965214ff88a707b661573bdc3145af59","_id":"@atomist/automation-client@1.7.1-perf.20190923064131","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-I9fedAjDhw2bOsh3I95QCFgwhknhfU/s47aQeiUk2yxeiqU9rONSPeOv7HG5yhxGzIAjB3loBYslm7oBX0W/Pw==","shasum":"9d22346ac7aaece59782ac73043b473c65588a2e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-perf.20190923064131.tgz","fileCount":1037,"unpackedSize":3897484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiGnfCRA9TVsSAnZWagAAfHcP/2vl4x0A9qJOe9KIW8P7\n2lym6P6BTUk6OoevLrar1QUCTaEFJVHLvr0oUYJCUpigp7vLvSgmeSoO6W+/\n3heDUEbXSpWJr2pWyqv/YlC1z4/kW377n3cJlIh/wZw+hZLwAdDvS6ya7f9H\n5LARFwID3SETElqx63oRgovK3HaZcEReQtvkbhcPk90bp/hpb2FBjbQOwS3m\nRijC2eOCQC8sODkqc8pBAqjp+a1f9xL7i/BVZtZRZXn8lxm1Dgq05Q6UHHpw\nCjlONWzttxVJ9YYRHoOoqSMD66ogvCyQSMc5RYoRIDHNTagZF44jck46wNiH\nH3HvgLDR8r4AwtBO4nWloZt5jp2erUFnwzEjSstsW87Lmg8l0tJSYTXqJhuD\nRCjoI3ospRuu09k6FMtY4U44yRptalkJYp7jPXP3McMa6kIYLkM3Tw962tKy\nSVbmMV9xZM7KoCzLVAE6aBnvuQs8ZMl7zJ9XA++dj49Tq6w4UII4X5GzVL7N\niIdUoYLKP/+GWo8YnmpzNg985O4LGnr7rJfPN8noXjQ62KM1QZaB1QRY5PUJ\nmbBfkC8hIXMrsvTrO415TNMbjwrJ8d+cgdXPrmQONnjzEWfrB8th4xhZNuXf\nBCAEgOK/NS/UtCRvcvQh0/DTk7GApN26PH7WxowgFiX/1BejmmjB1fxWze/w\n+0wi\r\n=GjVZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoInTe710Rzc8nxeylM6DslbrSPVkHochqPCwO1dCvLgIhAPqLoO5xotQANCVoyT7wZtw16geWPhBnucqilNpbucue"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-perf.20190923064131_1569221086770_0.558385057934865"},"_hasShrinkwrap":false},"1.7.1-cache2.20190924041110":{"name":"@atomist/automation-client","version":"1.7.1-cache2.20190924041110","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ab890df17827c6ab86d9bf39e18049791a6e0c95","_id":"@atomist/automation-client@1.7.1-cache2.20190924041110","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-TS0beRSko3g884dfo9RXfuyh2cKO2JnADhP36idEtjJ/6krUN3gpK6ywN4FubnTNfKONAx3ukcGQogohOn7DUA==","shasum":"a2a7821af00c800682c18968e035623f157cd6fe","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-cache2.20190924041110.tgz","fileCount":1042,"unpackedSize":3903938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiZgdCRA9TVsSAnZWagAA2H0P/2QPhnbq14NBJLkaJN9W\nYjfxlgvOwDSqkvTbzXRAgKXPNbZcOkmkbpA+FS1fkEE+pvuPFCQkpdtFD58c\nitUHNbwfofbR6JldbG69C+Pg2//SJ2Xd2jbKZaWTwP1pnIh9fHdAB0C0tuSe\nFEfBnWzK9qoiwaLAqFxPHkhlhUlunmDM3uER13cB0o3PzHvqNH/9QHiGyr9C\nDllx6eHYnGMqCkGb7H8qlLixik82g5YzvI9pcXd5PX7aQxuqcvMS049J6l6W\n3dmaGqLTEBW/bhv7glc+sDlRUyWqXE/TyAiQuZOEZAWr6HI7G/5IMhBOHw7j\naCSTD/oDXp+F81KESrKQM4DokvvgYQXI3qzAMFd2/bBxFJ2SlOO2/AOUHQtc\n7/jmf83N/d0NFcAqejxDNzrMlaEMbgwHQtIHtBXijWQj2TT8pyUl4YOndyXv\n57SRxxPnIcfCFXS0C/Q9H8xXzElmnXcMlNaOyMPT0A/URRIi4qc+OBHzlnrM\n2URkNnZCeXFfCTDIC58zd30vursTcjYM19FR7qtg0hJBq7+bmY+kfUEal4EQ\nYgdp5DgVQFEcQYs0s8uI7V9eC6XpgoNwNAaVmmUJvMh4jezm70yyBXRPjgqC\nryyZKz1Wp029KS9qFZmU2L7gruFdlHuVoCPbEZV5fQ+7HoK+kqQfjzY9FVyI\nvUP9\r\n=/FmW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYf0q4HxS5VPXPTr0r4ooT2yzftBdlIew212b/8Gu4uAiEA5H+19Tb9Gv3HO3aA4XIvOBrE/m4bHpR+HzdRpXaZeLI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-cache2.20190924041110_1569298460400_0.656845773222354"},"_hasShrinkwrap":false},"1.8.0-master.20190924042635":{"name":"@atomist/automation-client","version":"1.8.0-master.20190924042635","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"25124b97f6285cfd8592655814f5871208a97b6e","_id":"@atomist/automation-client@1.8.0-master.20190924042635","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-dA/Z2UdEtjmBvIBgUXDvicSARnrV7OSDD/KYtxJwIVhDLnGlNq/CMYrBepcqdEPWN400xbymlWFyygWQ+U1KAw==","shasum":"514b2b34c6b396cbb3bb4abd39de411be848a2da","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20190924042635.tgz","fileCount":1037,"unpackedSize":3894070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiZvKCRA9TVsSAnZWagAA1wUP/1M5UKDjb3ZYMy21n5LO\noFOolR2dIZPDxeo5NNykvF9E3rtfjgDLRwC9CH0vfZGhKgXZS+Zt0VH3qki6\njHx+3/efa2MwEQYDMghazrEEk/B18bIJrcLhjBNxtr4C9LjZ+h3JpyMDzLgN\n+VZ3HFOjy6SN1x+rq0VP5qbIAcTkmYhyms9obZdGdfdfd0JXZkZqXBszJ+Av\nJIAj1cHo6GxocYTxteVKdhjJ9X6+SPfN0uUsxqjn192+wPJhCclde7DRR1xf\nf1+ED/9L7J2jLrinqq/hjWAZyO0stEC9EVlrUZp/COONOFNh73kLoL4p0Qnx\nXb9eQweJtk12UBkJ9SMEXy4mZTGSGVC2Mg0wsx+FDRgjxIkVOV1Ef7R7W4+o\nIKNlNyzR7SbZ0/RYuyfw6UDh25ElLr8Z1K5XSZZ1OwZVHeOhIZN+9jQ6n7z+\nFoyTgSdOUgRTXMe2KJhBmwBVvy11oDe7NdvXVI8qnbCms1RwNr1LKbxtmdIt\ndsd+lZyzpf3E+Og9KHakGXi8rJ/OckP0cNCd1Vro+WbFB/MzdPkD3k4a42b1\nWp7Bdc9Nm1LltG46SZ/YcH1F7jmJhTTBvEVeNN+D0l4PektxmWu1gD+nMJ8M\nptmVrwNeYz6e9Wf3SbJsYe6bpOS3/z2DuywSxI5W4+U38UpKLKtudIGgweBH\neIth\r\n=o4Tr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHxDrJNsBPjDgQeHlDnIhucFrOrJ2MHw9yTUDgmpmeIEAiB1251yejpBQpEptQF5PRhBczPM0ep0Ybicii8eE2x7Yw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20190924042635_1569299401595_0.14430425567789884"},"_hasShrinkwrap":false},"1.7.1-cache2.20190924050520":{"name":"@atomist/automation-client","version":"1.7.1-cache2.20190924050520","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"55429e0b7d8877b1ff34b2f986525bc7ded7f203","_id":"@atomist/automation-client@1.7.1-cache2.20190924050520","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-iUoE5LG96ofbcAIyVmnCjM6tl/1RYE+rClTliSUpCBfd0nMM2+7kZjj8N45BeszcmBdOoBLlq32N5lXDvKSOFw==","shasum":"e0959c21ee5b54a2315d2e3f1bee17421a57d2bf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-cache2.20190924050520.tgz","fileCount":1042,"unpackedSize":3909635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiaTXCRA9TVsSAnZWagAAWdYP/R/E9u5UTb2NBW7T8NNJ\nAuRA35wicgoDOWlEvdXOL+TZ4aZyokUNY0Z7qbxF4rACuqBGprNS8ZRGQcXy\n4jFqXcl6OQFsX4TfAqLwq5DIveYJXgB2nVPH2iZtG0auYf0nSkulSkJvdyrH\n7cBr2BW0FjjKsA1yrl57352m9hploffQT4LLsEt8bueQCn3e0nmFYCzvbA04\nx580A7lG4KZUrVLVEB+Y0fYqRlt1i4ClE37BmG2LtvGBGKnqodgiKR64nMHa\n7yDYY0PF3bxzgcHC0qy+W7PLwPOKjudpGSnLRMNEzCLXHeG4x683yjR0q/Gl\ngvF1zR5jAVHF2Qd6x6DG8yuna+0nqauuZUi1Tydip2t/G+RgrqYvtIOx2saK\nNIKgOZ7sN1ZbJl7fxLB7jk8hTQNCOefjQxzPSHJBZPo5bRGxdZWWsAQm13tD\ny0oRmqDz7VikX+8lvIQVDysJXN5CYUAMyZFyVsyEVh4GRIUnCeWwchsjY74M\nw7szFEJB91qofjEErFXyecEcX/hJ2VCa48EZBBLi5CmCkYhu75fD142HVrdv\nTzygwnR7+z5JzG/58maxMslKCCX4cTsmd9f8FU5ZgKmhR7piSBkOrb6KcVMA\n3mox8Bc4FWTVyVRDfblc/ODo15IEegtJBpG3v5/SOg/OForfpGFKMh/7zcID\nh6vf\r\n=XHIZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAW2ovbwyqzzKXKV1BabE6FTFKvN+FPNuls4hOP2AwmlAiEAhYBeeJNk55oj5AfISGAbAL8FBEmwYQJTcFQgI+NrSQs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-cache2.20190924050520_1569301718177_0.2600085892005175"},"_hasShrinkwrap":false},"1.7.1-cache2.20190926074250":{"name":"@atomist/automation-client","version":"1.7.1-cache2.20190926074250","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4e94bbcf821eae59491f8d2f61d1c5f65c534f4e","_id":"@atomist/automation-client@1.7.1-cache2.20190926074250","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-JurDJy3FO3AFv+3bQb6/m+POPoIENTPr4W9Ax/FFptN+2g3VRr4i5amPRXeRTZ8n9kOcNfNy8hanoIcnOxxmuQ==","shasum":"f87c05b3f8bfd8cafa0d2f7f469e63ebf5021648","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-cache2.20190926074250.tgz","fileCount":1042,"unpackedSize":3909356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjGzjCRA9TVsSAnZWagAA4W0P/215O5PEkobJOJcP4U9a\nJ884tb/slXXkeJaUIy5AfyDj77DdQ57XvsSDf9SfwkNSrrQsGEWy+nWkqk3Y\nqBPs9b6yeKgx4LEXYQ3Z/hURlDL+LfRW9HkA2OrE0X8PLAR8pzok91B3CaJu\niZc3k4hULQC+R1KZTI39xigGmEt/HGpI9DNcN2Hp3rx9Pswi6k6QL7Z6yTHM\nS6v9omgmqgPtT36QN35P+GA9AQqJbaejrbqxwAqE/4EgdIeMEeUZtPzM4i+d\nF0ATs2OfF0iYfPlF9mxT7kpa0R7x16zWvdd9NQY3Aw6WrlEWNjYd47L0ZH5Y\nxUqrbJ023+4cbJUj26beiZRzp1jI9FROzxBYVKDVjWDLynLPDOzMxyFwdrli\n36ufopetQc8wQigbgCHydWIi/ys9PXUuMTFF2WjlJ1HA6LCJM5hywDCswgJq\nQSuwQ0udLXAXHDaqHvmzmlcB72zKPCzhmKNqrGoOQqCvBxHSCCehxkix/6p0\n4/sUduv93Q3YWmry7tyI35W/NtV5xP/jOkLY+AuN0jxdbvVGdL/fAY3ZZcYM\nte2UutPXgMxVtzROlMS/uC5Owy3Bg9hVdA1FPm2bHuTLc/sUDmmSTF10v97S\njhIFBhKpsQiv9XUNKWBoIGmCwWJdPVCMiwtWbCgIoanPl5we29npe1ByeoMb\n3Yv9\r\n=GX/e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE85g6Xl34hOOV+w7jM7GldZxH6sfqGr2gtNqzh6aDKYAiEA/DUZlNM2DhW5OoQ9TnGCXY1P2p8gAvhKdxc68KRqdR8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-cache2.20190926074250_1569484002726_0.16212747640391711"},"_hasShrinkwrap":false},"1.7.1-cache2.20190926081543":{"name":"@atomist/automation-client","version":"1.7.1-cache2.20190926081543","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ad7538e634869e19f9592e2542177258f4a921ba","_id":"@atomist/automation-client@1.7.1-cache2.20190926081543","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-+Go0OM/p41KV8qBR/A2PUJzaAT5uDCMDwrxlwnxnJ+PUk9BwKf/mmYqS5gykXxvbFmUHuGnJ3ewJwZjuXwIRAA==","shasum":"f07ee4d3c838ec478ff46e4413c4c3fb441be13c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-cache2.20190926081543.tgz","fileCount":1042,"unpackedSize":3909617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjHRzCRA9TVsSAnZWagAAzLAP/jXWa1/pjrgzl67RQP3P\nyuXh92uvdZsnIA32EiiQjv2uRiFdH62RblAUTspMSV9QFrPsWws+H/6OYhK2\ncNzK/MRF+0Z7vrX6ukIx58fmTRPHGMWDiuFqgAoBVbvC5g4FgcxlOJGr8uRk\nXshQD6sPOblxid8WDZZ8gvhUZjZRFs9/XbNwvK8RMJ9ThkfZ/QE4LOhqsMBO\n9sPFrVMwjC/pMl9H6YgCg/Z2OvEcxF9K8W2LPvRs/AO5RYP+A2v6MsjTXRS5\n0ct5U0quPzjgBvWvhNxyz+90iZoq+M/w4k5BfW5hdb3PDR87dNoCio8VX+vp\nvHtGewb5ZV3VGeZpyyd5lyAv0ksqcFmcqA1UtdWIUQvwTtuxG8DI0U5fyOZk\nxC33+uMzmEv3nnGcg3giA8PoaWrc2iC9n4r1P22K1XaD0uen+Nk6kZ3aJ0VC\nbpDhJwS/j1UKKcyQZnuz+F7p6gtBjCOlIviPqAAU/MM3ftWLEinVX1172+Fs\nLI3vM+vLkV9WSgRlW5BUfbzUooO6MBcqsMcj4Ax4NgIBiC7GFkPE2mC2BiEe\nzm23V0OpDQKi+eJ5fCQmx4qqbZ8hLvlHd+MaJPRVA14vmxr39yBelz9bYikI\nnwuMdFq6fbS/pUSPQvEJhpcHa4zQ/sXlJpQ2vP4Bl2fGQIkMTyfgfLJlrs9q\nCRlX\r\n=obNl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRgz+5OfrbPgox6r0QQ6/Xwb31tLvNxuWqrFVaykVDbAIgWAEmdNCPKP8umNCr3HdBUVGevw1hYuka8hA1cQisBos="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-cache2.20190926081543_1569485938609_0.6635590266508486"},"_hasShrinkwrap":false},"1.7.1-cache2.20190928235715":{"name":"@atomist/automation-client","version":"1.7.1-cache2.20190928235715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f0927ad00baa5464d302f5eae916d232ce99fb45","_id":"@atomist/automation-client@1.7.1-cache2.20190928235715","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Gp/mcqd+QFJmaqtcXazg8qn7PCvYCHFUhtDgdJS4s3MFSTBh0sI9gQ5UbfKzdjAvu++XArB9+LEkjR6aqH2Cfg==","shasum":"f7c6364a83cc14b678a699f734a8918178ada2d6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.7.1-cache2.20190928235715.tgz","fileCount":1042,"unpackedSize":3909113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdj/QpCRA9TVsSAnZWagAAWMsP/iT0t/ZELwvaNh9N5MT3\n/ZDS7LGDJa2cbeWzjwlQxgUr6ft/+QQqxLFyNd2nDJnsNCs1P6U4cFa8cAvZ\nP3zDyvZOXMEjtWF3myTGXYkvG+DxLiqYik+0PiYvOplobfq9/y/tUJQHyzYu\n1ZA7BAjBaBob2J5NHdKUBhCnPnstCb1XCXGlPlkDTmFzu1+shhFekDJElMDd\n2I6yRWDsW22EtFKNtBKbNoi3A+80HzsSoIAK3AigGRavxYGmkG9TEPxezK2O\nhzftVYvaM02yF7nXNmmVuJHOMuZ7nHn32dY27H7seINenq9zJvqpWmJ3/SF7\nqwNlXvcHajCmz3cw1VYMtrbk5bdn/EbCf6ReMv8jvyAzz3hnZgOv7SSk+Nd3\nxohvJpYEKvJ7CLTsMdfd63yML3KplZCziK1FFmUQYfl9WJNlZCzAk+vPpAQh\nTEIj4tAIze5/Rvf8HUuTCLNJj4qTiRX0Je4GTHRZ6K3KejEBAFa1gwuFhPW4\nUQeHvFDNpMa6vsQqAaF+IIa+kLXAMCKW+gqVAyG3KdW3eaHAer1TITYmZmsO\nrQ7vyQbo0H8F/BmeXeZ5BBQAH5kJ6IoaSQuPybg/7GjKkijx0RHncCln/NoR\nNoLOUyx+JRzWtOqQxYFfMRLNLhmIvm/bBdqgOPpIKIK7eDLl6iUxFOxmrisr\nahSU\r\n=pZFw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCtopRpMrppE7ey9G3LJnZZ1dXTQ8u3YzdvSQ9BCjOLAIhAPUeMCX8Z37UlR73nhYgAKl9PKj70L2s5WrveLL1GH6Y"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.7.1-cache2.20190928235715_1569715240798_0.5170652993239628"},"_hasShrinkwrap":false},"1.8.0-master.20190929021846":{"name":"@atomist/automation-client","version":"1.8.0-master.20190929021846","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"caa047daee5707b984c0cb1563f108b513e20385","_id":"@atomist/automation-client@1.8.0-master.20190929021846","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-EglGOLgS8fS+jJTn3n+J9YI/tz02T2oLFP+BifiZPuabTOk0HSXW/qpmH1rarbiz/MuP1JTpEpCNbw5i/yPt3Q==","shasum":"89972162f701dc30300dc0356ad0f2ecc0b7f8aa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20190929021846.tgz","fileCount":1042,"unpackedSize":3909718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkBVnCRA9TVsSAnZWagAAIHoP/jNKshc5XtE1UDGZ430R\npdsoBIjLMK7tjRmto+LkjsSOEiLvzn7mAXVzg2eRyegnsKxxtLcF7DEAENgb\nTCJYLUy8xGLOpYGIvB5Pk4k0tocqXIzvTldncBXnckg92u6+uqh5zeK9VTzi\nkOWrw4bDv6tSAx4IPoqLVn/g8dlsxvljCCluk2/+h75uBIdEK+h85gXhqLHY\nD6DG+HNRWjfrXfGTc8bEIGvgYZRVgy6bcHMuV85KDwKns3zKtpTEc7+8woVx\naS+kpVBQ5q17r2emWSHfQf/PqzyB6BlYJd8umb05iAFLcw+3yIJXWf1edzma\ngZSbfRUoTGznhMaFq6oTrIbfHaUKQq+LPQx5q3yIAQxiCEXV+ghlgrFFdZL+\n7zH4K3Umrn/NgLS+IWTw/JgvtlNykn+OR8v+4mRSRztuYyW+OwaAllnbMfuZ\n3zylPNQj2Rfl7CcNOLmdXF571pWx/XvTWrkD81n+hbLe8+1OcVgtzzsGMOHJ\ngRYrb5lpL+wtLhJN4l8c8Dn4nXpNJAoQ9RSdZW+0FHNbxsLeyXZfI5XO109y\ng+uoWdw9E7VOd/w+OZSSOKGS8k2lBj++fFE7gCytwhWJYI6Ycbvdgsu4Um6G\nddn3wlZb5IIblCeJwdpA7a1SIAev2gx/BEiUD0BKjdI2m1CCUsPV4+eCoBBn\ne8jp\r\n=FZO1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB3iQGRJMWKpadBmEK1MASbFQaX4AyAoQXk2k28yZ8/QIhAOHiGfvFQRyCRLj6qM1+Y+BCPZNyFCuRC/DjVRZZawu6"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20190929021846_1569723751082_0.298778526189994"},"_hasShrinkwrap":false},"1.8.0-master.20190929022106":{"name":"@atomist/automation-client","version":"1.8.0-master.20190929022106","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"caa047daee5707b984c0cb1563f108b513e20385","_id":"@atomist/automation-client@1.8.0-master.20190929022106","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Ey+dSoFr45iS/WbQojFb1QJIf1gqhpS9nNgKWr67cQfxvAzLPjtDIPu6mXnsX4IL1q/7f2O9ZNcioqb7/QtDTQ==","shasum":"cddd27982397424ecd39b86ffbba1948a2741a28","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20190929022106.tgz","fileCount":1042,"unpackedSize":3909718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkBXhCRA9TVsSAnZWagAA54UQAJWEnvdZVHVh8ecLExu8\ngiOI8BZGH6EvHTJpUKiCBLZZTFCvpOPuT0cIyhE89t3h+T6kChVi2bJ/A2AY\n2JVRrcZ31jQ1/rg4ZbMWTGHhONaKW/Ox/vwn7wFaGgSNywbHJ4sAo/45r4JF\n2GrGunBfB4IW6p7NarzjOY7fmPEUIbA165y/OuPPtpf83W8Fm9DoVboqOUgV\neG3oDeBKuhrDlpSF+KzVIDOOLPTF/+mIIXxMQ1BOECRaS7PlwlVbf2Q6MSuH\nwY8aSUjkRbDu2LCu3ejGYlBtXd9dYuGHn9TIxthbDy7rZxvt9H7rhF6P11j0\nNjSpdq67nKXWUR86pmkoxqlNH+87RM2HRbWYl3PNTfuMcvaFFjmOkO7XDf+i\nc8ocCxVEXU4WI/JUpOLt9gITYycHymB1aVhp4cIIX4WIj0gC7nXjSFTmHdWx\nmzXjv2XYYz+bKOJ19v0RlujLKwj1vKEWhCYSFiah/6nPaBPB9Ttd/LwX+JQv\n8mAbeWLdVVvntdjEhZ1fPgES5AhBS+hST7oaaNpcaYLJ3H988gAzvckJS0b8\nWrBeKLKad5W/KK8kcIW4/awdqj9VDbqiSgAsQZbRWTu3auKdEq72ysVarOyX\n4dFNZ+z509sh/NX85zXkn/JJCuQvStBfB/GlNzVq9wl0q6HcI1I/rI4J2sBA\n+Rof\r\n=YJIj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICC0ZlAabcO4HwUGThzKpx6x1DF97iB8YsyxoH9e44q3AiBrzVc7fBvyf6Xs8uqiuVggXA7WnoCJdS9DtDEIHSE1kg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20190929022106_1569723872413_0.699734527450177"},"_hasShrinkwrap":false},"1.8.0-master.20191001022338":{"name":"@atomist/automation-client","version":"1.8.0-master.20191001022338","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"004b8720f0e6f0aa35212d9edb0f9868f903972e","_id":"@atomist/automation-client@1.8.0-master.20191001022338","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-VNFCsWIb0phAd+W0yE+kN0kQk2FizV29rbvyvkLAG5quYr8KuqyEFFDnuT4ucjJ+9fpxPgnD97yS/aG/sj5HbQ==","shasum":"24ffe7a3e9e4cf4ed22637cde454e43a765705d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191001022338.tgz","fileCount":1042,"unpackedSize":3912489,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkrltCRA9TVsSAnZWagAADVUQAIdC1eCXgxCpQRgcDi4O\neKVexea55jwy1ZaEuXU/zMfe2VmThFVf86jCyIx7h5Zl0a59KY8F4iSAP5PW\nHaYBp659Whtvv1fPrz22nEroctgh0Re2CEpGnxdTtOtqCpZ31sO/wEGwIem+\nBORIga7ojQE3W/GkERkHHf8SDXKIO4FYm9uL28r3TC2LbTQA7iR6hqezN1y8\nyRkWbGBcRhZmTIJsRo/oqjgFXGqHkLaqnOtfv2HwvAra9KA6EcoLiUeT20sR\n8gTKz/zzeUZ2yKfYVp89BpJea9y7bYkI48pvr2AFIs0gQL1KVhFLqiHyb4gT\nlQhvfVTVITfMcqONeC9n9LfZbdku0MiaXUsvdNdZvTug9ZLVIpnkREg6KRix\nHN0zHEgzPNY1oBPE/DavNY5dZXZJikrjc9wfPfvxFYsXgSXga3fF+vCtnNbN\nEBit1XAyhrJp3DpcXbzw35YEeHBfFGhf0elGFaXSVcBZse+lkQtUKmk9oHtL\nVI2wc++axhIb25Y2CoLxrbCiqgJLOgqZDmPerIuOrj8CXA5igUxWjaYJhJu5\nzxrTCWe/j8f1sJsD3D6yqYC7D1PDd9T4NzfV7yidQwtEvJgunDcriudNClis\nACXwpnOOEchKnOUYUphfmmUldQP3p5VWk/58PvLhoGApoRvl/sXs6GfVLt5h\nGhIG\r\n=fU+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWWCOJ8t35HaZrdLQ/JsqFV79mTGxxmioxxPeJUSoNkwIgIUetzN3rr7wYHq4n40+/CeZ2EJb01ir2lzMvi5sEJPM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191001022338_1569896812588_0.39891222453881814"},"_hasShrinkwrap":false},"1.8.0-local-hostname.20191001190808":{"name":"@atomist/automation-client","version":"1.8.0-local-hostname.20191001190808","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"74c055cdbae2620b2d21c94ce7f58c8c94df2056","_id":"@atomist/automation-client@1.8.0-local-hostname.20191001190808","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-PJFb+zT+MaDT1cTywXM9eb+PlTIJEv0ulI6knhyjbKLX9YNrvpAFnnretzjnMvL8A3AuAVHwPAZocsznTMhbTQ==","shasum":"e1d823e47334543a8b331575ff6ac4a16c24aded","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-local-hostname.20191001190808.tgz","fileCount":1042,"unpackedSize":3912680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdk6UWCRA9TVsSAnZWagAAoCEP/2vxFSVl4cxDW27cK/9u\ngLY0fhxfa46mb7PeOoqPFg4MFciehKtNbKTW7oMVBeBKnqWu+LY9oprMpPw6\nl3bKlezsyIUkDqCNhL6OC5Kf6In7RFMD9g+ehfwqV80jAJwzJ/WNIkoV3OCP\n72ysoMICw0BiWBTZudIoE8kIqEjYtIlRmNz4q3G9agX0hBDxBpRplefhC6wu\n0i0lX+QmDlThDJHBhx4KaGe7II8sWgWk+Fjta+dZcQx2h4RgpFZ/yWFaVbEZ\ndTeUf14+LOsGbmB1JmWilznebuEDuOyWfzNXhI5fpSXdYGagDL+oKgiTttmn\nrVbCVCkYof6oCk0mLAaEuQYE1kUzSN9HAk18xmQL4yXSFcBfnSnS8zlChdtK\nodnCX835Fd2ojoeFHhOipgHR0v04G3aS/JvvJ1AQZFBdXA2S5ihZeQUUbpdD\n7UmQH8qzM8I1YUSwVzfzq8uQurbDIc0noByeJhAA7K7XRE1nnltejxnYH3Dz\nxiTgZlGeY71Mh9d9G3wvIGdpEvyY+7ys5BzoHKWrugqKZLe2FAGwbrDJvIgD\nkFuiFHhWawe2RLcnG1w7mSdkGo2+aJvCRMf21ODjTgcT3N7i7ZA04hhg4I4+\niLfm0qu8SLi2hX1tV7bI98nbc7mTKKxUbV+RXmdW2WMpkXqAqIVudpaMSOOU\nz8Nx\r\n=cMrD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICuNyQXtl4EyXAV86hysN1CGmxI3uzNAOMbTJl88MTugAiAJA6eWa0ueQ70/KIYbbQxaQCKdO7FA8/q/lNt743xN4A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-local-hostname.20191001190808_1569957141798_0.871719798996103"},"_hasShrinkwrap":false},"1.8.0-local-hostname.20191002012731":{"name":"@atomist/automation-client","version":"1.8.0-local-hostname.20191002012731","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"40b18a28ff107ac1a6be573b23f0082428fea118","_id":"@atomist/automation-client@1.8.0-local-hostname.20191002012731","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-KcqZzxzZGrz6grxMazYNpQrUHrJpBZyVe4KKnwTQ0xmw9Q5XGSI6D24o363/Mt60MjhQ8qh++xG1kTatB5R0zg==","shasum":"44b0aa65998e05bf717203db03eae61f527c32eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-local-hostname.20191002012731.tgz","fileCount":1042,"unpackedSize":3912652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdk/3pCRA9TVsSAnZWagAAc7EP/jB/7eIsnsIoK/pxZeqg\niZpbH5iVQ3L5AkkGkXab3oM6hGQ9lm5oYAWXRlY0tGUiRRfU2S7S5APVw2K7\nU6zkVobHQpZG29WXDPfbZzFoDvgcIiDLxudbQwdZOr2OJuq2QFVkLO1S19yR\npD9a6vQ9JNTex78m2Z2HSGXQflgUEUjO2v3GYB44r0B8V2MCKazc9bqa1zTu\nYFJ8/Vox4f0xG0Umicz21btIOOWW1//lN34rhzgoOBtPdPtY+dhWi9y+RRSO\nt/mhoNJ2N1AL+s66GgvviF6Fu8yj5RMvL8pDJLEb72oFU0mhvEiZKIQbzEgc\nsJGzN63zO24HAoFtUNFHWLMVY05Dg+XirrOcqZCa7h+/aIhD/WZ9E4lLRLXc\nQOhv+8X8siqd5rFmSPhEcDoYK7VCc5XJywPuUXZWrD5PTDrd2rcB5CEHo7Zx\nyr+8I+WFX9U3osX+sso14BOsYm2D21YfRRvcfoyv6n9thsytl2FVOSUkPHZ4\nv35XFvpjmL0epvpIhCf2V6/e/ckghDrxWV8DMwbQlmxoCzfGO+MqsOQwGtI9\nkXiMLEUQT6w/wyYpDrr4g89xZDu/8W/zxYIVveRo3SKMuNBjse6BuhKqKFY+\nmmrOWILM/1d2ePKZKbumjfccziVJigaKB822xXTD4zRsl1XSbIPERte2GuBg\nFyGz\r\n=d41b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJRHibzbDFpkCKVmJg7JMlL4zl67F+QvglVeyzycrmfAiEAh3taqK91KBgZSbITB//H3NEjoVuQ/PO7pC0SDAEXiAs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-local-hostname.20191002012731_1569979880377_0.2688229167074154"},"_hasShrinkwrap":false},"1.8.0-master.20191002062637":{"name":"@atomist/automation-client","version":"1.8.0-master.20191002062637","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"877b43130322b54e6c993758c9b717200a998565","_id":"@atomist/automation-client@1.8.0-master.20191002062637","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-B/4EKukoPEmEaknHAHTI0JGeUHm28oLgVjyJQfaKe8iMGKo1548WhlnSOsDd1kEuGOEaRQ7Qx68sd83kaNOftQ==","shasum":"460a998904195f0b745e25d6355df28c0235fa91","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191002062637.tgz","fileCount":1042,"unpackedSize":3912771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlEP0CRA9TVsSAnZWagAAZSsP/3brKp7n0jst2LyHr8J4\nXbzbZ6evJcmo6syN4fhsKb4+ce0BLw5cgWi3gBF9v4KnOHgWACAKhqeno9Wo\nPmwq36LXUfsYsBFldZ5kRfpWAzVLGUvbe0TqsYJEV9A64hnpRJlyoN5zVdrP\nNFQ6bnUIRcF9UaoLojvZgDxc+HiwaKfk7B3acnuhV6nwyozUlCSr8E7FSitE\nZaBHL/ADsqMURvQxu9dewuqI8Gi0OeW6Y39vnegbVO+gHY4RibvsirZcDYqb\noeS1piCX72oZbg5nohLi4auYWNrgZrB7jK8tacvqvA50Zu6dQkgEVg6YCCHu\nC/bJCNrIEJk/TYydYhOBLbJfQPMP35f/hbTyUZuLQfCuoDVGXVIAalNRfncq\nOtub7szPoe6tyXTAtVZ5awvZe0DMPUEvuTiN1nSQwabHu/LBEjXEjb1QhEMV\ndbLI9rPKjs7Cb/+UMAz0tG0LWdxHAAF9SyhYiXOnWeBp598DH/a6ft7csuoa\nwYewfZiCtobJ4dVFp7syOqEYfrm0qzGuLy7M2ttn/l/9s0ie4kXawcucH0T4\nrFOmBwTpwAmV9likutEg0p8SZo33XzSgjj1vrKsejXfnKHUpbcx11tj69nhT\nYTEi1Wi5+AdTd2xIfc0auvCyNotTdEvgkjo4RCNgzXKv4lIVwbQJSNnBJFUL\nEhRq\r\n=6mmu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsPbkQgLUBnSdroxv6gXUHK+0hldIJ5ENlAZP9khDzFAiEAizwkBerWqoqjiLYg/UdJabmswNL+5KyWKO5J+5wU/bw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191002062637_1569997811649_0.8725696601099662"},"_hasShrinkwrap":false},"1.8.0-master.20191002075830":{"name":"@atomist/automation-client","version":"1.8.0-master.20191002075830","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d6f97825747c29225fea78993f51fddd51a6e334","_id":"@atomist/automation-client@1.8.0-master.20191002075830","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-AkW732xjprSABHKEjau/5VJ3Fph0rPVl5sjM11jPNsZ7EjX01Nw2q4ec5RbQTKEqXGj5WpCuuAZVfCIr/RRLYQ==","shasum":"896142a957603bceda64badb23ea01c7b41b5c4f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191002075830.tgz","fileCount":1042,"unpackedSize":3912762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlFl7CRA9TVsSAnZWagAAoqwP/joyq8OFbSQ/aGm8sTRH\ndVxLS26RpVrhX9Uix/JYr59BjbLkcE7CwqYG0n3+YBMzqesGcHTwJayV2s8p\ncq34x7Kh0wnmWFeaS9tL2q9bcTvNnoLE7FhaFXyGUVzp1l5qbCQ4nJJipM+Y\n1YOA+kwXkv81DHpCWikQG8WUN6pVJeJFDlqxFvNmo2d9ZeCEoOOSGlFPbWw7\nsIFEDG8d3/Kq9qhv18zPnp5iNOZkzH4YrMukEtX3psy3Jx7gT9oH3/NBSbqa\nGnW+mfCjcNWXUbaYPg5gNnH/6ompdyZW0fDPkXC3E+GBvSO0qy5LGYjBsyX3\nv/Y9kxBSaeeDOllh4piEWnsdLAOaYH8Pqv37epcGZv4ng4YDi3oLHAaSUxRv\n2CfSKg3+uMjT4Mgn3hcI6Zx93s2AC36rpvAFr3vXHbp/gchki9qyHhaZurx3\n8TUTdG445NvAwSDjTBGKSftvrpvyM/d0zD+tTwcxXwUShNZU295K3VeeJSAg\n3KWpbcKup0Inc/9LiNQAtfBK9CF5BPqI3FdgXfkHdWCejlo5tTVACjQaNN2l\nM7/PuVKtYLsBadFI888KCumDx1g4UqvWdt7+vpytDZd0QGuRxS3n1PX76uEz\nxBraNP0Z099fR+KGDte1Y5tvUfFvQ7r3ut3iGS2Ab/bwGvW096bEvAbUI1f9\nWC6d\r\n=r8Hd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5EKiIO4GLzi0IYF1bCHodxx6VKsN1ZywBenmbFYjFgAiANsgVE0FOXch8b2p5CymvOEERfw4UO7EhqY6blElJeUg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191002075830_1570003322663_0.616806873937136"},"_hasShrinkwrap":false},"1.8.0-master.20191002201734":{"name":"@atomist/automation-client","version":"1.8.0-master.20191002201734","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a1eb3d237dfc8b554ff52379f9263364e6f28738","_id":"@atomist/automation-client@1.8.0-master.20191002201734","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6lMNGHVvxQ604aXrtjN/+qmJ+wJEgqHOU0LYMLsq9/l+hkFu/31wBdh+rAbbECknH/Iyc7y8aB+Lc3ssgQv5sQ==","shasum":"a44b79ce7d693f3741f7f96b4051a7e4d105e3d6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191002201734.tgz","fileCount":1041,"unpackedSize":3912948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlQbiCRA9TVsSAnZWagAAHX4QAKHH+QEqofoULBjt1IT5\n5xwTapfc9tNK+CIf1yMIiocoHQ5uLPmjH2TAeuOWfFSvc5yryHPDPSywyanz\njmHR1Lh32yHJXZUa5bQADUXirWja98PbM9TTPzG/5o+IX6HJypgzhazevyYv\nMEPM2If/nkMb3X0/oDyiRhxS37IECxYPx75JFKE6PEkwktz3T/7q9yrlYhhC\nudkGmV0j164mP4QQBUaKocz5/qNIJ1SHCf0FDh3ZkEBPoKBlEih8MoaOevwg\nvaizafEcN5WaORO4vr8jYbdOGM30kocz6ST0ZcKOTy6hfnQqlvwdgMPj4L/m\nysiNTJcwOKfk7KY8jTIE0SHg16YyrF1DY4sQjKzDJI7pmddItkmC9Nv2X84t\ncYJ5QILu6Ke+yRJzDfSHTfOjYeVaMh46acfNKSoDybk+YqeSprqZ7Jj97EaX\njoUAi3kT+4LFS+q0R3hV8giM0jcj/v7G7AcYmpNZJxJiV7tTDL1ApqkjzUEU\nTvhwj7O7u+Me74ev3+bfD/ZO4j1kcUt+4g6Mn2lU3M4Q3Ificx5llSm1xzif\nLPJrQfvEyjqgRVYfrnbS1fQHxOnZNu4+PWiiIEytlIQlt85evfOEWUiZUcm8\nwEpyYMcAdAMVh5pl0K0TTQYnnvq7DitewZpVQXnym3dGwCtpMQiSu4LK0auU\nFShL\r\n=kDQ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLT1kBEiYj0P1zmico6B16kuY9WVMfqeKdMVjii6DvUAiBbGyo+GgVC1jBTYeHxkmu8ReMrGXPybyb8OInZjqB75g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191002201734_1570047714008_0.2141958157751882"},"_hasShrinkwrap":false},"1.8.0-typings-dir.20191002202139":{"name":"@atomist/automation-client","version":"1.8.0-typings-dir.20191002202139","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ca41d9c485156014e1f50099d82d7d1eddf1f671","_id":"@atomist/automation-client@1.8.0-typings-dir.20191002202139","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-bGrpXI5kIwwdyecFrHy3pnP5lVlCytY96B0hy0ilPWd+iUjvZ9boFP3SN+E6Ui2EBwVVPKsICGPq11DoIAHPXw==","shasum":"abad00a5580f68caf036277396debc41652487d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-typings-dir.20191002202139.tgz","fileCount":1041,"unpackedSize":3912962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlQfICRA9TVsSAnZWagAA2agP/3j6DEmCoSqHHPKpmJ/j\nIbSyNdyone2Grvc8bKV/NpsBALmOHtcW3f2z0/3+gkhGlbs1vhEtQLYYpdS8\nt2xa4SwzknES64F7wx+sK9VF7qi3D54Bt3L2pUbcuGegC8iAja3Y+8uWDGew\n59WzFPWAkM5CsT5hyfHYXNX1k9ONvcs9sQQJgJD7WnUkMal2mvInlP2FLEo7\nv8oPf4KBD2X6f24/XghYwZeoumX9XbkMq6nLrPet1FXBluEAdgbTw4DHkfza\nJhu140V9k7yoGtcYDESG7nVLt9y+AF/YKFFkOanPimDDw+Y1ePGPTEh9xHLb\nRyPtz2vfvYj7/zPx03HyQgdmckzSZpEc8D3jAfoc6GvbgPFRk1KKPn4FcngU\nqGe5IHZ2HCigwLzUklGsxaoD6pDRSG+K3ddGbQEfGSm+h9NQt+lzh196zHtU\ngYHT9nihfq2mBYIZHgAoBpTKRCymqfQRabtLssK99/XygVLBwFJWZELnEok+\nICqpnz5+Eab8n65JN8Z2+8xc5bbeib/rQFvV30rb/Dsc91F5AAZneZ28kHzB\nDRhAQGPlTF8EmS6Fqn56ORZdSCoPP1138hAJV5ub4cZCOFYohUGSwUCR5lUx\noKQl9wTXRJ4JGCCfvKsDSOudM/PQn1G75bRzvHvLyjqs1IfT0taXt2FLabv2\nIzQI\r\n=UEEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOcGbb83Ds1yzw32WfLCIzIRyHX0xQJNA3cDkLIqIgyAIgFIV8ecgErLKL+UcZ8nUB8Jb1vJdCbmNdJAXSV7yt6G4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-typings-dir.20191002202139_1570047943592_0.6713508894741498"},"_hasShrinkwrap":false},"1.8.0-master.20191002204108":{"name":"@atomist/automation-client","version":"1.8.0-master.20191002204108","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fe7a31ce112f802190203c2fbdb1ccf35e8b6a76","_id":"@atomist/automation-client@1.8.0-master.20191002204108","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-peCF3sFtF5G7NtbU0x+wLYKTMeWlk2if+fHVas91kWc0sksOaMEaahhUe9TRk+fpEc099nz2liFkL0+tFce8eQ==","shasum":"6c1fac41d97680e99364b463e2f6ee9b161c9e7b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191002204108.tgz","fileCount":1041,"unpackedSize":3913074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlQxtCRA9TVsSAnZWagAAKJEP/RlZLyxy3ci+8+gKMEoc\nBf76NS3gtB+BtLk+1ZyoP5sI1rVrv2nGXfWLK2ikFmVzmjS8sfFMD0gdPqZk\ndAWBpxeQfJ3M+3WNAmbWePy4AzawZFFr5yAANRqP/8kCH/vt02VtmkvCl7Ts\nAP7KWlWPFEpbMw0jFDD+qNnvK3WVpwV6128BhJt/xJGeAMvCsnK4yDH+4zNb\n6+mMyv47QiFp1cAxkRemXCABU9A3EO+AIe6OOP5JYBaDhENWjyC6IsH3JGx0\n6ik0FYxuKU6Qhn3Zsphi/f7KiJmMPJyHF1WNCMGoyVZ9OORkjr8AngY9n1kM\naAUKOoLuR71oBbTxUqU44Zg0+/LMKECkZMs9dxexfP7SfYKRjhIhNkm9PuxZ\njN26ZxpLbQBQW6ffdRglZrlM0yTonNQzEFQTYeGlMPcWviXtNwNy2TTwPGw1\nKfTC0dAF9RUlwgKBtXIeMAPV2QeiEaeVatYo/kHzob6uP7AiZXXmiopByR2J\nBY88IWL0nuMSkgK+sL+u+2qA5fOGvTpbpQOref9qh97MAXG3+EKXbn+JcGEQ\nMSMI7/CjpZAhLx60lYkELnRsJgHoTwXag5P0VAQ6xT/i7RW3f1+QpSXmcltm\nRKG73sa0Q4F+rfFM3Y8G39FBnMSXSA43iPVxlW8kJ9jFLnr2NV/As6luIg+I\n8mDE\r\n=cicT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6WqRSZybzhvuCF/dhUPqLC1xEjsi2irWAvPvil/YX0gIgV91JAyTq9kuH7mAadY+5q/T+4lxfgC/t4m/sX9uz2LY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191002204108_1570049132806_0.6041838074147323"},"_hasShrinkwrap":false},"1.8.0-tmpdir-shutdown-611.20191002221137":{"name":"@atomist/automation-client","version":"1.8.0-tmpdir-shutdown-611.20191002221137","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"88c9d013a3c6801ece95b4593a0fac315219938d","_id":"@atomist/automation-client@1.8.0-tmpdir-shutdown-611.20191002221137","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-mcLp4emTFd95730ZvwUVS+mPeS7cUBJPeSvRfd7LrUwZcErJ1P+Ojm5ACjCSsRk7ta9p8fmTG/qqTFP6wvphMw==","shasum":"b5060bdd3c61c4b7e1427ea90c3adb8b3b11be3a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-tmpdir-shutdown-611.20191002221137.tgz","fileCount":1928,"unpackedSize":5581481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlSGkCRA9TVsSAnZWagAA6/EP/iNqr2Os1RFH3IDT8PxJ\nEMYsOwAVpIYyEjm2ZbS7aSqarSTP/I8xqH0Odaj1IMBCYmYBfmsO+M3Gz6au\nvELCGmaCoTsG4F+6PXlzHysBfu85yuL4csaRcEM0TedLcm6ON8YqMUxWBudL\ndYXHntB+aPFdQZCdbuXnylcmYw5oDUJQchuWPOVnKbYvisCyoLCLmC02PKCk\nMc3X/5osKBoQjlTlX4wuxFaT3TX0420/yjZ8QNobpGaeAkIca25XVioMmzFZ\niyLvG0Rt/6/h15d/r4GagP5dot+sanqw4Ffd6dZO1lvBMkd0oqtmSt92WPZQ\nhj689CaNZXragt8gx38R4/rzS8A3YjWEGhXWvcLu9Qjcpe4gVSPNrPlu48Vq\nzmUaC+k0/DOTA93sBD8uZ/F5y2WOjJclvmpKECJZ3FBt7UNGvfH+4rpCVhRi\n+f6NQ+O8/zYhmtDWfV0YOCALCGvpm+QsSVQ0GE4ME1uEOIWC/4IAgXtXQtwW\nEO0YqV6HaYYYDpYuLq+P+uKGf2pqwn0Ju+cWY2jgpsPRTvCvGV55CfKeiyuc\nALELr1T+uFuW746RTK1VOvTDB2gNTFqRyt0Tk4M5aNGGEzUSXIbdOMt5JuBK\neE9QWWJZZ6qOfRb6Bpkoxc6S/Ro7oqe4dZkcv0OKEL0A+p0L5NUVLEXCuz/0\n9JZ6\r\n=7iGx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUq/w7dVIIWPbuv/y0pN84Tk/sxrn570nZl4wRZWE+RwIgKCgF2e+j3XXCqyPr3APy6IgWIO92tTn1Sb7Gr7a1pfc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-tmpdir-shutdown-611.20191002221137_1570054563296_0.780531075480174"},"_hasShrinkwrap":false},"1.8.0-globby.20191003060204":{"name":"@atomist/automation-client","version":"1.8.0-globby.20191003060204","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"49ad3cf2507ecc305563e23e7eaf5ca5642e11f4","_id":"@atomist/automation-client@1.8.0-globby.20191003060204","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-bSJJPj6pP+wkeuZlZxQLqk1azSlsvgIVOZRHDP2W/YLZnd5GBGWZzmXo2gvbpB+g2ELR0qWKhq3j2UeiOTfoSQ==","shasum":"25ff1a1fba67004735fab2eb50e7bd2deeff1f9b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-globby.20191003060204.tgz","fileCount":1042,"unpackedSize":3915295,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlY+vCRA9TVsSAnZWagAA+44QAJWAp+77s29PeNma2U9E\nlGAKS+FHSIhA8p9ua+K7uRFrqG6tMVcVLlIH8nj0B/4WILxaABUXNYRtkLCY\n0VFc/TN7bItm/z/U8+Tiwnh9wqF4246yVhCCCKKIdW4WN3OQ3ADHucVQ03aE\nWhleDZ3/w9Ad7cHg12CyiUphsH+YuOkg+xSjZvJzdt+JOnGS0UoQeOlZ3sR/\n78ccWvuSCTRuQc8AhTmCn3YIe2SGN+PXUfVP44N5nCE3M3mxijwokP5tI75r\nj1H2TBBkSEWRZ/eEVbVt/I2ODf9c9TeT1tn/hXIZsx7u0Quqm3RzK6TDe8D2\nl80RGxLqnTMA/gwFS5CelWIyHtOsAglC3G3yofYijZEeFalObCy0fH98uayB\ne6c5mK5jNMz8FZF7Z5eIDN9CgWllJJJHmX/SKmjTsFMszvYhoVseungsCdAO\nVwRSF+iAWc0chjGI5zFXGUTN55qcA7tABURtXw95mVsdvYqfctOjdqjLtKmE\n/Iu6y9w/2Tjrza3wjqLnRH1j9oY1XXCFziSZgetx0qNdCNPIl+VLP4zsAOUe\nVdroI5RX7Cl8ZORG7fn10OIGQLxgKE+jMR3FjhQYo8KvzKGnUhN5tqXUGcHC\nKedIb7z3on6iPOeeAVyWm1wXWzvTxJtFRRlsUddlS46Y4xa11enELURcA4gp\nYYkG\r\n=yqfC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpRXEO4LUP/LPUQGJFE1ZS1sI2OI8K5GpK2A+AMCm/5QIgPwYPkk7sAQG7K4ZPf0l43xi3YmBzEeETjN2B1wfM4FY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-globby.20191003060204_1570082733949_0.7768026707751139"},"_hasShrinkwrap":false},"1.8.0-master.20191003175029":{"name":"@atomist/automation-client","version":"1.8.0-master.20191003175029","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"860540d354ecf513909015809b0eb2f01188c041","_id":"@atomist/automation-client@1.8.0-master.20191003175029","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-3VJGF3osvPWp5zh/qgXXtDZdTUnptGRZA3QryhY9JhAG/hXDLDKlBxPPEgYn1zaSBjtb/2iErRInXW4ugf9rxQ==","shasum":"4397f1fa07b276ef31081b50ed4e6ccfc8271c71","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191003175029.tgz","fileCount":1041,"unpackedSize":3912599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdljYICRA9TVsSAnZWagAAmcMP/3+73N1vNSP/vWq435/9\nfdRUGjBgAeXfkWGsK9zy3dzWSPzT548ZzdBUINcszQGjl6ATOVknL4rNWbHW\nY9UCugo89sHshyYZtLkIraAIXl1XSZTwmH7HyBbbJYAI0i2tbMafkuYraRBx\na6f8ClTktUqrcICVsCpwrn57PsDBwCrE93M4ttKCnVlpEJ37RLIHRVohQICj\n+JuFsE5OQmnV5lb8l5ihdWSjumfZliZlStGsqvU24AI4os8ExtwgIKF4GWaD\n5YgqLTUqY5pISVQ7ITQP3hEgM8vtzeFxexlRXKigj6iYGdGN9GgOQDXnxFtM\ncu9tPJ+g7YHLPnKaR+FvE+a2im3iZVsVwuG676Ds34o+/iss8GdawqIrUcx8\nP9ZcH18Mo4RuSWK6OutzZhMLWR+oJFS0skumP+mmq7DtlW/6P+4+cQYJ4IAo\nYubYXJtXYBceUNhT2R7S8njkM7Vm6T3QhCOGsb1gvDnpgsEpxptvdF1hUoeu\n4DFlEolI+f4Zp8D1V02DBZ5Qb0jAuz6Xj5jGHxOVJOx/z5gOgq/CNy/nRON+\nH5yp2DxTc9Ia4dUrLMm2JAaKil8p6KnBjJgmJRNwQEUHXgtEngU/d8V4i+Mj\nfGrsK4vKIiYY+ddIFaLVXqIBQlqVEpfMLdiuTQ+x7hGSaCrnK/AIBxoRgaQG\nF7BP\r\n=AiXi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdwm/K0OWsbV7p6ebUQclTbeBmBG8CCEOu5bb+U+lEDAiEAgLoiu8/elQYO4/7OHESoqc+zEYyjPcSXGDDxnuOBvbo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191003175029_1570125319258_0.10912683081535146"},"_hasShrinkwrap":false},"1.8.0-master.20191003195608":{"name":"@atomist/automation-client","version":"1.8.0-master.20191003195608","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"74cce18a17a54d9e6983c79558186e7d117f8cff","_id":"@atomist/automation-client@1.8.0-master.20191003195608","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-YHLAwv/1MFY073ZyDIlSwu/dr/LUvLlIp8Zo7Rnhz+RmAWy/Nl/cWl2/zvV9CLFq+Bog6BzABMAPp7pZz9Qi+g==","shasum":"59911fc906e36f0b106a2a394f058cdbf021e361","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191003195608.tgz","fileCount":1041,"unpackedSize":3912599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdllOsCRA9TVsSAnZWagAAtHcP/j6pK+73+A6Z8XDFsTYG\nj+JeNw8g4VXnMCHSVh5rnxR6X4dav1mgirBUvbhWQ2QBV1DBH8NDOBl61rB0\nxeCMVUIjTlLEQKdkHv+iwgAqGXSDESRLadLABluCdzCy6TPgWlKUk2gzF27E\nZ+YcBTo+REU0V0nyXPh8MPBAFbGPXiO8RGy1kzUbRoDLdZ35BA4z/4slu6TX\ndC7dAspvrIggkYYFpSbDA+AQ7ldcyEMBaumNczDwdgapdf19BRtY+g9JXB4W\nGZNmktlwp4Qeux5+T2RIHSdPo9e1QA8mrYSebLh+fLcWyKIKm0kkP3XonL0t\nAffGzGmshpQyr2Dbo56XOdTDpvtkn577+tuyTjkww1oP1dX+2+Y4mkkD7foL\n1wCqrVrwnLikNN5R5Nd9F10rTipofGXl55WGCDp0dAS5TF1tHGzqdbrQjtw6\nddlWE3/f7jXSn2RRnbmmWZQ1ZdM8+Rb0VIkzNteMEBGuywTpH+bIMZmtxUWX\nn597Fg6MpBCs6gXsld6vtVMrTP8vO9qUaUqImAFFpNPDNoIXzrY5Rrclhg9Y\nKgAcqzTq8gaLCRh/AszgDI3RuVVK5p7hzidCJCygoO9R2IVQp9PkuB7UYRzC\nK4vDE5jq8chSk1LJNMJDB5qF1pDFo+iVofWYfu5jKApD36YMEod+b2hEE7Og\nqFEO\r\n=mlwc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrTF/axGmEhTccxt6dc6UzizM6dfBH5OmPyEgWyRsSMwIgYgNladcfySOBBSI6o0zmEkV8vHAjkz+0p2AeOAsd1qY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191003195608_1570132907386_0.965483532964817"},"_hasShrinkwrap":false},"1.8.0-tmpdir-shutdown-611.20191003201314":{"name":"@atomist/automation-client","version":"1.8.0-tmpdir-shutdown-611.20191003201314","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d22fd7352c2cbaac051c8cbc65e692aebbec7360","_id":"@atomist/automation-client@1.8.0-tmpdir-shutdown-611.20191003201314","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-yv1mglVFmb/OYPlGRPG9xD88DTYGTcLvmfz+ttGEhYigrPxuZ8+oVjgwi0ditQVfw35DMCM8Cz7eps+5mFp3VA==","shasum":"1cd248525ac3a5f76ad95300e7005e4504ccb260","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-tmpdir-shutdown-611.20191003201314.tgz","fileCount":1041,"unpackedSize":3924432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlleECRA9TVsSAnZWagAA0yEP/i6DuuKB5ufZy41TNy/A\n8hYDJ6H9KG3Kf5odF6g9b5jg3YghsyJMp1UVZOiZjEpKy9SEOVdU3IaRhufW\nqRKpdHsnkfOjqtPh2cq82fOAPoe0Nq7adkFYwsxhDRUXPgdO2DGvD7uVwfSr\n20YWMizGGOIIbC2aK8CSSRsnmOPfMmMMaCqLLi4Z+jaH2AZO4xxdXbWIhL85\n2s2YmFyCIUSwSZmqOS9/+7ZoGGeU/yq0kBzzxGU8RhB9LuYgcgaIW5/8/HQ5\nMDdxe9MKRdJUsDRDBkXH4TP0H6dHYeXCuWeOsekVG3HHu5IA3xyvH2X4ERws\nTOJa+P7bzQTkBWJXH4/cPmvOiNCak20IvKLE1OBvG0wC6KSHAbVFu4kfzBBV\nR3UMHZq0qU/kHN92IhCwKmNXlUiR0YooX3UeF2g5d8igxjDmpbZdhGFkO2m5\nY61bEP0pexh23D0ygJfogiIO9OBLop8j8QKM+l49xGgTpL3ydbS5La4BdCxP\ni8aqKdCOdph/Jno+FK6eS1jni9BhgskbmV8hKLwujk88JIKc8u103LPQQeF4\nr3w39dbAdeWOkRrmehSx0gYrJ362FDLA6VxF2FQ2+ckryAbHYUUhb2+7Axcv\nL5GSa9KBsVmYbPOmkjBsjxaOzNWUAna0I54Zorr8ReF5/Q6bl+55ANQLAy3A\ns30v\r\n=7xYu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTbndXYbqY9hlh9wdOM0sBw/KkfdPbUV/9/x13+6wOyAiEA0b0hJHO2Pq40w/AziyvblPIIuH1L6gKt+64mgZdoumk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-tmpdir-shutdown-611.20191003201314_1570133891202_0.9486225054078978"},"_hasShrinkwrap":false},"1.8.0-tmpdir-shutdown-611.20191003203814":{"name":"@atomist/automation-client","version":"1.8.0-tmpdir-shutdown-611.20191003203814","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"09d245b816304c0e90509dd70f25dd45bff0f22e","_id":"@atomist/automation-client@1.8.0-tmpdir-shutdown-611.20191003203814","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-xFY/GC5eiP1xKGOPynokHc7eL1+PD8NZpCqBEiUv3knGlDQHcJagwcvkQZt1T26qE1AyhCv1uvUTBDGzTvcQhw==","shasum":"4f70a49aaaf97db18ebf23e9ac7cc0c2479dc667","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-tmpdir-shutdown-611.20191003203814.tgz","fileCount":1041,"unpackedSize":3924235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdll1PCRA9TVsSAnZWagAAyB4P/Riz3wz/uGVBTDXF9ZmO\nl1olUs4/Acln1V/lFguxxOPjImqOE5Ugch0dA+hn2X0tuaKO6YCYw4t842ar\ncDVvMMm5M+bA27YvnOUipHgpldvRKC+fRpdN8Ri5nwPX7BL7NWFssN96MtGC\nBGrsKVLq+qxbD/4UrdnWH5AfEv1h+986FVw5Ff7LiINRdNBZk9baviniy1WB\nvQuXgAHsB0GUbhto6vHmEju2eT8LKKNcqb0dfxEJ4ij2OL5k+UzD86Lx3CSu\nYsjjiP3u0uvXQsoBkyTfHNUGTlCxqEGhHkMZ/12tXSzWCHwjNCEJmY5G+4z0\nn0TPNguxE5n1NTndW+jpqBefik1fV4OOfgFVOnoZsK6/zE2BBLXJEwY8uApY\nvbLAxfUP2BAGtjnbxku5LpZ9QzzDtO5wBzHW5bF072ap93B23KksSc/WX5hp\nxnExqpCI3znNqgUfr4s18twrob4Ym5enPFFbgBJwBd4LGqj+sb3BhwpQ9wTf\nyS8orjpOl8xpt69JrBxIXjKKQcX2lxn90KlMg3i5gFn0g337wYC6D/C7mrSV\nTPIDx2/WSIOkuWNCXZ02GdhSYyEMBB3iPJ6OgARoZVA57SVyBlLYDufepGfi\nwZpjrCUDCd8Onz4ZNSlGHoXPUviakJG7Gv6y5ERliz3DHfXp5YAUVMSnk2tm\n9gYb\r\n=r4Nq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuDsaH84q6Da940ZY/6OvWv+CpJoe9otxuCy+0GQJEIAiBnQ0n3CnMtgoLd4W/R1QTsV3o7bJ+uf3O/aHLgHfF0PA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-tmpdir-shutdown-611.20191003203814_1570135374905_0.6489411862565744"},"_hasShrinkwrap":false},"1.8.0-master.20191004141949":{"name":"@atomist/automation-client","version":"1.8.0-master.20191004141949","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"add491374dabcc97d22c1f04404fc9406ab36c8a","_id":"@atomist/automation-client@1.8.0-master.20191004141949","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-mxuKG504KuxlWxMq2bQDxNukOXkpNPv4gxb6mErEhBLDI3YZbKztw7BvNF1zUuKoK9ddFn11zI4oLgMWQQJTCw==","shasum":"603eace41197e960232c3c3ee7c621bb09557216","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191004141949.tgz","fileCount":1041,"unpackedSize":3924450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdl1XoCRA9TVsSAnZWagAAnAUP/j4JxxlzEpMjfFYY/Q2n\nsyVnMoGd1PsF4sdWTNxOpKCtWoQO5jj1MhkHt+B4pVxcH+ahYxFOFOeluz/4\n+lHvfKHzR+nx/PHO7qPPMwrLtNBfnLoIxTAgsGVyPlMjN0X1tbIYrouLuHbl\nWhmh7lFQbru9PMzjbb3RMLkV7lLSAxLEzBaH4ELKqhYf3sLgr9rmrqakYElb\nRa8FGbRrERrRcdoOfhbYMt3zATeHo20y4WfGZofq7GJThal5lH8l4BJBStYh\n7eup41LCBiU5PY6ByQsF9k1rBRYBzr7hid5+pjlV3pYbhLV1fv2ADjqfElhD\n+0dTklKaRd8EOI0FVUNlllSM3NLTbZd/5sfRzZEmFBc9n6A9BgB/WZm/7mGi\nCqBZ28mezcMTHAOfVhUcazzsjLLUmlE+fpFQivsLBkOEUr2GjoT8kYcuEDPk\nYtrVwW0ZCppvL4+XychgpJoHxohNXBWEm9+DhWrWuKDACR4Cq5gNFlKZX57G\nnebyiGumjUvPijEMeWREovMcg/XF9urasXaMwYc+A9sB+INc1TiH1aRntIBN\nhGH0s4EgqSCqoFgBjiAx+yFcoXNwPA4BOwA1UTh1Ml/LB9Wpf06y5RgByJLa\nzXMifK3vOzMlMH+k9dWxF4qNHb95GEslftQtj51lJ6QxAE7Rfnd7D6d2nfJz\nYjMk\r\n=qg/j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzTJLbPERCtYZUfoZXHHZPtvX4btW45o1IZP9C5HgMwAiAc0sOVqY4yxCF/wdlQqRoxyr/xP69pPBJM4X87b5HhTQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191004141949_1570199015258_0.09109439010436415"},"_hasShrinkwrap":false},"1.8.0-master.20191004142305":{"name":"@atomist/automation-client","version":"1.8.0-master.20191004142305","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"add491374dabcc97d22c1f04404fc9406ab36c8a","_id":"@atomist/automation-client@1.8.0-master.20191004142305","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ng+i2vXOQ9GU/e/96YRLED899lB6446kBgLIJQdX8DlbOBwm0w75D3Qtgu7Ra58lx/QzCm5MuuAnKd44gUuUJg==","shasum":"5d8aa86643e84356a33d5ef7690db621881dd898","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191004142305.tgz","fileCount":1041,"unpackedSize":3924450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdl1bHCRA9TVsSAnZWagAAF78P/RIsBonpLzCzrsJphKV2\nmvMv3PmLL2io4Lo1IGqHrfvuinJAI6A5m8BQCoBY/utWNp54xFsM9+J7wTZu\n7ZhMmzdzD6x8QF3+tKTHq/6yneXS2+rvBY5audjY9bHtvOKNLG2mHA/1oFQk\n+uWXBYKIIAgzVuy95Why+OWS2RDPD4gPd09UUzoZWsJtPlJbnc389ItuovRK\nj4zg9AoO3umRUncVwRDFBBuEVIAtFVMLRJ3BRctSJBCtc7COQAxyeqHaPBRU\nqGctNQyLZf0ffQqug3Rzms3qapqr0MSHNXABcIp0qtl1RF+8mDaIIPNLkOlc\n/5HFxpWmw/UTTjFDZixqPKcsebq3k8V5U647yAUsypAbSG28RRVSYVzmIKRT\nH4jNsWFkgwdQKy6ykAjmGHsu6lNMPnBShe+YoEQR8SOlEXHSp4ap8cfpzsfs\nqzjvllxctZc9UXAYv9FDVZnYg5PsUh6S+PXTk77jqz3TPHr1CUIZ+rOGY/M3\nKT1JHBs3ndUbKIDAChn+pw5bXDF3xzoP8XAz4dsvlAwhwyjhUzR0NpgjAJHC\nhBRJbnES/dxOZl9uKW3KjwEICogQ879p9s2XT7/kZ1xr023pxgosFD/f+qfj\nSiRAFAE6mt3QqmMvnGwK47JBFStf8x0NygX36C5prz9OxK6FMIytesUskx+8\nBKTc\r\n=5Cg+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr/onTu/kVwkA7VQo67gRQA9kCyISXrhmSm4PflWqB7AiBJSJ0pytpPGyxFIIaWSr/kw8EtSTAdfN+l6894JzFfCg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191004142305_1570199238569_0.3723762124990211"},"_hasShrinkwrap":false},"1.8.0-master.20191004160448":{"name":"@atomist/automation-client","version":"1.8.0-master.20191004160448","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fadbf50b4ef9e7cee4d7eec69a18a086d4588e9b","_id":"@atomist/automation-client@1.8.0-master.20191004160448","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-dhwjHWhGhkLVCPZS1mOJlALij06DrMlke2NsFy/fisWNJoCdJS1ZAw1l3h1feEhu3xe9UW4+412rcZIlNDHlsg==","shasum":"7bf0880748d81bdc33d59282b466ddd329464a28","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191004160448.tgz","fileCount":1041,"unpackedSize":3922646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdl25vCRA9TVsSAnZWagAATvgP/Rlr6m8F+7/1EVQwlKx7\nnFcPaV8d7W1gZcY0tSUKAnBEipXXcGt3J5j1LvOgZDmQcYKvu0uLYfCrJcMu\n0bUy1JE3EkPxpI4KKStzpK6P+xcM4+peP4cpn9SY8COn7AUwpLUlmG9AiNAu\nBK2EFLZdEvPDG9u3sG05CgbFiIo1ATJABiDknWQgH7O3OuxPAzRVUVK+TyR9\nXWiXezmDlwki3DDWOEm+9FOQ8scs/tifujUSTPZ5hDUlvGU5HdF0xMwP2A54\nYIqaga9xbXUsorppo3w5A4Kwy1ewaPEGoBfcOaLLM7cWyb6uQNyfwZmir+8D\n/8+ikotNppHgkz/gL77lG7z1XPrld3TOu0/ABxAmtsC6ATqFu3VFWiBPPe4G\nAVgOvxb3t1LREEDmdbrV+AlnzFctzHAPcCiDvzOZ82P9oLLAd2UKhLBog50y\nm+NDc+QuOs9P6wuzdS6BPagxY1xQNkE90GcgDL8dFnIX1CcJU2O15W6OcVs6\n2RQz6WCrbQquzL3u7tPaJFVqzorhk+akSo5vZdFcOSuMS1tlJKTjYQegMzwC\nlyjvUmBIY3pBW79TXohtYNhhBQ5LejfibDGirXSlZhB+A2ab1NwSwKXmwuqi\n4Yo7ElVuBhNu6g+zXiahtCPUF7LJFi3Svg/o42R7hu/M/YYIj1XsE7Khlp7H\ng2G4\r\n=0a45\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBm14HhDcLZrhMyoxU4TIg1tqH3CXr8F41n1cFMmkyBAiBsxv5YlijObxlwhd2OUbP0wBVHcLzNQWlvNlKN8nf8zg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191004160448_1570205294964_0.011296501338418752"},"_hasShrinkwrap":false},"1.8.0-config-cleanup.20191004161850":{"name":"@atomist/automation-client","version":"1.8.0-config-cleanup.20191004161850","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"67e2cc9c1dc1a2ff9681ce80c18523ba7af8a089","_id":"@atomist/automation-client@1.8.0-config-cleanup.20191004161850","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UoqQsj6CXW1kMgBGlT9IzVhLot/C2K5gRgHNhh1HJrtEmhhOg3LuGOqMXi6Ogcn6Ubud/s0l5GpKZehmj4kvgg==","shasum":"739c91dd58887d7068dca736c1778a630adc0b14","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-config-cleanup.20191004161850.tgz","fileCount":1041,"unpackedSize":3919679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdl3G7CRA9TVsSAnZWagAAxfAP/RVBpqeb6nbntopr1ubJ\nAEXNoZ0RaHQJ6iqzuQgYYSCnLHIAU9ae9fNXs6Y+fw0MvWP9KbJ1DA85jFnV\nZIGme4DaJAvq9kQStyJyE3c4E03NIGcxoPchTvSLZnVfA7BJFZvpNKXYg7ja\nA8mMm15slnFG5eDBoPNik174JyhVxMsXbByli7zqqufr2JW/6jPnvqrViEnl\nt07gTgrtvxfBb0thkYzvUWnKgFHua+vSQn7rsHaFtqHuj1HhNTXqN2Cuz/gD\nHubw8qbbAFa7imat/XBLbMQb2zSos8VPr0yFwthgXsWeuslpAjtrRsyWk7Bv\nt4X5xJd/F7eScrGZ29hJtwMveyS1ApqMmNMOSyUbzrc9V0xKjWYpMZ11W+4l\nluHOgb2k/qrW2NYAD302MAFE/LqGk1okfFKKco3RX0Xqb1JviuCtE8hQ9QeI\nHiaV9d1IGQSQFPtlp7FXXbyV1AXQ/E50dO58yckKtSCyKbLO/N+bfetPlrHt\n6NkSTkMpg6cGoxmnCQXmiyMPjqCrK082HGF4x3Jpt6O4kPa1rSkIb5WryBsB\nK4NK66ndUwPKThPapELTUzLVzltABi7/aK0bO5IXqMoE9wX0filwWyHsPsPx\nmxLtkfKfZlayAaOvDFOUQO1MEL3SSJfr1jWqog7p0SxG7PtwsUaML2dzdPbn\necu4\r\n=0MYT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmJURU8X+fk+JEQVmFf/C3cjBYwWSgk5BBTC96YT5IRgIhAJliR8iW95nyKw+OPHfmaoYGJ1Jx4Z5TaqIUqFUwvl4z"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-config-cleanup.20191004161850_1570206138510_0.21523196602032502"},"_hasShrinkwrap":false},"1.8.0-master.20191008151038":{"name":"@atomist/automation-client","version":"1.8.0-master.20191008151038","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/plugin-helpers":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1d4977da6a7bbe1825956700310d0b76bc6dea1c","_id":"@atomist/automation-client@1.8.0-master.20191008151038","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-/a25G8GjbPipnJhT1CeHy5vMNkGdLflBszzaCNgbGykW325FP+l0drAZhq7cNMIojtFxf8xAjzDNIfMWBd3EGw==","shasum":"17a028fd8e2a486e53062b49b7666712ce6b4ee9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191008151038.tgz","fileCount":1041,"unpackedSize":3919777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnKf/CRA9TVsSAnZWagAAOEMP/0wyePMPl3rjvH4uvbEW\nzSMlPRRxNE+vM71mHst6607UtJDCpIH9cTrPOAeN5knCyNq+07pxzfFJzfbz\nAHQm8G6Q8Wvw9D0cV2ZwIaL6U8wmC5GZR91CzcRhmYJ4OkcMFtXBfd6vF0O4\nJODq5a5a8jplYiy6dj+9/rB12m38+01t2/XJHXYkbAIz4Sh5gI5zWAGjsLFm\nedoUqhQvJbOiUvWt/xoRJex7N5vrtJ6oXfkXXTj4RiAwWND+Qfxwl71ziIGg\nTHrJUzLZQN4t8ptcigPl7PzpuhpZb6uK+Y4Za7ppVC94kjLNFzSx5sBi3jNy\n3Ug0PdTmKFG+hcFspIYYdFXtMlSv9dTmUUPaKD0bmwips9P8fhiD/CAssIGs\nN7pynhnMU/lOcXPns0dMWqAKYqmDuqcedvo1CEtvKwbwMCUGqIZyDKikdTQ9\nsRQVvZqOSCSIWBwqQIoLK54JluBLy/KRG4+iAkEImBfgiQbhYO2TY7M4ZHjJ\nj26wzNug4hs7rQdT3+48vBmo9Q0iy79EQywihE7b4WUcCwmsaO6+R1HdqkEy\nH8QdMsYYIW/HBlsoWk/bEF8W/sQAyDQPUBtgvM8ePE0xhWCJaARhHafPDxuI\nIUmfsix+shxFat05hXjlN956U/A04rqRNQ83jVDCALALgSYvWIRwbeVm+1Dv\nnAsC\r\n=oL7z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxwEeEm3zlAv8YscGN/40VlVb3kA9ZyklLiPtdsbDyjAiAUzJTQxi2qtohIDMqtqJ1NVTTHFGo54Y8C7ExbL8GPcQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191008151038_1570547710784_0.6782707146574827"},"_hasShrinkwrap":false},"1.8.0-globby.20191008204458":{"name":"@atomist/automation-client","version":"1.8.0-globby.20191008204458","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"^1.7.0","@graphql-codegen/typescript":"^1.7.0","@graphql-codegen/typescript-compatibility":"^1.7.0","@graphql-codegen/typescript-operations":"^1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.1.2","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"61bbb5dd4b076b423c3b18b148e627d537923489","_id":"@atomist/automation-client@1.8.0-globby.20191008204458","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-O7IG4j+aG7QflAOiQzHHJBrpI8BWSUfwTa4H8FUAkjGtc1UYebbdExnf1+s3RSnrDpIowJpp3PBa3TYiIaRvmw==","shasum":"0836e826ccf2c2dfcfe09ed882d88d68d5f980f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-globby.20191008204458.tgz","fileCount":1042,"unpackedSize":3915353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnPY8CRA9TVsSAnZWagAANHsP/3D6z6ULKyyYV0IjtiKU\n/Lb/VsQV1HDbNqeN53k4J90yl8a4WRUfOd04Jn990t77EOrphW+1/KL75/BH\nFGM+lQR5CDLlEwN3MzdrSf/tRykkO1pW6b1PoJ6j1T+Gft3dsm3bkRtLji9Y\nkcyDrVJqoFDuiR/Lb0u5lXOVTnebFca7pYwO78S6smqp+dyg7rgqmXRSv+bp\nsDl5Gm7lvr3C19ZpyrcgYiWAciFA8M02WcaYAgcYi2eYuLMV7W/TJKab16gp\n2GZWE0MIysUDoLB8SBfr8j1pWgKTcOvL+zJ6rfzHc80OgS19oeH+IW3dTdMN\nWHAATMRcT7akduPnozlKC/s1lSmpFwcu8xTCZU9w89SDLMsJ2Hp7uxub+dQv\nThUjd8FPTBud8++9YwxF1OzaY8Rm7yUzSJ52Dii5zarRiQW9KfgpUCwVKBUp\nkkJJzazVTPGg9iqRriD5M1QptTQDSUceUyrrTp601sCcbYQgNzix0aqVyLz9\nrQFaQ2MOovWG+m5aEtVd1jUVNnOO0SsIJqXBwReawwfdZMpS+73V1FO0n4/2\npr9lGr75sTn74P5A/+Yg09+DzaHIQgXxCPuiri8S98aPd0aJhc2C0msMY+Zh\nsujlMwI/ThHUgQ+qTRsTFn+uxo3c2xC5v5qKFyOUuyLq2LsYyxvcs6a9s9f1\nhgia\r\n=TDHd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgLQUUFJf4ryOCrxLN6BJITANdEjPrmAlpt4BZJjVliAiEAkRRch7Vm/7jYIlyjXLhPb46jamzD/m1WvW2IG1ySA7U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-globby.20191008204458_1570567738763_0.048572497428730266"},"_hasShrinkwrap":false},"1.8.0-master.20191009152926":{"name":"@atomist/automation-client","version":"1.8.0-master.20191009152926","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fa8b1731464cd3660f4ba5b2fd442c0d0154d530","_id":"@atomist/automation-client@1.8.0-master.20191009152926","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-9CFgJk81cfO6EpgncyyMaT+M4SENB5iAEQpHejhnyzo28qsLLULKOKxt+OKF5bJ5sS8r7LAwY6zmOw8L/1A1Yg==","shasum":"3c623a4c918527df3790589031e46fe78aec4794","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191009152926.tgz","fileCount":1040,"unpackedSize":3915248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnf7cCRA9TVsSAnZWagAAsWIP+wStoIHjyZOgfcEd7WsI\nuPwn1SAGVhNjXXCNEq1C2uqNaRSBwUT5C2yU2fCW1pVsYYffnNOO6VoCVAIp\nzvONqfSRylPATiSbQ40VkHpaHFGzg2HR9AyF623uzYgFwb+53kxeskH+ZuGe\nuQ9mOrNu2OTL48FWoxhyLY3293gsyHPquxyh/I47fXOQzFo54eQSDGgqz9Do\nxJvfHdZExSCArUEMk+8Z6tHnwZUk+O5hBy/TtZcAS8UdEvNlwi6R8T+P9nVA\ngY4rCAfQ/2dNRt8OJoz6Hnzhwc8Ck1ts1VXMD0ScoD9Ae9hTFk4bBZWTh8xL\n7DZOAlwmD1mTTNjnEsCnJNY4U3Cdzt6nnEFoI4y6zsst5nxNmFA+6S6z4Oob\ndQptf/eqvdSUf1TI8XZf5a8lQa8WyhCS3pupFtE/exnIw86EEilFaeiCmX5w\nxgUkss7Mp5jgd/qwhs+GlKmVFV47hiihdxQuiagZWDmP8Zhx7Zebe1h/P9CO\nUhaadaG7i6g3Wp7dO0Z96wBmbtoxRiXnBMgd48k5cZU9dmHeIaX5//chpRxE\noEfQRGKcTYzBd/QzBAvfKNLIc7tWLEVbVb8dmnLXusyoS6YsCrJPPLPi6Pm1\nf+UL81yLsyk2lV7ptSRAZR10D7AByvqpUUe/PiwEsikPY0PaziPPcnJL+RcX\nScQK\r\n=sQ+t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClBRCB8Z7Mkw267Mnc8UbfDbKkWo5mb7zz+jPGqcuBxQIhAOMOK4RTO2dgtADV1C7Jp5oQxj1jkNenbkUQjsWZzTzp"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191009152926_1570635483641_0.7305852506969004"},"_hasShrinkwrap":false},"1.8.0-master.20191009184515":{"name":"@atomist/automation-client","version":"1.8.0-master.20191009184515","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f61525b84703e745f2a2d19adcc76e2c9887af20","_id":"@atomist/automation-client@1.8.0-master.20191009184515","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-87SgUhsLZ56z6jWftM4zX2mpZvAw9dybZIfgxewXLvfMgqCRyhHT/JDYhO3S5QPmE2I1jRhg1gPa8MG8ojZYQQ==","shasum":"ff3adc9981cf46d847976830990a039625e513be","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191009184515.tgz","fileCount":1035,"unpackedSize":3915071,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdniuMCRA9TVsSAnZWagAA0D8P/R94sAh14kFogNGMbWig\nVrtpa3K3GGLQQ/RM/YLi4agCqGwvOOThxLirpv193hPYlDHk925OzVGqIoJl\nz1nV3Xu+CgJYoF0ek0iY3pK6J9DKULXNWBK35t3EpkSi8nqy6T9ahQDMxY9B\nDouBHGqGxKpdD+jbdzrckHpdfJqgnEEr//W1tB+awNZ2y32DdXTwJKpxGUWu\nycvG/QjTf8X4DSp6lLQgyArxYXkqoxoh0BwljmlIu2/lGWFaSZFWjjTdvDI5\naozIzDr7u29FUczdkxZPjtSse7A0AS9vj9Z8rTm/Ej0JHwyRwVI2Wx/g+evA\npHaAwTeOq1WS8mVC9NW/cJH+ZCLxrnpaaR55cJFtAQsPI7ZKumTgmtW4ixQF\ngedRRW1i14eXjhYlCVlajK7yExOKOvutpXdmiyUKeiDzFI8Pzj2thU1KFO8k\nJ7b/CSuT2xmb5Tfh0ufCsRp5qKVmV3mZgXv3QOTffV1bAd3sNTsYwQZdsdkT\n/po3xgEFSK586WstdbHlSOvD1A5LA7JXRawExzY+emN/Rmct/BfvgmKkMtmq\n4LXbqJD41hthA25gPjhMUyuv1Jp7t+bYJbXQHseAo5Woq0VIiU4JYviDLfMC\n8XBkbmwIQLU7gw0vfe+WG8gksiYB2KnxNeGJlGZVP2tPhzWdAneSbS58M5pZ\n/6nA\r\n=/Yjh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7Kb93ACYLAqCcsWrxP8zZsbj2y/ppjuhHSnbyu2vjJwIhAN7yUa/c0F2YFP1jLYQRG/0I+T18URPWQn4ANGlc80k/"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191009184515_1570646923845_0.33727059950553495"},"_hasShrinkwrap":false},"1.8.0-master.20191011083000":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011083000","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7ee65c6c4a31bffd54278c3132433af2b1144387","_id":"@atomist/automation-client@1.8.0-master.20191011083000","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-NK6/qT+lcf6PUqqNyG7jhllYK9pgHHAGSaO/hWZSY/5KjzigCucck17lPIMhPZ62uO5VoYl223cy85ugmTOPDQ==","shasum":"6e42ccf18dcb7f1620d894dfd828d897de51c37b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011083000.tgz","fileCount":1035,"unpackedSize":3915367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoD5QCRA9TVsSAnZWagAANOEP/0wkOAxcwm7CzB9xfBKd\neDTkO1dd8O5ILtSFmXtprOdFGYbQG/nfGmt59cSKTk1i1JZoGeHIFiNkOSjd\njACLerL8NxLi1yQQKopusDvPox0MofbO7LJSK3dBf7I74ge4PiJI69z9YloM\nrksRIXE0uB9HwQUGO543C8wS6fmBqCtZf7XaMu3b7wpAwgD2l+1bihUXRb2o\n9bU4ey+dRzeXTwByLgyCc2095KMTV8ltEJsc147kyZp5HT+CQg9leC2JJyDV\nsuVUUTy44FjuUK46QGm22SSHGeREAM1F3D3Gj2t7COq4dGR2BjTQQHWGk430\nz2925vINm1CRyzF07tR3PCkBiTqPNr+As1Xu4v1YgasWPWXD5kjzZGaXEoAz\nf+1nvMct25SVxP6OS5wuQbxt/8fjYoKzmh1wOzoCKHnA3mt9mNNPYh2AsWbI\nLZI4ZLc0sd8JczRgj+Bi89e/TVKeejJGT0lMtMnojLsHg4fbch8RcmLGGVFB\nIkDq8bbvlifT2PF9TkEWTvW6cu7g/9/7EgiaQu/3huxr73RKwzOqga6Foe5Q\nda7O20dBAUym5iNcoGuMQ7C+V1p2GzB9d3eN4bw6ggSvgLG6Y0AczsKgbi1E\nqCiS9JhYXY6Nb48TumxhwqxBmCbT/2p/X05zGaFLMB41hrKkFrupfskaB9DP\nchgQ\r\n=3ea4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAP9kWO84bkAa+6nKmr6+477LmoP4xzuoXqyv1QWLZjNAiBU7J72VVTm4SBvUnMJbi6NQmhi2qJBRMx7YG1UqPU9AA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011083000_1570782799465_0.3861811295744564"},"_hasShrinkwrap":false},"1.8.0-master.20191011091303":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011091303","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"14e964010016cec3bc5f4c5ced52eb79fba69102","_id":"@atomist/automation-client@1.8.0-master.20191011091303","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6oEW9z23U9leFuvwRFFF6rHeTpoBpMZSk+a6hLIsWP/kdLrVDt5RKm1u5Pv2Cmh+mgOESSm+iBWHBGMt+vgphQ==","shasum":"5c9436411ce3346b595b4df3b3d3819189c06eeb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011091303.tgz","fileCount":219,"unpackedSize":2431875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoEhYCRA9TVsSAnZWagAACbIQAIcpZP3lGlOeRPEOByE0\n8ckSavM2D5a3XOmmWJf+4tpBQdWgja78tHhbpl3fzlnOC5nEMq5Kl1zmob+j\nyq9ojv8R0AdMM/vkRUw7IXhwVGzqNalkMFFXD9H0+h06hfRchmBuvk3TeXZ0\nAH8KAsdqacNWCJehNWGnGWLzROmnd4KuyzgKeg0bt4rHkCt50GTPHgjkUjo6\nqnuXzWoRDDVwqfmtNeXMxVoZlpeCAWOEGnYhLxShQGgx44eAok6LVeJrUwie\n06j2uqiPKR2Z8nd6LB30tB36mhUxF6PX7hL2Kh6KBKIdNaeY6qkjVbDw5HkM\nR7QT3fDnPo7Upk8chLoIvvF8pw3U3amKK92Fe90sQQ8Aehis/DE+97USCQiG\nSuA6AP5W34MWzcr/LsK1DhLXpoRyMpnJmvJPqACCL3jkWGuAoG2/O9Q2iuzK\nLbEws6Wdd3ti9hJf18IqShHZ3kv9FduP1whztEwTjoiQyAr6rL/DP/PPj1tD\niftiUHQm+Zp4b+B9pShOoKr7UndoR1PY9H7m690v+RfiYACMGJb9WCmABeY0\nhmaxGDj+xmhu+SwKVqub8RHVuJ46IdK07hOxFChbYvagn35ku8XzywptwbNM\n02z41yIsxyB7F1k/edMVrBYobl6DQ/PLaGCZSGegNpPps9a818Su3pMEiQqp\nCCBi\r\n=l7gx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5DzBxCxK/4dKv7TNA2jxcifR9MoYGc9JNAd/cRrUX/AiEAqMnoApF69twlp3OBHTNlFRKusHs3ZR8KwySw/f00yz8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011091303_1570785367661_0.4308655297757844"},"_hasShrinkwrap":false},"1.8.0-master.20191011094832":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011094832","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9778a34d375758be0453654e16432894272f784d","_id":"@atomist/automation-client@1.8.0-master.20191011094832","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-4dQXfNDhmSUAQRWu2xx12oR7ZF8mdxm5DQbVmEwdYzTEbfe4tIBlmJKlsJOANKcV1ZWNAdvoo3tYuGmjNeIF3A==","shasum":"0be2bfdfb66cf5eea8891c3f3cc89a395e10fab3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011094832.tgz","fileCount":1035,"unpackedSize":3919001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoFCxCRA9TVsSAnZWagAAJMMQAJVJwDfIKEh+t+M3LWSz\nQArSUvF8W/8aQlDvXaYssgDGdCNNdtYJlyXdnC5guiCBQSzJNHARSmhfJ1cJ\nx6ZiDxidBwIhR6OzYEkrkcd+z4dVf4j2LXLWCurDxirMGu7Ooimf55bO4IfP\nn7UbkAZfD0vntL0eVROwMi0Jgsqjq9gjjN8biQ7GaQ3LNey0NiFEF3zB7I1E\nFPVxX/5/NmcJzmCR989SSHBvpQ6ZvxO5M8F5OasBPLyKcKqg98jpQWpYUt5W\nFxpya6u7a2L0JTUYvTx32PHze2PhW2a5vFJ7a2qb7hGfpzmdVHQRB0Ub3GRy\nykoT25SQHXbA/Ss2dC8kx/UlqgUZ6IiCD8mGp03Qb0ZWwCJKl4jw8zD3GK1J\nr5xrTIz7HFlFtE4/A0AUQugzpd/ts9LhpmHha4VE5laV3sdob58QbrN+MxgM\nmO+ew8yIJuXol6r4hBp6Gzui9YDnnuOIF8lKARjGKlMt759M9lVKRx8OqL75\n7o4/0CrRSL64MagOrkiibePR0tFNQaxiTyEVUqZI+bBqfC0QMouhxu6Vjl7b\nPiJSTHq+KYLZUW/yqsX2WPbsDleSF9Sp6bsJlQcpKkQ9+M1U9ng4mye2tTS9\ni9P9pIMb7oofZI4teyewhGKC002VqJrrCTl/OhpBNg66Lp90KOXQIWE2wyCv\nlRaO\r\n=MieA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLb211szofRWHNtSbxg7i9gUVxSHTehfBB+j9dBXgsbAiEAi35W55cHcA0ic1Q3LY7ar2d6B9S7RD4NtwJgG3aiUOM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011094832_1570787504481_0.32255031647398713"},"_hasShrinkwrap":false},"1.8.0-master.20191011095025":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011095025","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9778a34d375758be0453654e16432894272f784d","_id":"@atomist/automation-client@1.8.0-master.20191011095025","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-wMFGkDz+6vAW6FwMTJ4GZOyHC2TQno7RP3iqdE1X0OPFlPoDQTyoKTzGDLLpTPaQGQvvqZ9Etsg8piTjP8RUfg==","shasum":"23b78210ca538597bf179f5c46235fc133ad334b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011095025.tgz","fileCount":1035,"unpackedSize":3918982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoFEWCRA9TVsSAnZWagAA+38P/irDXovUGeF5iXpt25Vw\nLxOTEzmKSUJnHJX1VP8NaBJ6KhErnlNSXwzvYvcVxwixKmML09zW5qSqOihH\nh3ReQOeI42z4dlw+5hY2EZSrYjCdbirSGfgvCO1sVK7Aa7UwH0/nCcDYc9OB\ndcHUjNlpMBot4MMj/hf5sAj6X1ya3hZkIiviaQrJq8JKkL/+zD5tWYWRTHgf\nFUCLimKuhE4BRSWQH9mZ6XdYuI0ZxWJ9C1s2Q62AzhTIoykp/X+DmhQauCfw\n/XsNEWwsMLm5CE8wzfgvoUSrkAQopTO8HcnWtI4lAVhQJCfM+2CfxAK5wyP2\nTsA5Ov6i//Fg+vATE1MMNwExKlHEVEEhDoe1CnhvNCXwdDhR+tXHlH7jThpD\nboXeHDAiNyb0cNiZI/uEAeeOPaxozD/6Vl0Rq71iPvkuc/2loyO3Jm1AKPec\nfw5mJSqbibxKKejJ+hGob3YE5O5ynxRurUluMbkTF2CTdyL9vnQqkjZuhfsc\n1/8DGDJDvU1X7SfK9oySmJU4xXjCDoFj01AMpClBSv04UiSlarzLwCYoB9fm\nlc4XMINMhNG2TjPHZsT7vpnH4HyNhzpzrRs2BdzG6nps4Uqdb4oFLoY8OyHT\nnbnGftHvd4zlwI9D1gH6oBaXmF8hAo7RRpELvc521yPAVmU/RWCrwN6ZydKR\nvgkP\r\n=mmB4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxDhDmyFqEjgU1SgIWGH7HBzapFmzt2SU6AtzayapZkAiEAjKeIDDkF0/nK56J4DkswT97/pS133Cml6zSlcNPdQ8Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011095025_1570787605971_0.6852469755371806"},"_hasShrinkwrap":false},"1.8.0-master.20191011121753":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011121753","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"67b128b58b003eb78d26b4b58a3c654d08103ce2","_id":"@atomist/automation-client@1.8.0-master.20191011121753","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-97FBAj3sokC54ULUGYIwuieRPaI1Lsb2FVbpH5aa/p+K2DFQQCDPap9W+o1fSC535avS39XF0wS33ohnU3//iw==","shasum":"cca4fb7491c7f03c09ff39c637e00242c4b00729","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011121753.tgz","fileCount":1035,"unpackedSize":3919097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoHOfCRA9TVsSAnZWagAAIY0P/1G4PKrkL0+ZOsETR+dq\ni02QZffMSh/M8T6kUx11BDOfzuDYwM2ZbOFTXTGm299D+zfD8oCuaITDgsqC\naFG4rVndSewB389wTcYNJxtPN6pLSFoljvttzAlwaqFalCnRqo4I2VPa85uJ\nQmnImzHdpXJsz1f1uAd2BPEciWKkbwKhdKEqOuNXSVdzB7EZlFxDQKillGEv\n8N3qone8b/KYKYmadcHZkuQ2/VHI4lNoe2AAxOmt+juZ3HNwG2VMvuWuQ2IR\nGn0fX5A8Yk7ctTw1V1nA/JUvU/k9QowrWFBc1auYYceeOLRyeunfXoNyywG+\nTJPeBfmps/J0csZPCCqG7bTIY4A9Ke8e17p0fGawLKh4MGGn918t+ifKWYHR\n4V8AZ/S2P/QLuAs+3vp96y+lgh3hPi/OB/VDLH7gkPaHgIjeBJnRN0dodBOv\nGlOdn+wDJ4zNBLmTvyjN544VmzyePWkWNIJcRHf6gKbMd0NkdszjOQYmXsBX\nPmy2T+ZmMZ40YgiRME6I2ZtpAUPvfaNImGXRY0jM8usm9+uGjxDiRw2TzbFZ\nIeRzLUtzvWC36SVcrSv2aay+VmDiubZ6+ZF0SYsrsveaHV0yHNfYDTVEVhv9\nGKT0HaSvYKCeageZjlot1W+vLd1i08GDaMbiUbwe7Jfro4SStqaO5T03KbJr\nUdoE\r\n=dWxp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCu6p/QUi8g3Kfw0fuCrtkLMbL6qUAC4MWKC4LmPInhIQIgJd8RejHw4TKiFRQghI8jMpG1xOXLppCg8Jb11Y1830U="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011121753_1570796446913_0.5137089297426596"},"_hasShrinkwrap":false},"1.8.0-master.20191011175049":{"name":"@atomist/automation-client","version":"1.8.0-master.20191011175049","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4d1b4a02e6c837cb0271483a723655c34ffe201d","_id":"@atomist/automation-client@1.8.0-master.20191011175049","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-WiJY0kRh8PjkWmnJZgeNHWQZ+J9Jv829bipIdqOhq0knAL9L4R+9XTd2qgjuronMdQiTPUP6eSpBL4SgBRR8Hw==","shasum":"7a91ac0b3ad194ac54ccd735a4abeb9daf4b9241","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191011175049.tgz","fileCount":1035,"unpackedSize":3919314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoMHrCRA9TVsSAnZWagAAQxYP/jfzfu9LZqscbeiTFU0W\ne6R2D/56Dfx7fJ/5+krAwBSImnJjFmygcDnbPGr8UcpUiiV9QsnBnVcW134y\niABUTEJrXOC4N+UpeBtayVo3CQ0/OruNpTcAlQDkaSOt3tNlqzHGpiYdL/px\nBlHGY2pspCKumCeymp7Dsab4ruhHCIjDlndnX9Rca5fs6bd4vKlG0YBttaur\nBpHMuMMpGtTwRptHsOffSUJftg9OP2Q6Q0IzrbVDmFcknbU7v9n0HJoU942a\nDlaRgzVZKgL0QEUdXe9gRl0cFCvni2vcewV+SKHv3fs+5YpKgJIG4gdqdog2\n9GqvV09jaYi/Jg6+4rldPkKJcXDLu8D1+7RVf1N+EzYiuR03IQrJQh2FHRWy\n7+shyheClfTvtvELnTY+sse64wRVPl4Goq7A/DNWOIiptuIWyBvVWAogqMpE\nyJUtlEs6YL1z82d4MK9FwVidoYn8qd+RUgDrfM9cfhOvn/P3lazc8nETm5Lx\npd+ZkICDpqvJwHoZ8Vk+q75x/KchDUV3m8vrx71lyUnitANQMRjL18pm0b2i\nmX8qjBSRKLKeYXzmpxaDKmJYfiWm2U493uErjZVEZHg5jUGNYy++e464vzHC\nnjvyHi/KX7zjTDRvR4J8jlijFj6gokFHrO4I2VDcPxLnG2w4JTYucv5KqIDJ\nZ34y\r\n=BMYq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzxPCHzrBn9wrr4fzO43p+SjFeT7HX2qn3tvhT8DVwXwIhAPwGHevDrDsGe4f9XHVqdLtrwXnGWximSEq9l8X/MxIg"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191011175049_1570816491050_0.06783048292703886"},"_hasShrinkwrap":false},"1.8.0-master.20191012160206":{"name":"@atomist/automation-client","version":"1.8.0-master.20191012160206","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9e3128beb76cadf5bab6a24ed439597d4421963b","_id":"@atomist/automation-client@1.8.0-master.20191012160206","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-J95NHZmT4oBd7hWXpsgCZy/gye98ezxyiwzZB9/cHogNV6bQacMvhvShkWnyW9dd/2+OF/EcyneMt3C/MCnrVA==","shasum":"9a3688d5fd05e5fd07d835e4998d61d467f76955","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191012160206.tgz","fileCount":1035,"unpackedSize":3919445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdofnoCRA9TVsSAnZWagAAd84QAJ3efRdqS5CfTqd9snHC\nMLbw2KgoKIm2hR5UoNJfI1Am1x3fWWDthmnPau5Td6w0di7v6n4FPqdzSy6G\nDqSvA0N/qh0HrYuZVa3/Xe+9ZH/XwUY0JzabUZQE6SLwJvqATyF+EK/ojdw4\nCzcz64Raj/bGoyHPzTCdMZBKqhob6B+HyV+pz+ThuSDqD7uwtgb6jh640F7O\noN4Agri398F9fM1labugXa5dvPERgZ5NwkVx7L7lkzEHKLwxNYj8mLRn46EU\nLuvYiUvAvUGTwAvtqgxQfixh2Ezi6CiLzTH3thEpsWTLLVrDL9FNQQ56RnSP\nOXsqZp7RxIyYWxhozkmSRHOjosRv5JzYd+ftznwL1+17nRGs5/OQViwuWU7V\nfQ3i0evIOUyAx5QKKNyQEbmjRR8/SQ9napLKEqHpWpvjF83dWAoiCzyIeZ1E\nhz8lfgPThpQdlpHTBszdU3UbcVpZxn9Nh+QiNgcyYBLHlk5zmx1nPoBC/Ycf\npUVkTfpYuIjpMSE90bz0n817lRSBDWEFcSJAla6g/eQ6rKcGbzBN0ixKD3Hm\ngq8MHyEeSEXfirMoOhmswqn3lzy9puiShfMW5X18qv6+Ty9m+P/tcBy9bDUl\nqunzm0IYY/c9ZnwpWhmYNxwRuNioZBldbAgXTRCVq8iRSabx5J1AQIgYvI2k\n6FUJ\r\n=sL1v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFjHCTaRkkWlxypKIvA7L+ZrALYRA228Udb1OED6lVHcAiEA0NRR9u+oIyS9LZ9cdHI7CzEhOotktGVSYzvrglwV8wI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191012160206_1570896359256_0.053934436651283946"},"_hasShrinkwrap":false},"1.8.0-micromatch.20191012193417":{"name":"@atomist/automation-client","version":"1.8.0-micromatch.20191012193417","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c9671a698948b6fa5370ba326653006a0a279a99","_id":"@atomist/automation-client@1.8.0-micromatch.20191012193417","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-cLTngcDh+Nh3hhOxUH8jloQ0/eM2tvJZEyMqYtPoksK2WaEeZQoSgdIshKgvFvDfb15GrWiQIaNADnyoTJfARw==","shasum":"7e33f535304e7102660f6502e2e903b1886def70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-micromatch.20191012193417.tgz","fileCount":1035,"unpackedSize":3917386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoiuICRA9TVsSAnZWagAAub0P/jMN2noz3PcqtZlU1M0p\n2PNSMy2XXTRAv2xUgiougzOG3zRMQCIBnOg12aoJQdCgcXAGaUpZF4+5DEcz\npGwthKxhMvx/+f0lew/cyMojWL1vwSq7wMiM6Ewn0YtaGragxPLP8i72mHH3\nhPPIEKEdgvrqt6lHjco4lkFlSkf6Ep7YbOA1RgVzjfkNHKlrtbHwLPFVVdRo\nqohgpeFYG1uFOn0ezvGnxAM3b/RLjC5nlRC0dKi9AZmvZY1w+Ku4Y+K+gyKt\nGLu9C12olvOsIcoLq2JWZ98fVIb1+EKTCIH2FaDUSo56cyDk1u41Ury+wN9a\nntUpjbY4ddKDauX5m1dmLeomeoCqxXaFJA6d6zCSLvYwqVZvuc4AqrybGQBm\n0rOaLxpfkbPM0IRCmfD+IuVWpm4aLIqF3m8sPTRKszMaHjhctoBjowMWBhyV\nsMHw/0fpU/eY2CoJpm0b72W+9tMMdHIOpgHhJihabgh9orvdCLVR/srO6Sal\nW1WCjAfo4sDoezXsVxu/RqL00foq+NLsbd4gi701Il7LwixNb0PWA9jEbYR/\nqceUk7WunpGbxTZvBTYJKLxNPGdFMzgBhMu+gioFSbjneuCeepHeRVRCVL4g\n3KTCjunpWO6Q2Wye83wYZihYON4KV+/e4fmsOq5ifla5JuLjymfZZRkyIfQK\nfh4x\r\n=4ccD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDdPksByujLgo9xr2xY8es8vcH8MTZ3CEoPoG/Jmy1ycAiAgMjZBVQ9FBI7lUgBqgxeaDGrjssfUB14quSmyjKfZhg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-micromatch.20191012193417_1570909063982_0.6281100451335795"},"_hasShrinkwrap":false},"1.8.0-micromatch.20191012194433":{"name":"@atomist/automation-client","version":"1.8.0-micromatch.20191012194433","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4384d6bf0c8e8753c2817171f7435f3e2e93c8e0","_id":"@atomist/automation-client@1.8.0-micromatch.20191012194433","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6efNFd2jlptsOVbjJ7ddJ9l3kq0D4h2cN61LE60/CbzkUpg/7jTmEXdFw1eDc7szZs1bxwcjfp3i90FnKnE8fA==","shasum":"e30eb8fcb86bddc1d25b37357ab8f977a12d4936","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-micromatch.20191012194433.tgz","fileCount":1035,"unpackedSize":3917517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdoi4ACRA9TVsSAnZWagAAcJAP/jLxbQhp7J3MjbzYcHi4\neBdco8uX5k8TCCBXHruPmnRHYa0m6eikzOMpwWS/z0nRgDEXASXFwbOC8N5F\ng915H9Mixk08W1tGfMMao0esbLEkm5hVwmRAfiX4GurY9KHo4FUF80dm3ID0\nCbPmVGDtoEvVdhU3SFXt0pe4GZXk8yy+JxKDBsAJlFJGOwboDph0hlhYET8X\nLeh084VSt2b8pT8Xutqo5jBbhRuqrWJtsP5wDHI5SRvZgs0gk3D3nRTfmIxu\nFJ0L/w8XLmFIiNmxZuVbyGyvqHQi/r/5k0KS6PlZUqoN+oRdwuzKniCJZRGL\nSVsI0BEba8oh6Wges0cg9ExtBCrk3XzuttiL2K/55Fg32rVxQPKrf8r7SDZ+\nZV3fD6Ga5bqv2ZJPJX+AgMApgLtJ50yIX/AVD6vL9yLtSiXI4MSzt2Kn8hGe\nDwd8YdXeazccl15NLiYursQFrh0hefnIcIOj1J5MmjlAGP71ebehfebckW9s\ny4/8m04fB6zXDC/ryf/Qxa6/W1gRYMuxVbg7SB6X0162p9QNaxv+hjHQshhH\nQAsWNRY0Dr+iuyRfeSaSj6e0/1XpHroRKasb+VrPdef6MJ72sixozxAZ875O\nR9d67RdS2e7eLWgQVIm4UwGY7Gnkw6O02n4ZroMToEAA06nQsDv401BGPbZL\nbCY/\r\n=WRyu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIED1cZ4IhNYKtTmKlPcxdRYX1kshHndtSz0CgzTx0yeWAiA2yD3cltN8PbMur/GYbquRBKyIiPNe/kyT6cQxFYssVg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-micromatch.20191012194433_1570909695530_0.004625213606283207"},"_hasShrinkwrap":false},"1.8.0-master.20191015143721":{"name":"@atomist/automation-client","version":"1.8.0-master.20191015143721","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0d78de58f9fc43f4e1589953d88e7d36d3c9f6ec","_id":"@atomist/automation-client@1.8.0-master.20191015143721","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-HPwZzADgnrb2sqWfsKb1pLABT51wce1gzAc+tnNJm+FL9vRmwZNTTlB79m1cgH3VfoM+A6K5AoP1a0wcq1ck7w==","shasum":"839badb5d6c06cb56a7b6cca5bbb20bfd45417c1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191015143721.tgz","fileCount":1035,"unpackedSize":3910708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpdqcCRA9TVsSAnZWagAAE/YP/0H1xmqud3tlL8eCu2DE\nnRHO3J9tXNTpH492IR7R+X7RNWIns8vCCXdYzRpXrHpa53NngiwrpFoEdaNx\naA4W72lloMw+xtU0SL1hXhFzWRFAp9XN1Lv4qVR1hvhoVjRjvEOHEY+umr/G\n8uRRnzP5L4sqAK4zrcPG4MLHJgd81qPxLlrWvSllPBAQ5fBFNWjeYDlOSah6\n67g+nVQqEdyT7yqNah3Dn8pouidug5+ALzOskGl3TXPQoTIA8FefVY/xZoNp\nWjHTYPA5QICtZNE9lrrv6fpvOhNzUagQYNm42f6uKf2bvWn/0f+5wnC/913y\n52eQYDb1voKt7f0Z5LarS60098atOKtPIZbTcDYALV0eTjlClQ2QJOHbd19v\nVQorrQloSsqnE5a7JPgbXdNGzMZwv9S+JBcxQh7fW4kAn9FObMU9GhU6J/VY\n0MrBhNsnjQ1efe/yFUgOnjKfobL6TZNtjjASFdDdcy9fDcDPuXJ3AhJUz7Rh\nU1t32k0+64ofO7xTi/BGVkAnnyfsSS23xdRxIE5S5itk3isuSBcH2p1jM5ww\ntjxAh9m1O0YQtNtiXsTVqVy/aV9a7iWOO3LlzQxGYdBzv80gCuBkluZEmKm9\nN8YKYLBlQogy/SiTkdNiY12ibVKoHRqb0nVHwtjILttYKitnvR5X5NknMXcr\n09Re\r\n=YsKB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAIZW28hdrp16Xt/QUbQ/UNQqx06XKhtwH8i7TM0VAzwAiEAjGhuJm+Eeh+KrIweYXHsZUAUXc1dSmVoFNmLYtmtLJ0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191015143721_1571150491449_0.10991228544532405"},"_hasShrinkwrap":false},"1.8.0-invalidate-file-cache.20191015171926":{"name":"@atomist/automation-client","version":"1.8.0-invalidate-file-cache.20191015171926","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"50b17d7c1a1c1baa41ad2b8bf2219144c4c31e8b","_id":"@atomist/automation-client@1.8.0-invalidate-file-cache.20191015171926","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-bQ6tqw3XxAIGo/Z09/dzmpx7LNyOGYlQ0vmxgf2ATDVUrapM3eldzDsGMxV/2ScGp7wotCPCyLVrr/SGc1d45w==","shasum":"a7da2bedc54436ddcdd914e3c64f83d96f989828","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-invalidate-file-cache.20191015171926.tgz","fileCount":1035,"unpackedSize":3920251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpgDECRA9TVsSAnZWagAAKWkP/3qc0CKDMWMYTGqou1LJ\nbbHJyimbh7qveZSmqW1kvBXWOiReha6G1GlGZZ4MWcqW158pNgm+l+L1hcNj\nLCazizpCxOHJw5cTz61SzE94VzYe2Ibr21bVj5W/Gl5GTRic8td/ArLVKaDP\n/m0sPfyUSADcLeMIiPE0FXFbox4JifTX+Cr69qFmGdGPeiZRVnA+EEXjxxx1\n5i1l2NT72r/7p/1bhJe+IjlmN+ulEky8OH5wyHLwLaOSZhO4ea4VSCdaqogO\n9GxVZ0aUdRluq2lKDqVzmWf3EZTNOscnjTt8PBif5f/8XclmTcmTg7JwJ0Uj\nYehkVvXFvO/PfFb53XD2SQl3nc920vxdS0rxpMg4PyDGXAV+SK1OCey4qaWN\ngLr+gqPmMxTNB2QEyInwEkem/5w085SGx7ZDCjSObCIZqSTg8hm3Gmb5UtWX\noznE4lB772Neek0wnBJGWYgIKuTd3yrfYvF5Ez2sDrq8O6OdLD3w1vWV2x9+\nbmuS0nmck/P5ToTWTYQTbc4ZPzKzxU2K0308AW+L7MqAVPSVZp2HCphUo4IR\nhWHJ8HwDgoO1Yl1Ylt0pHPeEMCKlGl5CTMUJ3YNxD1OAOph7OwOWteMY54np\nRIB1j/kMMDZfH25PvIlb20M6qL5e5Qn1AXyKWlJd1N6EgIdA0esdGErJVl5d\nxpvQ\r\n=3Udr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZdH6IdsaAC2tZN3pv3A5xYeMblbhZEt/N3xSoGybQXwIhALbDMdbEqgsmnhJIpQ/fBtrHwfdXV8YLV1i4BT1+nGAf"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-invalidate-file-cache.20191015171926_1571160259777_0.1912075154571069"},"_hasShrinkwrap":false},"1.8.0-invalidate-file-cache.20191015174934":{"name":"@atomist/automation-client","version":"1.8.0-invalidate-file-cache.20191015174934","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/glob":"^7.1.1","@types/glob-stream":"^6.1.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/minimatch":"^3.0.3","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","child-process-promise":"^2.2.1","chokidar":"^3.0.2","cluster":"^0.7.7","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","glob":"^7.1.4","glob-promise":"^3.4.0","glob-stream":"^6.1.0","globby":"^10.0.1","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","inquirer":"^6.3.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","lodash.merge":"^4.6.2","lodash.template":"^4.5.0","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","minimatch":"^3.0.4","multimatch":"^4.0.0","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","shelljs":"^0.8.3","source-map-support":"^0.5.12","sprintf-js":"^1.1.2","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"93999c5f037f1a1255c5ea71bee29b1f89fa48d1","_id":"@atomist/automation-client@1.8.0-invalidate-file-cache.20191015174934","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-mJFSm7q/z7j4MvcVmRCdhapa3Hi9afXGEjwSdiahumH5wu6h9Ki3yDnKIkrwwMUfUIRinpf8y+gCAMMQHZ/3+w==","shasum":"4dc1ee2935e1cc6bd6acca4a18dd06e076723cac","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-invalidate-file-cache.20191015174934.tgz","fileCount":1035,"unpackedSize":3920251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdphNLCRA9TVsSAnZWagAAbMgP/AtsPcjjmeuQwszF8Njs\n5hVvhf85tTamy89LmWfZNRL3yKKCfybN9KrsS9p0gQIIMhXOSNQfoMIIZgL3\nBlWPP1bMpe8XeYDC+U3PRq6p8WyVdHi1Z6/804pNMfAOZ7CNTtH65g0HIbys\nDBxXyOm5bAjRljYZ2MFZsk5G/elZC/hm65y2/N3BhYVOLI3fv9Lrjfygln9L\nyvu9j+iiOLJxQmQHfnucao05AHMyuj8buJd9ZRB4paP71fGgEr1aiYkAa5e7\n0huW7VTMFlVVhGTLj5d7BummWmCTOysF0psnFwBzXBQBKpuQeHaK/MA0I5qh\n4ApcSci+LiE/eClHnWNe1RrWBe69A56XBu2YBSK90R7+S57qj2W9EY5woP+H\nAA1eWpnPPzgrWP/0W1T+lxWH1pgWe5UReKxfTrODKN6Xgrwgc1Ea7OC+8BCL\noeK7GgpZnBGbBJCPAzQKq1i5WnFgxwMJWCPOhB+I/Bf0nRQ57Zep4nXFQFtP\ntI+kT6ss5nQ30SVtNWKAyqcKS3fLNaPXvup0lH1b+5FlCkGiwP+Nik1Be7DQ\n5LbkX07N6FHTSkFQNHrtMAK3K1MfQJ5S5Hei31ZW6pQPx5f+FhZyjnXJc8WR\nKKL5yrOtn2Jf1iAu+6qWQ3QmPO1DhQQpv0M79b6vHUTML+m9WsNsnmls1zL1\nDqto\r\n=YP2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKXa3ZahOOawBmfa1Na76yfNp7TdRQz01xhfRhhzg+wAiEAkuTghKbDbbjo1JP0qKRJ6e/HO2I0tRFSLKVqHwruj34="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-invalidate-file-cache.20191015174934_1571165002868_0.6705583758849547"},"_hasShrinkwrap":false},"1.8.0-master.20191015192956":{"name":"@atomist/automation-client","version":"1.8.0-master.20191015192956","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6570de803babda7128bf80338a8209c326a80484","_id":"@atomist/automation-client@1.8.0-master.20191015192956","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rLejZmUEScglATDW3FhMUt8oxSCILS8d5FlalgsElQGQv4H2se12X0KUZ2YPLBQ57FZjfutm7xqJ7LXXslDYhg==","shasum":"9427e053e386a04d0431ba4e9af7d568b749a955","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191015192956.tgz","fileCount":1035,"unpackedSize":3911608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdph8qCRA9TVsSAnZWagAAfcMP/0ZCEpWJBAs/MJQpiXGB\nJpJLdKvyK392Z1vqMloYYOiJG2J38a8n24AaShfcip5O08ZP5Vw94/txHwYe\n7zWHQqpO+nVTaK5W4K9cMzGZHDEzp3XmmxNTU5dety/7G1Kj5VvNqLmFpO/n\nSOJ6WfoMaHxIdbTtz9OaRrboiyF3j8OyL0XLL4E3Kt7g4L0CPPlLoqRP7HvJ\nCe7uhlTKeCl9Y4aiC5ZChWDRJnlHSo5kFMpo3IlarDUROKMdCnfk8Zk2yGfa\nQOPcHeZl4SWTResBABjfeLEoXI5V5AC9juxiEvQ0/HflZDbxQyWiJtdbivUM\nyTWaG4+rdQzfvBWVeTO1Pe4fI0yW2TezgpmTe89rYUwJLnJcq0RuXFwgqT5R\nxWTTYIXuGiwv2hrQfgVyv5Z8Own3A11a1OxWPX9OtuspteG+ECKcqnnaRPMD\nKytAZFrgbTSOOh59eblqp1UxmJGNp61fd5vxxZ1rGUMdrvbEFr2N1TiMIsSJ\nER6uhgPuKOXNvuFXEsLuoWIYu3ZoTTf/+tqo5KwxxPGGHgqaYPguCbpmRWOk\neilVU3iD7R1mBNh4MIlcTLjowpu0Ksi/QVygEDbnk1Rpt04rrxK7C4hvFYJT\nuURnGd2Wds7i899DRGB955Cy9iNN61KuetNNg9rbEHCCBaFctGbR6tcJpCvK\nNWN6\r\n=NWj6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaOtHZaKLVTGswsciEl+Hpbybsq1Y+zwwChH7tx4O4JAiAcoLkxjjk4u8LoMsG7eKPYNLHh3GVvV5GynR/NhKNp9w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191015192956_1571168041138_0.4632408330570923"},"_hasShrinkwrap":false},"1.8.0-is-token-credentials.20191017200640":{"name":"@atomist/automation-client","version":"1.8.0-is-token-credentials.20191017200640","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"75ecba5a402f27879aa76fddd3d2ba825f404010","_id":"@atomist/automation-client@1.8.0-is-token-credentials.20191017200640","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Sw28wLGbp0WjjqW7hw3tDgLPfxpqJ0y8d0tccNLE0D5KCPcBB1lFIubl2zHDzIaDxTO41gOsq5K6fSehhTMpHw==","shasum":"81e170efa915888893e576bc7554a87088c5c3c5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-is-token-credentials.20191017200640.tgz","fileCount":1035,"unpackedSize":3911895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqMqcCRA9TVsSAnZWagAAqgEP/jX8+k4r6xEzb3mj57Iw\nNfumQO4mFUh0terugFXkslaibMH5IoS/hXm+fF5m8sm7FBv5kFho2V/nPeN4\nHMFCyr7xzdzQGH6zpwPJg+dycmmmfYYvaCOZ25059E4neclltm4Wj3N6jltI\n+/msowPZc+L/VVkocDCNB46X0IVBFXv6sNz9JIb4jVkaY/7AVEsHrG2iJG1j\nxnSMfbDEW+Av8G2jRNeoMaECp1YPBVIJPBULDGyBDLYPlAa+np4gffQWsFQB\njLAW9gMct20sh+6xcFxKAxtYRY2LfaBtz7O1vnPKJhQVQXX95JGaF/B8H7tA\nHc/BTCrGt2ebRVXvm5HxS9S6gT8lFqOZF5dX3CCjwwFINZcE6oBvpso39yuU\nkIJsJLlniWI3wUha88lUUHcb1YRFtPQwCT+Q3YkM8EALIf5LJieXvxVCL2Iw\ntwKz7BKH5PEi6is7zY3aA6FzD+F7cD8UIJKUVod2ANeoMh/sqikbF18WXXsd\nFEpvQ6wvhbrX3WYLf18vq0UBAdu9Q8yiD99bhklamn7H2G5m73MgNHZevQmJ\n0pdkqWnom+MKWzwrzCScyGfiGTrCBSUTjmYajP5t1Mzz+Hr4tSx6AMAADiS8\npklrpA/hCLSXRDeksjIN24J5x1oyyE/8xWJL3z/l/ByGcTGRhx9SlC1mpFny\nCotk\r\n=rGMC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7DZHSgZAbp2+q5Sce0IlXarmryqgGMxpqjitAbGJ4OAiEAgd34y9GbXMCIug9r29K3bjKJda2Mvg36L9863uiAHyU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-is-token-credentials.20191017200640_1571343003644_0.5541608615341433"},"_hasShrinkwrap":false},"1.8.0-is-token-credentials.20191017202512":{"name":"@atomist/automation-client","version":"1.8.0-is-token-credentials.20191017202512","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2116309048049c271c9de137d1865d29cffd7d7a","_id":"@atomist/automation-client@1.8.0-is-token-credentials.20191017202512","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-IfiudJNtbO/Ft8xNQ+DtcH57f0P9v/sHzU1IxqgZWk9Z8WG9PFi2Jmena+CUxmwsLKQo7U/1ZH3VfJvgRJn+6Q==","shasum":"49a12e26d6716d5857b16b156eb6876834ff6be4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-is-token-credentials.20191017202512.tgz","fileCount":1035,"unpackedSize":3912023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqM8ZCRA9TVsSAnZWagAAGU0P/2XINQdft3d6SPU5Nwyd\n/Mluq3zQM5oauachfMMOrxezmQLLn0piYTQlAWMA52jwflRPKq3P3qJ56N7x\n1C07mxEd7g3sJ4sejiWDVPN10vwfPDqagPEi6n5JruRSqbGXYpecZez7ArKH\nhJNXoHfV1GVgjCHS6C0N1poFOuzPj1L50mSmXOxAhKMT8/Cwaz3JdLly9wzZ\nscGMKd+DGCASCzzFyh3NXTbq1tFp8Rr8mJngf0fa2PmpnHNKkAwIy8GBSpUZ\nC3sw2L5xh7qRsVXQKFp33JMkbp8Gn2Jw32r8sSN3+t5OPWvwttFxSK+abrhr\n0MMxmba2eD3ZJQBpzvHc3R/SONllIwG1/rklVxo36EBhWtUeaWRSu4dLZdWG\nC9ZY9qfm2jNCdsmQcDPlnFQ35+fMtaxUTtSs1o5EmG6FR5p1pn2mo5HP0JBb\nPLXAHFbb58CCv/Qx70F64bw9ROQPFbO/nvHq4xqMizwsoj91UlZGuW5g1TX0\nYOKvLmEWFWqWksuIeTyclljcjc9scme4Yv5D6y7wYpM2ZgLs+EGxhjH0tpTb\nW43zXg9Z/WPnMePvnJdKxPIqQL2tM1mKSV6s47Z2Vu5PKJc5V32edFDvThXR\nJoQydwbSXw32nQgt3Ryy3R50NRDucFFfbMBGH7Bks0seJlQe0OlVx7bfjrNj\n79GQ\r\n=Y4QJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgnnmmCLAfBRiujhme7w3zcqtVl+T5OuLD5/TiexnwlAiBHkr7rlLAqJZrfOVfR/sFO7Sh3C9BkhaOQ22ulSQps9w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-is-token-credentials.20191017202512_1571344152454_0.7003722394704848"},"_hasShrinkwrap":false},"1.8.0-master.20191018173116":{"name":"@atomist/automation-client","version":"1.8.0-master.20191018173116","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"96c44db2ec4c6f8dd250190d132f2539b9df273f","_id":"@atomist/automation-client@1.8.0-master.20191018173116","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-z86nbTl8SdO08ZxJLvFowb+7kHx9+WkhQdTsUmjL78PITgTqwbpduAy7H+xZBE4e0BL/NY+Pq84N8h+vIkedTQ==","shasum":"4d3ea9389ca069c9ba557c8a80b3826c5f2d9fba","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191018173116.tgz","fileCount":1035,"unpackedSize":3911717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqffVCRA9TVsSAnZWagAA+loP/3Ys7SVUTtC9gfX2c50p\na+lGRIxZJOuwikTecDr6sCd70qILM94K3E8uVDfN3vFHsJBi3HTRBOUmF6kP\nV10zpXozHRPQRLOLmf8psn0imt2/jpfp4yBV78ZW7x1zyGMZYMBsqG9HdG34\nx1+eYKuTUeLJ4KSEsHZMZtc/3z6PvmnrTU0Jhs9wN+sFdTgsqmOaemMqGcYi\nsv1WqCq024iFZ0l6DpMWD00NS7cW6crZcq+vTbxwmRugrz2izoyHm+sf32Ox\nnZ7BlxrfC5SJr200g6lG5K5u+Pjdn3/H2a4tkzPw6VUK7oKnF9W0c9eRg6KW\nn7b8hsxwhwriSiSF55MnN7MIiYXfQxhoQCTG3LUomB9pRo1XVMQTuUDdX3DS\ngMg+pE/ropDivXGBV80K9s7jFzQC2SfSxrXJH4NwQB9KL3pNLLiOIOrhiCqV\nCby3CWadBr6n2u7oNsP7Z1WpuKDt1d/ZrjqfSwaMvrAbVb0v3u6VRhioJX5h\nDHJ+O/jt9HWrCLT8ra5Gjt4WMc+Y/IjWTV96NRJ6McB2A5Q8rC6Ky9JouWNR\nrG5bbuCllPs79sAdwiHIlt8bP8Gt6wg/RFTIN4ehAeX6vt5OhWSCMxx9+x3c\n873Se2i4CERXIZ7iEfsrW5zNtkoJIRku4432rLijKFasbImiAILdRGdBGwnE\nksUO\r\n=3x/K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz6RtV0niiyLzWfGY42BOhO6/m8+F8j02k9NdoUPKL8AIhANHaokrjFx/b3e9/LZErZKymo7BpANVVcpKvdPgyd/T1"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191018173116_1571420116396_0.8099053812724528"},"_hasShrinkwrap":false},"1.8.0-is-token-credentials.20191018173245":{"name":"@atomist/automation-client","version":"1.8.0-is-token-credentials.20191018173245","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^2.2.1","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1de1afe97f9ccdbbd546c39f869084310e8070dc","_id":"@atomist/automation-client@1.8.0-is-token-credentials.20191018173245","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-3iWzB5pnW622DR/XkVdl4aWDW+tlSStk4+vrLfZ01FNsiBELCLX9j37TUv4ub5SxzklUCOh+yLIESesa7tiA0g==","shasum":"40c878995821f2524a537b899634c3d6079079bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-is-token-credentials.20191018173245.tgz","fileCount":1035,"unpackedSize":3912132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqfnbCRA9TVsSAnZWagAAFisP/0XPt4Zat4IE5DEuXejV\nCdyYAZJv5P2ibtam+nBTQdTOuyYy2g1wMqLZqSx0UguKbHOTlWz6kkDuUmjN\nIH9KHKEY2UdxUk92C2po1ssL+OQW+bdn3N8XEi6vdDS3d9JHiiBrDxoojsyF\n2NL6gxxaaR5k+1u/Q4PPH8ItXvUd98acDORP/j7kmvjDlaWvDVSwdLDtOLbk\nsj0g0p+jC64W34/yh+48Ub7nnN/nQhDCkRuCRExmxtH2HWQgQdv5HiVYZ5gz\nBv59kOkLGbSnkmGXgmPeMFyqx3hUZbVk+FefMVxyRXv+7rZI5RIhCXHzvQtm\n/TfHrRIf+fYrs1ZW6BeTHi8Gu66gzg6RELVPWRHODdfwA3e20+mgEWAJ8jS8\nGJpQBB0xX5V0/dOJ8H8qoJcglFvTOEA5C/nNYsz+TLdhrGSh2joUvISO2tVU\nWCrUtrkZXrGtU77clGZ8C6E/jBEu2JSKx2ebZZbEmM4R3ayfu4d1006t5kVJ\nqYAXyiknbbuLq2U7u1Mo9bp2e8T6bUTVTB6CCIvDxvWeP7AGfUU6WLeMJ3uD\nPmfXEZZf8we+v7t9dZWWJeB1ryOBIgR9bHoJDChdHL5Itgo0hMRxMBxyEuyF\nO07yRohP8/SoWyXU5lYoeBMJA23wL03DJgDAGdAQCPtsws6f5Tft/kPnPsxC\nNkCO\r\n=lAa+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAvxTNrEriDxxPHTvoPIPL/BRwQ7EDvhJ4ToGSP1nDKvAiBEfB+VRKqbAkgJfhSMHX1TVKxqu+etALByxjkOyeeyMw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-is-token-credentials.20191018173245_1571420635014_0.7449647497655099"},"_hasShrinkwrap":false},"1.8.0-master.20191018180710":{"name":"@atomist/automation-client","version":"1.8.0-master.20191018180710","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"70b963e9c24f53a97b9f26599c34ad986d56d64c","_id":"@atomist/automation-client@1.8.0-master.20191018180710","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-4jOit6QNI16jQP9aSWI5nH/OhCgnByGXE/f3iIPpYIY6oONdYuNLJRMeZD7+YcFFPjNYd4JyLgNJx+VtAZFZ8w==","shasum":"34589f898b8d015741721841dd40b2ae729e2505","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191018180710.tgz","fileCount":1035,"unpackedSize":3911717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqgCiCRA9TVsSAnZWagAAjz4P/11jXFu+buxp15N03J7O\nUceLy0ICK1ZfGWV+uTJWdVITcacmnVfIbngjoY+p7uYz6kDjU3EheakbwYgO\nACSZyHWeSWaGXeoGiKjHRghfnKygdTopP8g1HpKjDK0DX9ygQfBWPGfL3FRY\n/t/Z6zK0bTcZwVdmll8IZK/Dr9cweTpJeovl0nCjJVgNGTmx3uB+qv6uhlY2\nThV+NqRU0E9nXLap6xvJK4hUcI7SZqxsXkyBo1mty0EFRY6Hhb4AYr2HDWe1\nu2tK4BMWeFy0sPW7+cZXQuWe9novGzO9rfKgkTccu1m28CXcUYDq5qyGVozD\n0sTjMWADMllJORJ7MFcshAC0qhoZ5E3dJp39zZy1UzayKDsDhyBB+XKtuFen\nxh7yWGni3H3nC/BvXi9McWGHXoYeGsokchA0V+F6MccUsGuXPdQetsOzQpIg\nsFFXIlkzAXxhFmDDunuuSbdQkERsq1LfTc+GIuactINPlc7ENkrFcoh22SyJ\n4lZWoLE25rt7nhb4E+bIysJRHStN3cWg3686iqoYcA94X+0HVNrSY3K/V7J5\nM7Oy2JU6WI/8APNuKmWzul0MeeOM6EpuSa0vP9hOu+TuSSFpscQrpKnWPQAe\n6okFuDAZRm77n/ioA8laRkBFvlsc2pgxzCG+YYKRb/8f/Cti0y2gRlBb3lxN\nbA5/\r\n=gddm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTat9dfj4eDlwU5Ufhwo20K8pibvzPE/4PRC1UHVPDxgIhAI2C+jIkGSJ1wUJbJzoFR9ioiErJjLNNSplhmbSHhu22"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191018180710_1571422369073_0.5628798358052416"},"_hasShrinkwrap":false},"1.8.0-is-token-credentials.20191018180833":{"name":"@atomist/automation-client","version":"1.8.0-is-token-credentials.20191018180833","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.0","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.135","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9489e00b098aad4e3a2198994c613a4c3434d841","_id":"@atomist/automation-client@1.8.0-is-token-credentials.20191018180833","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-0dQdJnOkpbXCcFnQEgs+7YIWSMWGUfeqXWT8a16Apd7Ewo7eWAZDkaYZkYBnMGro54LEci3vgBmAffjggbNajQ==","shasum":"c80f01f1e6d8607abaa41dfc60665d3255d99ca3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-is-token-credentials.20191018180833.tgz","fileCount":1035,"unpackedSize":3912132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqgDMCRA9TVsSAnZWagAAEPEP/2oO2au2SrhsYLN1kA+8\nbUhxaKjYwo43kLMyIvCfWd09XUcsFMFRK9WonjqfTcYuA9es9XrdQbDaWix4\nPs2qZh8cwHrgiiqr2w4aKdiFGVMmAXfRff4v8Hjnkp5pZdVDSWxymBZGQZL4\nDtvjD/3bk3d77zo6hUpn9ivOT9VUDbMSpb/hCcZH5T4nQSl9YhxAv7vTLodv\nVSejhDiTvpO8InF8cZnloWj4o1QqsHE8LOVRgaPRwHFS4x54pETVJk250IVr\n/QHA/ILVE5XBM1DfsLxPqJtzX3LSmdc1rsvwLb8hRTLeCoCEql7yhLlqZcwL\ne6nldpvLV4GoMqBpAHQnVr7NAHTVQbcetwfFLzAfVsbB/O9Spr5DSCmmvKJ8\nlz/RVyYveSV9r96o6cbs9NoBg0+YkthRl7ivHHL7eeG1MWXnTS/Uq08I6BW/\nwjiEukQLQMqV6CX7Es9r6PKGqtb+a1ADq2DxtmFbVNs2QWdybEb8NU4KGjsx\noy/MBcuf6oUfLkMCTw/LrBGI+htSKdot0FVY6dqK69QzLJrLAR8Ko6nmq3wv\n6NOZEhuy+qhX78Z3aUqsuSuR++ECZTZ93W0pvw4WX8NZxxzEdnAjxcEToOI2\nRJzJ5vy1uKDOMT7Ndl9tXDeLteCek9cwEPuK7GX3QidwD5lhE1oM3VirqE2X\nC6e6\r\n=j9U2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGaqm3VsAc1yBCIanu2Lwt4HEN4gjlHONVYCpPn9nNOtAiEA/DqZx8MJ4XOyuedBBUdGPbtpgpYPaLPYVGrBQuzdw0c="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-is-token-credentials.20191018180833_1571422411661_0.7163381232211452"},"_hasShrinkwrap":false},"1.8.0-is-token-credentials.20191018185410":{"name":"@atomist/automation-client","version":"1.8.0-is-token-credentials.20191018185410","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"525ebb9a608f208106c557bfcfffff1763bb933a","_id":"@atomist/automation-client@1.8.0-is-token-credentials.20191018185410","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-EiZJh6heZNThZlBI/kGeBzvBOnZjv/WYLDjTrE1rU3t6w+6axMmhl/R8NlghY4mMstLd4NAB2TpPBodRQLU1HQ==","shasum":"b8c38461f95258ebb18b3a61e141d960ed998cbf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-is-token-credentials.20191018185410.tgz","fileCount":1035,"unpackedSize":3912132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqg0jCRA9TVsSAnZWagAAFMkQAIl5G/YmYGCOrPXuGIOF\naKVaW80gVk1jagiR4EOmj9Va25N47f+zXQSo8tz6v8EhTihBVEYdKZWXHldy\nNVwLJp7nE/7g4mFiQCNG989kzh6JKNYUWNx39iLi5dGvTWtQwC6UWQbXmdg8\nt/ysxm4i194J+qLx0EO0pFtZpZESQTjaFYRiY0zy68nljuUwce4WYBHX46a+\np6+jGtJ7dHgGKc3FoNbpOUv6DUGgZlVahza4iqfHm7J5atxnwCCom4LfMAsQ\nbm/37WY2d9WuymbDqjfTXyyq9qIDynDGeXzibewORAqDPCfBa7V+aeDZDoBe\nZreUKrepzHJGFggZvWIY+MVWJJx2G/BTmGAuxhdCzVKZDap9UFl6HfJn9tfc\n8iO7sMAJXiuYBPTX3hodvkPAlQ7aAPve0dgjMmWtdE+llmnzvFc/NSN9Hg+d\nL/Tey3LTLzEq0vkR+wKhKsQd7mdQfu0RNcOZQPAw8IPSz5DFUv7qCcVmSwAl\nyEe4S6IkYojMhZO0EfYjkfGCANUR9d8xFfXd4N54pKwcooFRMKbxqRHedY3Y\n/vRJbyhnzr06uaZGq+MMAQGFsqhAzs7ki2qNPSRbgi9+N/B+g/ur2BLzNCB4\n8srCVnaHSxUCEoOCpqgnEuRnE7s2q7x1QWXCjgFS+AXY7IBOT4zXsIgszy/s\nHU5M\r\n=uFil\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9FGL42OyxknAqhEjevj/rnJQeY2amzzDGf4vUYjzEIwIgdP8h56ol42gRTQzOOmUi3kzVW0FeoSXzKiwyh9CO8sk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-is-token-credentials.20191018185410_1571425570383_0.641090284934871"},"_hasShrinkwrap":false},"1.8.0-master.20191018181918":{"name":"@atomist/automation-client","version":"1.8.0-master.20191018181918","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8e6340f4b83e7ba4630804c2203c4c1df461a851","_id":"@atomist/automation-client@1.8.0-master.20191018181918","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-nzDby3J3NCc+4Hn0NPCTgr6iobvAVt1SADpG8xvlo7qhtsaR+gfiw0XGQYEUF4zg16ilLkTHrJeic7fiRUBMOw==","shasum":"91ddfd4e004ce4a7a6e83090eeb14bf97762e389","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191018181918.tgz","fileCount":1035,"unpackedSize":3911717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqg+ACRA9TVsSAnZWagAAXW8P/0SxrnzYHgAmYlUCb8Ft\nUbtXNJ7e/l5KBUTqJibDZ1rNp7snobWweJD5apX/sFHhOWQMirxVO3uRDg8i\np5gXZLper9wyxMRbdOD87nYiIi2S7E9NMF1JbG9EC0zvBw97hsd96sLdl0d7\nQ8rOje72UUuvUeoN1Yyr1p5HDN7PZrYJNNo66rJw6m4Kn4g6ezwKXR8GrVD2\n6OQ0u2QG5mqGl5D5YCmMUj0bB/ilSG4X3qjwPBXDF8W+t0LuIUMA4rB5ALqV\nq9/nQv5psazkMxkZS8XHnFktBePuS0AKGO2zPBIZO/ZZbUblDWiroWrbHwyC\nDX/b3VD1/WMgN+/cpQ02ixWf/7Ndy4su612RThn/1EGt1SUcDMAX1KTjNGqE\nzWCC7NZbunavQ/gkBIi0558+idzipcgz71XQi63bp6Xl/2AKgH1ltRxyHBDH\nGOjqjxNEzdMSTnL0Paz51UoGVGp8TxL7txc++Ja3eplN/uuJ8wA4DVW/lZU+\nGsMrsSFw9/Dtd8vJC2puMg9hGZru5t7s+yL6E5efLneI0xXRWooGGIUfCEs4\nxE2DbdacDb2rIm4l2SGCmpdWyNgz29mStS91BoPM5whx8t4FD1I1bX/XHyR1\nUv4Lvy4wCA6U+XoD99tJIxf1MHG5qQq25E4F1oHMkbQ9Vuhw3ea8MCZK0ldR\nJWyr\r\n=ZLMN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHQpr5svMShctEHHP6jSEzqDS6jCrEP3lv36VE5Ou8OAiEA7XGGSfQ4K9O0u2mfCss1fdjUsTSc82t8bQTRLAy4or8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191018181918_1571426176018_0.6161782339890782"},"_hasShrinkwrap":false},"1.8.0-master.20191025130333":{"name":"@atomist/automation-client","version":"1.8.0-master.20191025130333","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"75100d2e8570393b16b469f0db4e03da500e35ec","_id":"@atomist/automation-client@1.8.0-master.20191025130333","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-QoXEeU/4ATiSkWf4E7tjAylGeuvL9Ig4tO/Q2poZP1nEEyJ12nMLuN1otskz7s8t6TanrbLfB4f6itkm1Kk2lw==","shasum":"5b6a6b7e1f0701cc53969f6f44b280614081efe3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191025130333.tgz","fileCount":1035,"unpackedSize":3915024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsvNkCRA9TVsSAnZWagAA/tcQAJMAno4hILkqO9Ts1UOO\n/f4v62vwC0h3CzbLTLEo9PeY3hgs05xCDPheSlQ7pMhrBTxbsAtKPtFhyjbD\n6KVs/plhwLKQ/Hp9FNgSoksztxAyJvxHd1b/P/56znEBDaE2vzJbTFXxJhr7\nBnpYG2Q2ILVaKl614WsuuvfpY1Z4JNATRAau1zrBJfKq6GeOXXIK1A9GlzaP\nalbQ7l4IhZtqbmZiAqVr2TeYVkkyVaHrZsqdtauDXNaIHQ2/MyFrmRGlpeMa\n9fLe5jwfrv2HwJ4kWW/N1pYkC/C5g/FbC0dcVaj/cOFJ2xraO6HPf4xioa/L\nb1HvKv8x4Of9nJHSOQJ+dFKQDUwwhIVJDu4Pr+Qpab+8RAf23GI5z6kMqCqu\nFhvX7NBX1Q4p91ur0dTVgP6ZiKmW3QnxaBUlgsEe00HifTOBVKI9B644kowx\ncZZgx82hIHFPup3diBmzt8uMaOlg+zpYXE76ecPH7GTwJ1IzWvUt9XFnAvaj\nDIqYSpvEJZYD9kpitOu+4SsIPI/4GOppmk67PKQ/reH6e3+5MGb+w+QBVcWy\no7T6AQEdN+6r+62MPl9hj2bukfwDKIID6iqBvS4vflcKL4lzY4SE84IqDEZ5\njo5PCGYlikKXVyXklEuXnFCTYrneJ9gQYJncBlBJWhtfS0hzlPedEf94lBL0\n66ER\r\n=FYvy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlJhb+Xn4imqwtaaFdRY+dBS7IQ35AG9VBGagOg1yfWQIgQvg9Z39fZH2IKTJCfmZAoUUJnVl2VrM09QhXvh1x9B8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191025130333_1572008803333_0.8747357489512408"},"_hasShrinkwrap":false},"1.8.0-master.20191028122521":{"name":"@atomist/automation-client","version":"1.8.0-master.20191028122521","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"89718084aa00aaee34c6090aa8db885555b3bc25","_id":"@atomist/automation-client@1.8.0-master.20191028122521","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-DadnSgYsBAZWJIJ4Qalic/PnAf6MtWfv+dr3ko1k1Y3LpWTkaq4MMjbQLHWdcHffSZnnr/aNqbhz4y2fRsRYiA==","shasum":"5b6bf91a4f3c003159fa621f6f54b35f1cf07d31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191028122521.tgz","fileCount":1035,"unpackedSize":3915515,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdtt80CRA9TVsSAnZWagAAHvQP/0HbwdIA4or60HduPBHI\nNybZCJ+CeeFLbzvpZ1CAfsJEUUnCmC3jgdNKrNNZ3tyQ5wYpJkAPw1PKgeni\njbyPJOF/QA+fEg29vHZ6tTnODrgHath1cEwsJ8jaYNEBh0pb8aozpJr3oFiG\nQomn8h6avw6GPJwhI4pOrHSjnp0iWmHk1YuYUIhY72RnniS9Ss4M8eYKjPg0\nCzm66OMqGwBvIUqTDBr+XEgyJICHyumGhwl4gTYi6zbKZXX6DCnyDyRTxlFd\nUKLKwFH9nsYY2u60k/kC3/kfccZQI1fEaMTj6+6ZBGary1/R5qh0OUgXtowC\niFo0sVIE8UFvYRoTgILu1AlyqQSo31uDVdmBGcLrcIoiPHI7XKhYcry2OCSE\n6fANuc/G7qxxjgfwCzkHZmRWXiUP2x+Fgue8UB6XSdvVCpRBfx0BlPrjBD5q\nN5y+vDrgffWvK4P4C7H/Wu+DzNzDvPsBR760d0xHc1s+5YADGQQwjzUxoC0M\n7BxpvqjWDhqZmqmWAk2H6kH7TzVQkxvFPaIYaaMrFpJ68KYyeeMm9cyyLhnT\n+Sir4rekyN6tUrWbMd1AuLiOS69pKuXuEg27+WxzhW8PJtEq/vXRiTAONQFy\n9Xl8ZDi3IdJm7pM3lh3TbmTs63Wok55ITdVW/KnFXr/KjBRtMCeyA/OQIpIt\n6LOC\r\n=YYzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDBb/QE8s4Y4RQcLJ6SgwnwkLL3pySQ5rNfAPKgfwpfXAiEA/og83KsvTwzNvyXuAFbi1xAHP1oMt2r1wZnujQE0KAE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191028122521_1572265779446_0.9889221853790162"},"_hasShrinkwrap":false},"1.8.0-master.20191028231612":{"name":"@atomist/automation-client","version":"1.8.0-master.20191028231612","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"60dbf5feeabcf9b324c03c636d33325301b296ff","_id":"@atomist/automation-client@1.8.0-master.20191028231612","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-w6vZoNWycdCwwHw4kspoUFnN2jJos40JRVpcAVP40qq0RiLg8Az/as0EzrZZaTKmNVXJYNkOg4BDQo2zba0Y4g==","shasum":"931a88e352e22b0c0a3d8fb202ef3d4458a2ce17","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191028231612.tgz","fileCount":1035,"unpackedSize":3915641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdt3gJCRA9TVsSAnZWagAAGDUP/0cLQdYwoY/fhM+Qj8eU\ngBpNZlqGUn3wG+8fmjhvS3vdkSS8SSxiWlU2V+pBaM1i63lWnnqlcwgEO2g8\nxG7wY/M9GymVAEoq4EiJHJ781D9x5U8rQIjqOZ+NXPUJFwfvkAoIduy/8ER6\nj012xY89bRMwEVuG9A3+unG66PcgL2B/4kRFM407VMk8KIdx9WLhlqsZ3d9c\nORVLbL0MYma68cWH+/PwKXgur65r8ckOU21ZydSMPMRuMKJ7hsQDMiGYH7na\ntLGcp8Godo4iXE1ub8/8spdRqun1Bp/xIUjj2Hvr13zmcNVPmjCpLH0VtklO\nZ4LK5BpxtAYlqu1gMk1CwKmkBsJLm93kLCD47IKz4GEMRDB2AlxlSRfnTag6\ncVWFJvIj8xiuIJJbxHGWfhPP7Dt0xrqPl7LWwtgInYWrWoP991DtgM/VeWOd\nPuf2gAJXf/lIVLxd69Zsn9RNh2uKpCoCuktW7hX6/wb2FNQ6BzvsAa+vjXLf\nQygZLGCpAK/BHTzvv79dwvt5jNkp1s2y0xP+HixL2QzEJJBwQlo4/aC36EFv\nkki7b7y/36JFcWXwHhkT1xR/p04GjBAtXHFORXkQo8LMCLpWyjwl2hBNdhTQ\nY1jvLPEsR8TyapoX5NFrvVPo8pmR00SZfOjY9wTF7LUtfUx04ivjhmzRy0ls\n/0BR\r\n=VnWv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvThGAsc4g7mV8C5djzBrNomZmT+9hx3MLvjmEU0sKVAiEAnjoo8yWvM+2qihdpFcwTBt4Kj3q+HfNQkT5qqQSq3TY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191028231612_1572304905193_0.26133890968617934"},"_hasShrinkwrap":false},"1.8.0-master.20191028235651":{"name":"@atomist/automation-client","version":"1.8.0-master.20191028235651","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3d8f71a32a1c26f91fa93bd73257b6d58c673b89","_id":"@atomist/automation-client@1.8.0-master.20191028235651","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-o14sx1ezG7dZbt+UXFEfQRMqD/o1Lg+DF9HAPlnXeEnt481EFvbNZ1292lOS4fiScly8HU11lED1zYbo8OgDgw==","shasum":"fbeb4f04872620c850e5eb3eb45c637364824da7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191028235651.tgz","fileCount":1035,"unpackedSize":3916051,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdt4F2CRA9TVsSAnZWagAAhMgQAI9fzKti3Rd/Ou/ToDTQ\n5BrbVQP0pcTWBYT1ued/5z7i5j5twqZNMQ7trv+M8PCIOfBXnPdBXGHiUWnf\nDCTTIosFYkcgLlrQX7d/O0pgf6GCet4XECoCzE9DtiPRMz3qa/JhC6nzEkHZ\ncOR3uwWDip/t/8Pb2YA2FwpUFv6S6eKrAAEQgbf+ntkXeRLkngrrqejof5/U\n5GuArD1M8LZiMCKV2KXEjhMyKTKtYxiZj+4wmC1ui4LWPAvKTkWe66kEmDYG\n/nNC2+LyAAS4b4PP5Rxw0okDMz3bMjYE2VD5noacZG1+TMxruX5Q7uNUzF3T\nyaYEjp45LzSdq12sIOyqtmgh5E7+6DN3kJb9GfPAE1prvWGC00KFbHrcD9jt\n/WoD6JrVqb2FHUIkmRLWE4PFVpu8jRGlGZfzW/tUTfuprmI/+aMmM1OztZk4\n+YPOHZYCijwRQsw89XB8met+4jprBC4/6U3PL8DmQOpPClg2BUZLV3VTfx/q\nUBsSDt0RpYyABR8LBAH1mG7CYjpZ4FR3pdbtDp3RUCxUiNdwKSZBXlJFBuO3\n2wx7Jk3Ecpsom2pFmME7raALL+HIpQZyLbeKVX4aOtoMDpjckeTA9O8t5svE\n//KgsCNr+sL1fKxYfVwRFpHm72BJlHNTUsQAWslXpr2adXSFWBLw+Ij85XYO\ngxpe\r\n=3mPE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhDnIqYx3rVZRSmZlrmSXK4+fRVLoMDJhmhSAUamUoqAiAohkFlWuefm+AhFlbKT+XrOdT8MUNMOPzzHMHLUu8VHQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191028235651_1572307318045_0.5595707926687525"},"_hasShrinkwrap":false},"1.8.0-master.20191101200605":{"name":"@atomist/automation-client","version":"1.8.0-master.20191101200605","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e9d0dffa4c30d1aa549e532ea173c83c1d585f0a","_id":"@atomist/automation-client@1.8.0-master.20191101200605","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-vx3pO6FH3HoO/K1JaQIjIEwuOe9kn9WJdqqreY2yy80DMYcbnwl5TGZDhelzF1t0tMNEfSAHOXW915dg7PzePA==","shasum":"9553d5ba5708aebc5316fd7838eb829bcdf38a9e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191101200605.tgz","fileCount":1035,"unpackedSize":3916085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvcCiCRA9TVsSAnZWagAA5bAQAJ1CWbn1xftrZM1Ok42o\ngb+YuxFm15yTwe56lBr1TQ5Rl2kWcUSJxcKzZydlRvbcfDN/EyEQe85eElhE\nVMn7qhZGQHdjemJ3LlMbpRRxuD8Caq3tlLYG2iysHVO7ZuUxpRj2h4/nv+Kq\nRDBFaMW+gF11hMT7EWwA8XmfB+QNs9TTfyq4zXHogAxUuJ4X9gS6Gd9B7CqY\nzxBBbu8jU38E1dGk7jIOQSjoD3FQkVtJi4s/BMmD1iW0Laj6tv8p3syLBgLn\nbqG8a/DK15mjvAorPFpcDJ8Zot7qXdMOCWRm3OLvvTuWXeZa/AFWpLCYqarj\n12UMAVZgUSvD26VZsaT/99Q3sDHmHLbv2U+H5ltjwCfNY7gCyQEGlAGi3+FA\nQix9gzTbHphX8zjA0nFc/4MzprmztWfSsG3lfjBdEuaZM/qvlqk7ej+/jICf\nwdJM+dSMZecIEJVwtLqQK89VbGsMPtE71+9MJJ9PQ+x2dCFXFpI8/TFc0S0S\nAqIE8XzXpMIU53lV1qVYsWVoArVEbglvk4v+vsRVhz/lqGnpF6mKt3g3EWO6\nGN03u+zEby2RsYUYq3ccx/b23kpT5CRTDA6Diaqpe9QQVa/tgfddvN1X8/Qx\nGKse6u+EPWobDx6tU90kZS6MdawhkvtJd9ZnvZUUwHzY4Mwi23W/MPAeiZMX\nYbwn\r\n=Lu/R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFap5IdGPEJ6vFQoxPT6JyPIy0EvkDw2Tg/QNfBQJvuCAiEAwOyvm5ip0AP2lUrm/La+SfmC4Ab0oYOw80stC0ECuOQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191101200605_1572716705532_0.1647247994894887"},"_hasShrinkwrap":false},"1.8.0-master.20191102180457":{"name":"@atomist/automation-client","version":"1.8.0-master.20191102180457","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"633807f59c2dbf14d8f67a8b7ac199e647a1764d","_id":"@atomist/automation-client@1.8.0-master.20191102180457","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-aTgr29bPoZ0C2Br4b4gy3yXFaC7W2hqI9o7v3oawwWHoykXxZe5fPyY+REC15goI199tXDwfaVM5XsRF0THHCA==","shasum":"05b909227d22ecf39e4519a59dad522ee53b6488","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191102180457.tgz","fileCount":1035,"unpackedSize":3921524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvcYaCRA9TVsSAnZWagAAUzsQAIfBYLJYwSOc86TwwKBZ\n6LXZ2sZ1DhNbZ1RMKW1aNfm348Tloaa1HcwYFmGtJJ5ELOQlfbGHkmE9r2pC\nBTAbeinC6PBBacUBnAJFao2O2grq1Sz1bLL+Vpq0OrguWloqDs/sGOT4v8eP\nSTE7epiFJ6EGPVDb5YiX5k+wNwrs/om4H/9sk/+PCVK7Wo+24WDqh2wH/I15\nrAgYmgEPSFGPBdUQ2aY9LZCSZKxskG+VhUyKTmV3bW5tbdrs76oKBLHwGK5Y\nWwqdjnAwFbc8KgvKKMUpj5LdgG7f8JVlMVYZMVCOZEY11IKdgK5E+MsYDZi1\nqApuJm/gafu96NZbiDZt0ns07C3P2HJ9mpjwUai3w+U6vooCvkpsXe0RGk0/\n9QGXc3gNkgCzL9uqDOL9V1TyonZh1zWmw6729/uuKquSzs/9paDXxGY195y3\n4UtWLH8YhZzllSMAgS2yfgADZ/nHEIOLAe3pb3mIVxc5HqDvAkN2KBdguGZR\nm+zsHUzU7IkMa2rV/Xwd+6T+PqgFldNzDghAqICxTVxK1qcziT/ky8/2mRw3\nhl+ur2fyVBxMyIXwGBcg9z3/u/JOiNMKmVgJDDLbjCS+PNZDbEU+G3iFnjXy\nxZS0be9M1cBBDHJIg2VHlBciALj5P0f23LGw5JnqqVpwC5jcwPrhOZ8Sg9Kq\ngk6O\r\n=kRAI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC76cqfc3Imx5ujk8AwF+KDk+KZkANUmdZVJjmvBBikvwIhANA+BH13AxN7JIsEWMLkqd/mQTqWR6JyZ62ntnPRr3qX"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191102180457_1572718105655_0.2630365043397149"},"_hasShrinkwrap":false},"1.8.0-master.20191102180610":{"name":"@atomist/automation-client","version":"1.8.0-master.20191102180610","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"633807f59c2dbf14d8f67a8b7ac199e647a1764d","_id":"@atomist/automation-client@1.8.0-master.20191102180610","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-xVb7dmj6O876UlN3BIkXy0KBT7AZsNXNv8JA+M1/OfLU6ShUOTM63RRSJbKcMsHAKXM8IOM7w3yjuByJS0hdPw==","shasum":"e00b96c4657670051075b09bf641330346d26b04","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191102180610.tgz","fileCount":1035,"unpackedSize":3921524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvcZbCRA9TVsSAnZWagAAo5kP/2gkp6zvvS6JjbUX5+0j\nV+ETDvsI66gSvCe+SnNuB6IrVOjZ1kYuP1xWE7NHgsHkGbPPDt2AAJADkaI8\npGv8KRN4vVcC556kvMdIbr27Uvnlhmw+/4MlLdSiMS4y0bdhLjw0WN0eT91Z\naD0VtakJDjcqOI5gr2AUbr6R4ND3DDi9vb+Xx5vjsZSJqNQDPk2bhbrgNAdB\n6c73ZpbkJoYXPpNw2zOjB9zsiYRAUn+z4aQ6VMqeDCA5udBU6UmvS/cwoJiC\n/o8UXn2drqo3vtbMI1Lts2EEFhXFUQ9GVtQ6ttivKPUN5oWVeFYSMYK1Zvvq\ny8b7b9zzA2wjbm3onGhuYqVM5zzAdEyZsVBXuDFHDtFWf4/OhOTlwcR3wzfM\nabGT/pfZ8yxWnHNN/sYoolan/JTtXRwZiLQQi0XtORkOF3tALYRbl3xsxsPo\nVoei+aDGuWr02B/Yn/bclVNK+GQtFmMDyFwjTQnTvaxBAVl4YAHSZmr53THr\n/m5AZBTDqta9Z5iJw4UZccQRFESSdR1tSru4c5pG1A8TuigiPOa4eo7c43H5\nMuG1Kh6bvR0E1tQ0QQDMn8jPEKFz+wOPJm+z8SAz1vXxSccSLr4uk/lOslvb\nQafA32Hakv4zlV1dBLkf1VLFnWR4bkm5iDs+6aDP2UbPJog593GXd0R6khzT\nfwhm\r\n=U3yP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHMrTPquaa2WENiNJD6r/gcZJHg4CMXAhyNA/1ppd2SfAiEAnahIq4UA5Fq9OUXA/AScpjXfr8UD95g+T7rsvs8LksE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191102180610_1572718171193_0.0453224330170805"},"_hasShrinkwrap":false},"1.8.0-master.20191107193443":{"name":"@atomist/automation-client","version":"1.8.0-master.20191107193443","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fb397ceaac7e4d3f299e7d010f74bdf7bd7c78e2","_id":"@atomist/automation-client@1.8.0-master.20191107193443","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Lx91uD90J8R28BKpJSH5fcWsHVGWTSpuoUzMoOnhDF9UmuujIFsXjDE8R56gc5E7WdBp/fKCIIEjbrumanJnyQ==","shasum":"ece80b171399d04985904f79ff8e6a87217f2220","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191107193443.tgz","fileCount":1035,"unpackedSize":3922057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxHLmCRA9TVsSAnZWagAARMUP/0z1Dz4POhhcbyRLfPC9\ncDoc6g6KHLTDK7GQLA4t4i8+yIDt+SCHEeN6nsgeBgOWuR9BXsRF/3xHPiio\n5PjYJwAEkAXtIH6mvNlPrMGmAm6BTFaDwwQyP7/0DMhYC9GGCKgm+04w7q2d\noUAOquwfWLx0zxxI4ps9lP2c/1Un5lVquwKLk8bVBRSCiIGgc568w6iCqeE9\nJBv6Xfsbi+E93qofTHuUssxlwHbRsTsodnTU/Q4pL6swtC2xtFaYTuMM60Ff\nsFr2kLGAcCPSYLczjfxzG6rxR6DxFcfJizwe3Hx4L5+7OAsdp0g84aww8I7B\nUxCqkgRuQ5R9G0yFqHwg94unzdNsQP5+gHxAdMGWXtTzxOM7sWeOwQGwGd1Y\n3qzO72WIGdf3t7eXoOf7k7dkNUKjSiZmyiz0Mn7pbDZ7vkSKY2CdB5ePOBcC\nsLNagY1AoD6463yqVxkAYCo9Oq4MvHe2BZXtny9pe8rhlMqrZiD8QM2U3cr9\nz5wFN3iVVU/njUAiVYxbA2tjBoY72qXnWLy96JBf1j9AaMUA1KLdPDcovpxn\nYUsApUzIsTtdAw3TVh7wA+T0fuPqCDJR4/6r7YFFE+Gp2A7GAJoHrY6e1X6w\n587bhwf4i6drYAqoItTBxf9rU53rGTySExpz3ixbIHFjCBAqiGnbHiUrqtD0\nei4y\r\n=d+jM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9KGgEr20DDeAueWqAXHEdxd4GRSpM4iSRX2WAhxNXnAiEAm/ycnoMhhapN/8H6srxXGpMjZ7DVMWkymy/DGyztsYo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191107193443_1573155558199_0.07789956584731628"},"_hasShrinkwrap":false},"1.8.0-master.20191107221231":{"name":"@atomist/automation-client","version":"1.8.0-master.20191107221231","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3732df885805d65a614a9677c6db9ced712f704b","_id":"@atomist/automation-client@1.8.0-master.20191107221231","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-STsyAKtobi33dizSZgp7Q+DeIXjGlV3CrsdJUn7RdDkRbjiDmv48r81HlEvUaXqSTsRUqCAcNU0YtnuxvVHMkw==","shasum":"93dab5761c88f614bf0528682c0ff3ead6fbf39f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191107221231.tgz","fileCount":1035,"unpackedSize":3922747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxJgMCRA9TVsSAnZWagAAeuUP/jLDzXswsHok1UayS9xf\nZ9MI2XutjZ4TIN5RVKsYeBR1cc7KvEXxd8gvqQCSJx8j5iRqsz63uQULrehj\nlPJSn7ERI7yPyMiJl/T+/DnJfQ8HpfhmV41fJFEGC10E9RWLOBmNapa+sf2Q\nYz+6hVJxJHQ7CCybuGFhLrx9dmZcfhJ2tV4iB01QVon32OhxqEackU6+KqSN\nVdZ95youaXyJeA6uylFZ+LG6SS3VvxAsT0rZEiTb8xbgNn7MUAhpwx9UDzr1\nhnIyxkwF8TmhcP0GDXR66D8yqUflKS6kw9qLT38H/GfnIffL+vZMxKJLplAu\napXAezbD+aMiNJ2a/kGJFpJVDfdolH3NBB+ZCk2FuOHlhFZIB0Mm9kNQTM5Q\nZE5gO3cNsEOuNnbjjvgrFjRps/ItiMJ7oX45Oe0uQAk8gbCxulHssjGwiZ0j\nAHPE2GCeXXTutxhsnQu/6NLcKpOBjKC/PFxXyFF/75bkrqUxX23JWux6mBvt\nI2aWsNRj2Q2hShU9AMwPoT+lofb5eu9/kNtq5J+zb6Jr/2YgQtq+LLe4hR80\nrGDlShnA6/KkgKqdjtsn+JcYAihQpVRfOjyzn1Ozo/ykgMYRfQoMvLCuu/KE\nXEsrtr5l+929NVubofe2byDGG4tp+Vtxt3sfY+/RcGTLs1Z+ENogt2Wm6a8u\neqKM\r\n=BbNU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXXHT8NS3Zsq7whTfZ6xQyERnWhheEBVN4w4v9kGA57AiEAqxMu1zvySe7S271LKldVWlAefnRGZSE/oRQmhhLzH1E="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191107221231_1573165068383_0.02092247195267305"},"_hasShrinkwrap":false},"1.8.0-master.20191107225525":{"name":"@atomist/automation-client","version":"1.8.0-master.20191107225525","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b86aa2278cf0beb87ad2efa8e830b367d4f32602","_id":"@atomist/automation-client@1.8.0-master.20191107225525","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-vjghjWyLikoTemy6TjQWbrKpy6H2WTzgM5YVIyEn9NTUNsUKSVEsNCLt8eK/cjEJR+j44D9nIxhnB0ItSIkWPA==","shasum":"7ac45b26a03c5bd61a83bce83bb2c641fed4565e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191107225525.tgz","fileCount":1035,"unpackedSize":3923468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxKIACRA9TVsSAnZWagAA5l4P/0qh8ie9rsv6W3dVWpx1\nDDmZ6h9TQCB7IRk1YYWtMxC+xYdE4gT4aXAe4NHmpUktV78YKNiDdx6nn/fG\n6bjXIzxiTLFJrJ2/Vw7jQLYf6wNdBWYVIBhuyHwoayhubOqbVCevRIAlVpMQ\n24Ew2XqDLwYMDgI318/lpo90dkzo6que/+I4/tp8tO1+/2rdJrzQ5QkJ8myO\nNxEdFrD5umXS7fgN9XXpi1kfBgZV7Cihp0xww2tHCRFDyMQuxIw67bWx22v+\nH0Y7yDactiDZnrGTzyup5w+UYN/ervN9vtZmn0BgXrkavTc9bHG/NF0HJZtU\nGxTrqwiEOLc31BU1w7aBss9SjAGC/cpm8whv69O9jeC42WXJx0YFtYsqJ4Wo\nPNgqG1JmfesFlm9I2Ypj1I0qCDFyZInXCF8vSNKKFlS9Ts9zdl19JcgVbTrp\nORhY0Y5aOIB9TYajCjdL2i2LTJKAlX2h3m9SIAnrAbetpujOSlU6mP62TK1X\nVwvTRyDFBMJvJNx6bDK+jW3eLDOY67kSU4xi7Xzt+347a4YjGbUP0ltD1cpU\nRPstvOSJsx6DSxDGRFBblhPmuU8OhjAlLPfLKHmfXgoTFXyrXIULS7m8tENI\niE2wOfiUl7pc9LGHnFXs6S2kkd5n0aYkg6F1NevZrhsfI7KAx6Yut64yhWXR\nNFhP\r\n=TrOk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCp3Eh9LaCED4CKTx+U5G0HwdBcYYXxaquaWFUCzvDN0gIgOpiPw6qM6iDMIntkkqM9eAk5H8jPuAdwM2CYROThABM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191107225525_1573167616280_0.6521158743621263"},"_hasShrinkwrap":false},"1.8.0-master.20191110005338":{"name":"@atomist/automation-client","version":"1.8.0-master.20191110005338","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"040f6b0ca3d009efd2c8dde774ebc6f92246cc0d","_id":"@atomist/automation-client@1.8.0-master.20191110005338","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-pbCfWjH79qU7oLpcOXMR/8AgYd58KUENgq50ok9BZiClrDIAZl1QrsjrLfaQxo+3nvCb8HVjoRlAnQzKnXanJw==","shasum":"92917b4181dad286f4a77cadb70c350655d0de3b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191110005338.tgz","fileCount":1035,"unpackedSize":3923437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdx2DRCRA9TVsSAnZWagAAWa8P/0GoNcNoDF8LAt1ybaw+\nK+2FU70F6iPYg1zSztGuae6unh224c3VuhCweJvXPjZPWFWUqerhQZnR5Mi5\nSP5/IJe4luBxRT/RxRqlJCCJnumTiAsdPmUa9FyyHlaKjLd0DKiJiTZxZl9p\ntPbDhZviXYbef6fqMGM49YpqD2aXBLreWfs4E4Rjf6Z28asWDo2p67LQsFqs\neiho0EQ/oTDU4CkLEODE8aMLtD/Rx2+QtsbZRe/8zyJ1l74fXGENJpG/kSvd\nenOyX62j/X9MiG8DSqFGxAtjvwNis5S1q8mkC50FlldCgUoPWLZtLmTQq5t2\nn3gVHK5vr5lKKX2lzeiakIZJWYin1ab4xcOVx/CaJjCIdRWgAZgqc4hJ4XnQ\nnKGaTDtMbobq1twmFqb8yKA9R5vLUSXJQA+LrnjmNpET0ZTcRoaOiW3YBARB\nol2v7dHSh5bUC24uMfnsfZsC+XC9Rh2ChY8MZ4B+nR2hdABvH+Cw01VoHUNv\nfmXw8dE1tm042waLX2pitujEP6itiQ6YgIjRP9x1hKm/4AgYVl0q31uQpIHN\nx/hY7T5YJV+6ifrMnxlK3CjKa51+44C1HXd379JLrKq8QF8Ll9YEG/ZbrCur\n4PtCJ2yFduHfPs3ZVsOB+24GAvNTAzgFD9Go24fI1uGhtyZjTcFNB2zogzN4\n7OE2\r\n=Sd9v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZkRfGeQwnEOvUfbcU9+t0v+K7V7ibHoSUpV5DVriTZAiEAxr0BKiO00w7+p96mIA/U4NrC4Fgy3LHQrk39URdpxNY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191110005338_1573347536618_0.6828743165498994"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191112233537":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191112233537","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2332284dadc02d7312c794a7c188756130f7e96b","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191112233537","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-GMF4oVc3CdsU2Xm94xGg/um8u2/+aMf6SwwfFOyRlGd85q+D7bwzSJGTbkdsMYZgez0VYkF8eE3Vb2YASZUiHw==","shasum":"6a017f7f92dd01ebc5159aee1a52f5595455007a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191112233537.tgz","fileCount":1035,"unpackedSize":3923787,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdy0LzCRA9TVsSAnZWagAADAIP/ig5KlrYVZq6pntyZsDz\naCkC04qHKzKfEpgxHusUpOo41cuaPMKDi9jsvkOzIzualJZWF+Njj0LHfDXF\nmNbiWMgNKScsRSi7kTGoseS5DfH+jLfXhrUgau3sp/CYDiK0ovYrymuKDBPP\nczvsT+LjBjeRdOjn/SFtZtIl6BpyA/Cv396eCohmp0mp5wOgy3VKO4C/qdN2\ntciAHHnWirltagI0Z/n2Yj6+1aS24TuiTCsZPfdMODNBAPsh/TdPuqy4kemZ\naHWzq8NYAJbAcODcwRXSPHfl8bBlmt5gAVGdwTGM9NSWmsgvnIL1WojCiAVc\nklNeny7n+xEmStDbq82ssR4eMVyjRt/g0ySwQl4H6lhtikn/OSbi+FLXjG7l\nlC8Jxob04JhyOBLK2BMx7vBdTUi/lH1Y0/3YIyg3wTBzUc9jqCoMfy5vPjPr\nikDRYZKmvI30t91oNmAL7kCZGeje72nCIq1haSSs+e75Q9aW2ogqmPx8ysYe\nq9RXRwJMCuRfIPt9NvCOoxpYKub7MKegPB8MSAavZ/f5ceTTYkj6ivzuryF8\nGJT6dTt1GcsXQ/UkZFEjSSs6z3gYWTzzc8Vd+OoLQ57tt6+n120K68hT+vAU\nqKFnb3F2pz0fjaJlQ6xnPr/8J4oAGgeR7LWcR6sGkwxoRINkb1IbDRjhYbDA\nrfpO\r\n=qGHI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGUurU6hNbl+JDoSzJgb6uoSny4svRT3ZPeayoEAIT+GAiEA4pgHPgtf9+JFQz8x7cwQ7u5Q26IlSUNxJT4dRfZFJ/g="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191112233537_1573602034437_0.6711169756253212"},"_hasShrinkwrap":false},"1.8.0-master.20191113095747":{"name":"@atomist/automation-client","version":"1.8.0-master.20191113095747","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"876f7f04b9db795f2a353207a14465471f012b3f","_id":"@atomist/automation-client@1.8.0-master.20191113095747","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-zN1P5WyzKR6+DnFpckcRWjBqGSUIJxPNiVKDjZAGWGHP3XxbZCJ5IiEyprhwyCotWASxX+9xcjkywkW1dailog==","shasum":"87e33c79600b1af175793ba0ed62e49abe8272f0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191113095747.tgz","fileCount":1035,"unpackedSize":3924775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdy9apCRA9TVsSAnZWagAA9gMP/iQqiGwrZq91JRu9/v4J\nGuWnM8BsISZxmTPVjaRENN3x/4R3GeKkatt6gYLv/UhpKxP+UUnh4CIlBD3b\n0XqK477KxNFFy51lB6GEG1sxblGRN1C0Hk2ttdwqkb+5D/XUY56IuWZ/O3NF\n/iJzZz6UWqikrlVoEu6khF/gl9kMJ1HUl0O0TvFaA6uamB/+BYPVQQcT3RCC\nlRIA4W5Qo8Kr+qbWr6CSajPQlbfAJdk58ljwqKnH234XAGUH7YcqFwmHukyg\nxvcj3MyxsnanR2CtENQXN1ZKvfkDaBbN5yma4VaECxIovxNQtHVnzJp5/5SG\nw2aZcB9v4WQ9gDMwpBVoLkSqyOnUQNEokrHeWa83DfY2yVDfdgyEgJci+7aL\norFSBoWJp/ydmyEbC4SqTPnPAjqsK5S0RDxK4pwqpUBh27dcRDRvHcCWez88\niWBEvyZDPxnjy0f77AP2ovuJf7jXAu67Y8exNOlNenV4jgQDF+y5q9qJIZcp\ng+omrD2IujFbt2efHHGAmruSVtX/8TH6/urLQLDD3YoEQdjqSW5hVVsP04oS\nGvljOEKe6SBVCfwVxy7BluhD8PPNIo6wkzx5uoG9ptcizTeiKKn2aaE2wcXT\nsG7BTKzbANS4/T3riiCHDHyx/AQbTwonLhy5+T2qQbPfqtq64jxfAmFClsE5\nofYp\r\n=Hq/l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1c7fxiHXT2B8nTq4v+SDZ1btsSRN70slhv2DDemtaOAiEAr9UNUCdTODE105ApMR8oxkMdGdzhnhtPxSyFwNtWMI8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191113095747_1573639848843_0.8789588246715185"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191113162123":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191113162123","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a9cc48088867b826e764d3e4687d553ae94efb56","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191113162123","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-s9thcPk63P1XRK8JxBnPW8dX1/9vZwXkJ7bJwe19GVlHt6s9la8kYyBn51ViBlAC+3p29CZnS/oko6Dkd5N70g==","shasum":"b63b757290445ce63d0abd26fbfa170a247efdf6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191113162123.tgz","fileCount":1035,"unpackedSize":3925139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzC6VCRA9TVsSAnZWagAA2mAQAI3WgcQemCZa/aaKCuJv\nhTAORq4qsTU1FFjjOqsMhuV3oGhsOc9LsU0zPaWUspiNxA8ryvw4FkjL9AMa\nog+EpfjQxe2KemYIh3dJD/JtC4rTStkplhlUvkZ7eSOmc7+J9eS6NQyF+HjN\npuzX2E2bBbqPo+Iw6qb4w7+azWKUILwqje4olWOHnWRJgwYtZmYRcZud/nQn\neoVeiMCK8J2rurMSQkVXr4AS7dWsKnT1z4xAYMENmJt+LMXFQftqayJmnobd\n63A9gyCCcFf1fG8nx+fngJKdv9iS3qD2B4mUDDCwLFtm5lBIn8OpbtcKa1/g\n+Py+315MVDPWc4rWr+PClqkj/2aYqonCjbgHxQsTLlv4O0Y2yutkm0combTB\n11eEvyzOOrcTWYcxdsns0oWNcFJ6gVgpF+VEDrLVsNDtN5tGeMY80aM6C4JZ\nh7DbHghjlPbP8IesdX+aIf0xT93VLF06IL+WZa2lhAwuH+U7fXNrBUiN7E0v\nemUql/XUjYy0Q16tl12H8IO/31SmEoGGQKdYw3DuGgyQttch9F2H14XiqMW7\nRH//TjzWF4tkLi5KUCFLRfr+9Lcw91QMZj4ciVSQ3nRDkZnmIjrhLUw6Xm6C\nfCJlH9BOzl4kkscdqZ7qnQJw1NUlOt4W893dLAe9xjxz+xG39x3pWBl9GgRB\n5idG\r\n=NObV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4Oh0xQXV0r7VOQPPGCKZl7SDy1oLenvncv03I6ErD/gIhAOpEjGCuD2F4wuHJfmMAsASMHhjK/2R/G7uitieI6Oin"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191113162123_1573662356871_0.9640125972079399"},"_hasShrinkwrap":false},"1.8.0-master.20191113185413":{"name":"@atomist/automation-client","version":"1.8.0-master.20191113185413","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9b2aa8bd0bfd7c0938530887324316650b4be456","_id":"@atomist/automation-client@1.8.0-master.20191113185413","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-53HSt+rQpYCij+QoMqdXV1G2VJiAuYqyRacRsBJ3l8540VvySl4eA9jcn8FsAoDmuWBQ920IQUsOgMO2MSbpcw==","shasum":"ff3084060fb0b101f09c07ed4acb452e47d4bd81","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191113185413.tgz","fileCount":1035,"unpackedSize":3924990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzFKGCRA9TVsSAnZWagAAPfkP/2n8fFdkYj7Pz65p4uoF\nDqToU0DkAUAgy2hFZVZF8116yn+FNqx5clc5bXIojjhv8uXVXbdOWOuW+u6s\niRFN3Xydt1hbg04e5M5jPlZjdi/ZscPCylhZIIjrSzpforfG7R5M+DnrWLUr\nRsYBaqvysLnVeBIFpZnTYVdgqBgTjNnpvy8ZFFS3GZfYvI0bhbgNvCfrJ4oE\nXgC0RNuNJmWu5rpGX7TIh6wp2inwQaBQjPUpxOo5Rh2l9E14eT4sNmNr/b0V\nW4v57/AATqOgtJzqIFBZgfzCFo0sCxikdRWu2T1Xw2tKgbpfiQAOeuTt8s20\nCghCHBHmC7j1HLSKLuZ3595tzexBgGN6GzZJ0agf5zQxEpTnh8unPDHdPNgX\ngMTDp0f7j0VY1qsbSwunssos2unBgAvIssmMfhSpqAfZ2hgIAE67WZbmlED3\nm1llUTqCz43juDO2PneoAxtwv++O4VC4hskMtNt3qLoJLjGiUCja2cFOl1yp\nxlEE5H+rD9LGV/FW/bv56ru0r3gGc2zGZ03VStGv4pc0FR8RDPWxBQ6lcVU1\n/jL449pYgE+9f44r8eTIZYjzR9BejgV3yYpDQLaU7fn8mYwfl7jCzTYGD758\nI4sLzVWVOkXF0kt5nOjT8Vs2PPmfX3yXcW0rBV0KmWtovScnO0lTqHCusvua\ns2Im\r\n=iQpW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHuAsgLfUnnoDlm6Vyi+JTeccKP5Ssv6+NtlFsefRXvJAiBkOeVIdbQmR3KptqCkKJW18lkdc3UtTWvdhbgpvQ88Cg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191113185413_1573671555843_0.6033585785988558"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191114172242":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191114172242","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"00e00b499b66319730d59dd7a0493caab04c7d70","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191114172242","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-hxJcLLLb91hyi9NfX8PIPTVvXljdp6DyW7vOns3wrF1Li1C7TcK38vFWSyU5XTsjTYL/VE254H+2djHHlsmDAg==","shasum":"811b61b775eedc4ff6fff0c3ac123f1217a301c5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191114172242.tgz","fileCount":1040,"unpackedSize":3929102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzZFICRA9TVsSAnZWagAAByAP/3pwyjkwlAKAiM8wzjVg\ngpiOmSTEHhGpSF0ft+/unj3sKCEYII5BHEbSslxMuqQKZIulwEyEZ6e/Sg2S\npY+0qlx3aJYo/L89P8p5h4U9xLXn7yASRyU/MNy19iU2IpOyuz1mOlhdtuxC\nm2mZxuxo4Zp2Ezq4J7viiReX9NwX9p/LDzSihq9TP53OqhovZH4PQ4GSrOnx\nf79F1tK7jwUqB6M+HVgDu1T0v6od5nSLSMx9/i76T1Cx3/mV+0aq6UlLdJdI\n3Y0oJdyPsZHujXbuyn42XzF0wkeHWD7gceuNtoEaNWsLer/gveZaBltNn9n5\nPpXyE+aglUlCf9e6SXsXNz5rccHY33jnzSSrgQ7ksISWb0XGLIG1h/PpZSNX\nr4TwPsNV62OsWLltA89BalgpJjwb4GNAu+r6t+DsR8rVfQLKKY6TrXiX4lym\noyFpqnI9ksCDT/Z5q7Azfnj28Vml/lSb/0KwlOtAZQw9EK8qQUAqmPKo1h5K\ncDIiKuUAIp2DKIXbiODcnXjijLL8uo3YZMhsHIeiYZpTiq95+K4CeJQT9Xh4\nN1mDp40oGQ0ziZqs+VUEy3teUGenamDdACgUOJQmFUkceRItSiaPkPr9MEyU\nQ2waQiv+xupg2tGrhScemRWN5KbN+eDGjQ4tA+ud7ZpNnvE185t3jLNsXTFP\nZdPv\r\n=Ls+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcOmdCm9NE4+lflFqTmGZZYdm4XrDD3b17AGIqZwzrfAIhAPI0A1ylJ8Ogw2pywrVNbVdCJJLpOK+2FsWVhkpjxRlD"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191114172242_1573753159981_0.27999154325957853"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191114213427":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191114213427","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0272b57527c3bf73bb3ec3d1c261f469c485b629","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191114213427","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-nf8fF04QFiVP6ESRwV+mL307LSKT+k4wMgAMufYiWNaesFmoybWHF0DwdFRnV9XHM8aVfiCw9zHhrrseJi3kPQ==","shasum":"837c9c54090bd787d5054aac8c8bb99e3855a4dd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191114213427.tgz","fileCount":1040,"unpackedSize":3932862,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzcmKCRA9TVsSAnZWagAAfKgP/3r7URRmMctDtLiemy5a\n66eXxq36sZsbJ8NF6wj5WY7M7PkC93MX6oFlJUKjuTVQanP6/kHkMuOk7YPe\nmBvarOHwA4VElS9RWJaXR8OKg7tulCnx4tUgQIeh6J94wJwyEI27Pi4gXayE\nN+RIcm0yDq8KSc+P47DaRg3VNkbWb0eeusFsnmxpB5k7fBBsGwWPEich/fy6\nP6s6ER0Xv43hCBtjPXIGwVlOSgprtwc9jUwL5/Y0Qri7DPeAHpaypdezzbaS\nU+0cyOScvZZ5dPLhbSFiI+DYOVlHr0pXMUnp6eRDlcb+iIHT5enC0OdvjDc8\neAJveZeGZ0qjoUVk4beQ2M6LPrj5ogW6hj42zRrWJPq5G25TSfS8hjMb8cZv\nkNm7biAZQgbDv0u3Tyu9OuwJSnCX3ThPSY1eWiK90nPxUyzosDsLSUYkPS7n\nGYrrHx7Bv7snolpv0y1OghlsezNmmtPUvub1XHi0g8g52IpxOGCNy05z4Z3E\n1y1R/HjAlr2hbIqR/DpYPXIbFrhvLFnM7atFy9Ew/qWtlAv4/17MAhiTlnQ5\nNK0YgYOTWavZjgSvxfWsyAsk8am01usCASuTL7yyYMBiWhMqRgqzn3YUSLKH\nh5keGdpRNEfdLNaNXoUvQR4osUtitdiuZjsI7cuaB0w5q8Rzc33HsyAX07uD\noxqL\r\n=0Ssr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZmdm1aafgxXCsTof1QKVfYyiQwS8HkPyc+77ko89bXAIgKsyt67JIHKH/XRD92dB47Wv8BRmG7n+QjzsOBqyS000="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191114213427_1573767561745_0.26625916228676805"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191119211945":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191119211945","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2357c6dc605bd7e8491c07296e51d64fd3d5430c","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191119211945","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-krdp7dsCJL74h4c1KUvQsfeC0IHLzaztUY5SAVgesWKCjDCKDsLlfnUPIXy0mCDqs5vYgbD7iy8C78w2MrKAJQ==","shasum":"598e02a3850892880e31adb6a5e189d5a3ce1ac1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191119211945.tgz","fileCount":1040,"unpackedSize":3933288,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1F1tCRA9TVsSAnZWagAAHMAQAJm7WY9jNi/FEdFPFk0Q\nFQ7PqWP6v47yau3tmStCy+MH6jvPYbf1LOyHb2SsiNFkavS3fR/JtucK4V8F\nz39BQfidaNyP/a+vQ0qOl9WehKT0M3U0KznVIswqMqkNKS3TO7U9oWgJn0I0\nZbJufulGxWP+BMj5ealM9wONI4DQmgURyFqbrR883NAy35LJiqoaT4ORxRpA\nPTvBaPwNJ7hHfEhEIPxeq+ITjzBwpNHXcw6OstqdIIIL40QU3sn8EI19K/PN\nhckPH/VQmMLwu8NpN42sil4MjQd1kQuL9lPewOlFoW00npwn6aPRkDtsrql+\nQ7HSl2GVALxOThVje4oc9UhVHho4hJuHhqU657MzLoIa1FA1+ln+qb+u31IN\nqfS/JZFbrS+ICwrZ+wZddC5CSAebRg1XU0dHkgzBwV5oLof7vgK1ThNtWWOZ\n3EKpsrRgHUWnjnLiR+NipzLk/55VDz7UWgMDd72GVMCbnieR6IZA0aq4PFqE\nKRfbqCW4ovtoiSmpn0e8uvIPO+EkOkTviLJ/jUHznVLz274Lqc8c+IIp9FtT\nUkchku/hF6pgIylFoQcSOkIrZPuhEWyq7l+4Dc7dDsfiV+tpnGkn0+OxrBdZ\nPBFQJL74ClrvDce072h/8spmqFZY7U1DgCDxWgfxq2e8yRIRSaMT4DeNOgRL\nRrtd\r\n=IWQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmvpMEI+KzawJw2IU0VVTKFvATNDtzCRyrF2Zlq5igGQIhANqUv5MgVgN/gijHOuM+H/EM+ZMsR5s6q63SK7FMrwcl"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191119211945_1574198637190_0.8316034138190598"},"_hasShrinkwrap":false},"1.8.0-custom-schema-types.20191120165441":{"name":"@atomist/automation-client","version":"1.8.0-custom-schema-types.20191120165441","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4d5549b3f2798d958c0dab4d02ce047b27adf3b8","_id":"@atomist/automation-client@1.8.0-custom-schema-types.20191120165441","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-C+x6aHmCY34JCwqD/VA6/+N1CNLRzY2GDrio2MkY8LozsxlihdEFqWD2Dte57+uHvB2bhQsWIZlutPLidC5jkg==","shasum":"b81c9b93ce1bae471421ca9cde2d5d5d7fdb7643","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-custom-schema-types.20191120165441.tgz","fileCount":1035,"unpackedSize":3925127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1XEuCRA9TVsSAnZWagAAxYwP/0KA7cy2CCNClQyqZCYB\nDpjhuwzx8yLovx47gTme+kfb99karjut/OVW/abqCLawj38AOepBBIkES1qu\noFVWTvM+prEbcgRh/4ssw9+SkNTkPkyt3ZJVY0uc1Tn7tPGxuejmGk+859rC\nuiYkfskD5/jgexS93O0VThApp+7buMHSF7syNbodl9Aw82QSOMc8DML6RMu3\n1uq8dGjPhwk5vu4RcABqzVopAfcD2CAjJV5hqwcF/5CkRAOWfV8Q/dtc/C2g\nL62zNkqgWCdUhkvSd8kYc24AJqDFXVAOCj+6MyY0P/zvJObCwcXeKvDsGnwr\nyMeiKlcidvbYqciIymt+8PF1/odXDbelM97n2PwC+u2Ihb7TPzzfgDCrVh97\nGBMH/bcPPcb6cu/fLJn5D+Jyb1DdiCTWRx+UOE3okcMJh2j3eJl9BSbVLWS6\nRs8I4fYbw3lVd3A0Vm/EedJDs9szp48dbpBGHOT3k68vbrDT5vkt4LgTUSpS\nWr3JyZfJFjFv0GDKsaewA7n3B9wwYDlEKBwefKZwbeZxafxk7YR0/L9CBAt6\nV3CbhGnnirsrs9DzVrwdp64YJkfzM1jZAZPwrXaRxhkkxwSQdTJ67r2PPX9Y\nkt5i47GjOo9zRsg2V2exxc2mt9O0ahEg2W0vJ0T9UxtLBcKQ9MDzhPnfEOXf\nYvNg\r\n=Vghf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdj6psRWONDHJuCx6dIw2Ch0tIUVYFZ+q6BCUgsHs7/AIhAKAZ0ynWmMfStPOp2/HAvinzVY0/BhruOhh/PzQJ3gzG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-custom-schema-types.20191120165441_1574269229318_0.9228856549777089"},"_hasShrinkwrap":false},"1.8.0-master.20191121010001":{"name":"@atomist/automation-client","version":"1.8.0-master.20191121010001","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"75a9899c691868e5bd6216e5551b1c04abaddc68","_id":"@atomist/automation-client@1.8.0-master.20191121010001","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-GMexDPjvBC+1Pfrf2eEYeZMfd1PpbuNEbybsy5wTCBd4RTrQRA8SbhoZ9lD3xkoK466ViWge+VptP80Q9NL9Ig==","shasum":"bd363708501e58b3d3f3c94b926654ade22338bf","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191121010001.tgz","fileCount":1035,"unpackedSize":3924990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1eKQCRA9TVsSAnZWagAAEwsP/1P7y6bnJGQwNiCKqY3C\nBpBEggyMWqqf46JeQo1EqmZ6wDyFBdzB1MEIc69hcHmGrO9MTsaK2g3p4Ahi\n9e9kR8O2e+tEp0RhQW39pc9X824deOUkOtBNqsEZ6sULy09QnfT2jYqyxMWs\nsyaT7NK6AW8pVsp/MmkxSVaAGv8YLaFckOiJ1k8ra2Dw0+jRwTud/HiHIQzL\nMZem5MAyFksgJaW/PCK2evXtbXf81HontrHR6XfpFilGu9hhUVGsP+52RH8P\nHGcCvHbJgQmZnfXrJk1t1N5Fn2DCZ03BFrGDwva9DVULMJh00jDfm6JVL0Ya\nrhKyOnuIwKHENlqKUsDa6fWbx0To2yE2cx2qevxAjT6Uxt5V/l4MW+H68Kp+\nYUJCJKjl1PKLqFB6sSEi+ozAJh0+LxIZpx/llKlWZchJbMHJIzLaFc0hPczQ\n+TmAsM4O+MKDOznwIC6ZvIvdYWg7JiJeKORhHYPA02DqJXxwf37styCYyhUx\nzEpQs5cHbM4CDosunT7SJsIgblwAyhKst1gxxNNQNdZrMxtkkaDIaDRHhR8n\nJ7t6j6PJof6fHbzP5dW/PuMxI85C6RpLoh9GUC4qc5JUoyriGxQ+y72YeGH2\ntyPAV+odazMX63MoYdBgGtbL+URzjXVhUE/Mbhy/xTWHB1dXZwVBIHIfCLli\n6NRV\r\n=bjfc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt/YoMuzx1OCbsttnmECtVoibQGGxaJY9hyTGV+MOObwIhALTcgCVql1H8uj3P/J2s9kG12k6FnG2sugpmK/z7BBsr"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191121010001_1574298255307_0.7544505253145601"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123062556":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123062556","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2c6989ad337c5fadfc13d5bf7748dae3c018c592","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123062556","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-hepLovkvCBAYExkaP4VU+YHX2kki5po3539fjVpYT/CV9Zy1/AK+1VGqzvc+pvseM7usCjrQQiTuxJcq6CFMAg==","shasum":"539cb16fa7b7a21c83cd87d8c70a369b757cbb28","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123062556.tgz","fileCount":1040,"unpackedSize":3933858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2NHCCRA9TVsSAnZWagAAPM0P/2gNUGzIXcbR+D8Xitve\nR//Px6m3CX1CGfB8Bnp0e1u2dSpenw66hYieemNUNdJc1/TcBWjsQz5ue+5n\n6nv9tHSfr4qpRB04T/bu1dZC3T7KWoHn3O8wdZKCrqXCPxE6kbg0UPBfHwUx\n5Yd09IWuX6dobfpMvzBkfh3rptKIsekjo5WEyS3HYVyLopSM40eY9khlsXfn\n7EKd0MXjHf09gpPsMeNMhXERYGTI2AWQZuf1zzH8XxxValKe3c9YwrCH6ulx\n8xoXXzp0Z7xXo9zz2M4tnbPZqDIe3xN6MuueiMUqhAA9Frptr4Tg/xoQY/Sz\nUpf7y64Os8G3UQ4ZnaMJeU3EZKPR9folUz6185bCvdyVE2F6kRWcnkA2X3sk\ncSvIQzNP9DZtDuQ4Y/MONdvDyh8F0UeNs7by6f2MxsdCezFLoQT173Wg5Q3N\nh3lRbn03zJ1o7R4z4jEemIfI82Y7CnQSI90kdbs1pf5Y8J/KWHiZC63zR17X\nE28kTyoHa+JpZJeqgcMlDwdVv9xbk3IEhASN4TvqhEn4r1rg3/VKlKjW+5o9\nyhtPU/XMdmTCLr8E34XO4Ud/3KdFZlc6m7VtfTNoqpwkpB7kUyCZ93kxPaWi\nUcwCDa4Qg94kNanTxplVcc2jFxS8rzv6VllCNGpcInayt6pL7T1VipJ0jacx\nfRno\r\n=jqqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFeCe9iDSpGoh3GN5DmrskJ6sYj8fQtfeFA45A9Q5apVAiA/XrbHhkVY+XCaWeC6PrzuHKEPUd0jn6juZZXsXrzbdw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123062556_1574490562073_0.9880725549760465"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123151009":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123151009","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ada7036d96464065e751da0792aacfdb43aa0f46","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123151009","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-nyOiSWqElujaq8CraiHS1heaRf3pKcmHk1HId2gRpYbndf6DP/6l4OZDATfYAVwvs0t4ZqodAJx7fe/9zIv3sw==","shasum":"2abc3dd7c6106516198a7e40c46f730a4aa86863","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123151009.tgz","fileCount":1040,"unpackedSize":3934890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2UyZCRA9TVsSAnZWagAApHUQAIx3MjlytKSHSViq+/+4\nuTPI7mW91n9kvgJtSN9DsPO+eyJrvKOrqk1xgb2W3tjhjn4KDr7wd+Bc4rui\nOD8oGa8qauIgvXsH4Wuvk3oekfPxKdll7528QAuhDx79KNgvhjZtzwF6ChET\n2aOy/91QRcTycFepXMBtAHvvZPMjVbKSGkMAmlMXLB3kafGpkziJ0ib/Rsnk\nRv1ctxhlic7+ut4n3JQLArQmjv6xvvaCb5sNGbyTarN3mpHMcfApv1hgY/5x\nBgkHLH0oj6bVGKxYz66z+W0omXe6J0QRbajPzDBOa2+1gkGDmFPAIkIb03j4\ncM72upa6k+1OYdwAltK4xfTbgOsVk5SUEoQqGEe8HFKmAdkXmL5Dc6wnxAXE\noOI3rVp4HOO/5XYir1Tub7Objp75DOma94KfeL1lO0OOzQbtJPHo9qO5h5kA\nTG0IfUbPk/REbZsRpRh7H8Cne+IRw4Ke8XH7/OSjwTD90tBCagvbY70CGk6q\nr2S6tFncqcNJXe26OzLKeKXcwMBHscaICj16VJ3vwuFCb6H64Xi9NR4ZLiFS\nnw3B+UdvjLyYtYyKokyJEo9QmUjJl22w3BZAy91doEr/N0I4AWIHVmU/t/+3\ns01eSI7eht6KOUFitQaI+0DvwgaECG/YQ3CFJvaN7P0eTCVSz9mWus4pbcWj\n5Kct\r\n=1JUs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAng7GxOflgRbKv3/mjwtze2HsPZpC/kJkLMwubPePepAiEAyn++SgoYnoi+viDH8J9jTF0Wg1FXx4j8LalqrMdUOGI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123151009_1574522009020_0.8104578286359587"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123151746":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123151746","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3f483d45d3c35e5ab2fc1b2e0e912c66eab9fc9f","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123151746","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-PgRBD9SEtOSOVsDE+UyfjeZ6fLZ1GGvfUfDyuRYpFiL0+asU9WgFzJIwfAajAJUSPuy8PN2DsmDMvYciFz3k5w==","shasum":"285853f4994200afc95ca6da22834b85086482fa","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123151746.tgz","fileCount":1040,"unpackedSize":3938019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2U5fCRA9TVsSAnZWagAAQOsP/0K6E5U7umbPwURXqLXV\n/GhYQRnWTM7ec+CIYZ4CXyawXn139h6/OXj3MENU7LWGxn4vxQ8kS2oz2cmq\na8FxW04kUJyrKwRA0hQpp2CLMDPxQyw+sggr6YR6aFvijExR+hgQ4qy1y6GB\nDpbluii39QXr1Sn+c8d4MPvM+n3JKjNwwzdc65AK9aj7soxi8k12BojdioMx\nbUZwRhHKScIiGf7wiydCSuiqrZiwHheR8GBH/wg8Jk/NXhvkRiJqnqOnIE/T\niFObZ3lh11dz4rodlaXUEUbb1SPiSSYV0u4TCmAEq8EfU6srs83r4D1FvfR6\nCns9FfjUc6C0EJ/nSvAtg9VhX//NcXeG6dmmzGeAYqBLPt10x4X+xhssP/oz\n8NTLASjvkyIRM9yuZ/RCEYiLdJkH4ZuUyYLt7EFW0USW/70SMNw2Y8ukSlu7\n8YNv7It9qVi7ux5vrC9YtrSewCZ3O+EwErSLk0GRkmWQpHFoaItxxDgNfs6E\n4bakJ1MXcnBuaxmTNAjWDuOnF4EyqL52ksZUrHiAGNjP1TALiLEft6ZDcIOj\nM9j96cbZdQHMwSB0/15SJEiwypTtQnHc3qL9y6ZR0RxQB4ttC3FrBsumvz3k\nqlM5puUNXJHkRWOKtSIMYMYVWvZHEUO9heY7f9TcyfySEfKOwAN7lxX+irgV\n8zYY\r\n=+vlz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8jrKqa+VpgKq0yGOHIqJUOEj+TTATJeIORlkvA2KjKwIhAO1nOkSnq7RYOgiG4zifd3Oo6/Uym2hMDf3hHnlcmH8C"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123151746_1574522463202_0.11325210079439985"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123154421":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123154421","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0d40b4cb383801311778a86c938c1e554adb2e70","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123154421","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-bdEdGfLRLKyUFncT4dXZMag2Aux814bEIP8c2YYqpTc9mrgvbyqDWU6QaJVysCtwXd2DtfFNp+Jv3CMXHPbhaQ==","shasum":"39e12d13ad5fd87a599b225cf244190b7a9cb4d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123154421.tgz","fileCount":1040,"unpackedSize":3939448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2VSbCRA9TVsSAnZWagAAZ8UP/2gFS1C4XCbFyXIpJCsU\nfplA+ccq70eTlFgBoAGVUwZrp8QZTJrF3EJ6Q9Cy4EfLfBVVQF1bvwOOuuAt\n35RVKxIwrpIArPQEDI+bQGucGy0j0DH0LsTXE8gm4Iekg/uODQjk0WDgBu+3\nkUYb3M+cBbTMI0Jw/pqivXutUx902U1Eo62Rz6jC/k0ZwGhoIqUT87xMmgfc\nA4l1Mvav6geNAO6j/zgjO74B0kKbnjAIldukUNcU9ZZW/5dk2e+uWpCjVowc\nXrEXdDfAErI1Tgv1ivZ3oFQz8auomUh+CsGd0amSz23D0bmiuLRvODa12ooZ\nGCFjesJZXeBm8g6DNLCJj13kCBg07ybahDOUYJ1unetoTD7n7BhHh0yOZYjY\nHV3mLZHzdN4EfJMDUtkWOcJ/WYVJe6K/BVlchfVVgf94N2y/0966ykrulYWA\nYKm7MYclszuoANHvfy/Q/hh6JHnSRKVwaUZpZK0f4F4o+fL8rDypftty82Db\nOqnRIPpVB0UesNEhJ6NMWbuFRPWMcNscLsJ03RBW3y7vG2SK5yOzYQb7B/bc\nnIkdn801rECNWerhHABhNCcWqzmNGsbv07Plz3Rz4J40FOeB4CrL8+8CDW7O\nP2t5pL7bZ6D4sriaADAagxW8fD5hSMg4/1EjVBrInJlWuvNVYJQCbH61byTt\nCHnA\r\n=P7O2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETPbF7cFpfzaWNVkES/sTNCUqIutexwbZ6gJAUxGDhTAiAOU07vmtwMEEJxpRSFs2SlwmrkGbQcQlKJKvWoBI/BvQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123154421_1574524058684_0.7334503114231288"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123155104":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123155104","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d5ed909ba65d0f185d81565e33b27d88ce4e6780","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123155104","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-WBCs752drXqHf5txFSQQxJXtOXrnwkJLezcp/TAo0J7WVYL6RfmGfuQk9V8pWg7t5B4OUvYQ2uDehl0emNFMYg==","shasum":"c0d486c21816aea86c83c61d78ace0171dc1b88a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123155104.tgz","fileCount":1040,"unpackedSize":3939969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2VY7CRA9TVsSAnZWagAA3/4P/2ksvqniVnkZMM5bBWCK\nTMTH7ZhNDyx/kjsRwJ8mUm7NhoWobF97sSX/aXwsDi9sHkzh3LsJDw/4HcVC\nZ3oAf69fL7kzCYuPL5fJK73YdEFpaC2XL78Avy+9xbndmJ7hxlcKLLAKRyfF\ns7zkqUri0qTm96TwimH16nXCETqRbqaEyl9V3644OFoV8YsqSq8AfJF0KKw/\ncP2j1LgcCkLNbcuuw9D/kx+dNqQ44HtYBvazlT9dtY7ZNGbGXew4mkYXnXxR\nCjCn74O/2WcBfH0o7ZC9ZBGmewxAKDa/ltnTt7x2QQfUO3cYSfU9w0hf7RkO\njt9MDFQpeuVi84kXd/1p10SxbtWDNGrTPmaTD30sJ3xw8rAxx0m0/ax8agu/\nlumX7PV/47qWKXuivLM5dd/csm+k1/5ybVfUpVKcgVcHpPeIVHsgsXWjH8LJ\nGtu3INyRuSGDn3KRBzkZO5m4vL7b4kHVodoB8TPFdwUS4coTBXyef5UTFuQY\njVuEmi6HAhWuZApRnmMrERgmnrqmuI+REWA1s3CfARFNf43LV2Ukti97UQjI\nKo3kvdqHlhI3nuUnqtD3/4D8G43KaIvp5XifQZi2UEjSZBVbHmFOGZ38PSj3\n5QPaBDyj4fmazUtCA4U42ltTD4ew+ePEkMUfb78tmpc59W7YI0asjaORhfWw\nHfvc\r\n=f3Bf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHk/yEpw6FfD6GrqUrm0yt8DIsaZ8lvqcd2d0nqK5SHwIhAKuOZtUrRkRPQYsjTpOBAK/RIsvPdyJrKRtKLDOcFy+I"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123155104_1574524474601_0.050119811296404304"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191123160218":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191123160218","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c089dbbe10a902751dd649e94e1b6bb42d6bd861","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191123160218","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-GakWndPmvPTh+NdXDuN7Zx23vA+5e1ERQBygBICw3dG5aZKjGFOGSFVV0AScMggXOh6s5qns5C7xtsPS7xr7sA==","shasum":"fc21096c04704b60c1cdbf59bf428720ad81f062","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191123160218.tgz","fileCount":1040,"unpackedSize":3939993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2Vl+CRA9TVsSAnZWagAAi6IP+QDzeYUMyxH4TiPu3/a+\nug7yaH2vcJ5a5Frb7JhL343O/2gJndVi9kxJ+53Ufzl4qsw6kQOxhi5B0RZc\nL12HH9LhsknInwAxsP2PG5gNwUYMTIimgpNcwSa7uZbKOMFNJskiBKWJya1f\nROts1/09n15+yf08WrzadspZFEZDxTbty0mxnQu6BI4rAZ9eMO0zRZt+4NyZ\nljbgYAo43zM2l1FYurSE7MNIuepeNe3PQ2u+/h8Y8e59QjhgyoFZTtycplIF\nnAdlwpk7GVPyZu7XIfgTyIA3VexLJXaI96JLUHMYk95+GCTCthSQRXts6seT\nwZERE43l2thE/MTiSsQ072T3iMFoQ2pRYkHxZ401IooFGzhZZ/PXERYmiTdy\n6cjFxf1SUBjtp7gUR27+6dsFnFRXTT1pNAIo4vwEKshLZRmTdYVzuG71u3c1\nyh3HzSPK7ZGOCvFoIDf77FtTKV9+mX0/yAlg3k3KRQMA2ZQZPlFDbzuPYP9+\nhqg/Jj7ayiIgWlzHvWd6uMWVl8mYV9CYrAJsudAhGvVGYE7faVuL1cV8wleW\nWOB66Ng1NYaVgtbikl8G6/6iRTNRsHSnBr2xwjFXdEn85XsEAwBhKFzDfRWy\nH3E5OSj7WQploKbxaVpJCrxdbCIUR5Kcbw11UwRqSIhLy5EGSkb79QefyKXu\nmiLz\r\n=torB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtoiSnxSkZpPCezyWoLH11usnAT7aU9lTIfYldt8KbYQIgcNrTk4jG1Y+vvXq1kStIYBgn+MWwMGRnknYILqmui5A="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191123160218_1574525309457_0.5596279373945874"},"_hasShrinkwrap":false},"1.8.0-dynamic-goals.20191202211216":{"name":"@atomist/automation-client","version":"1.8.0-dynamic-goals.20191202211216","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.6.4","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"_comment":"TODO cd added direct dev dependency to handlebars to fix security warning with typedoc referencing an old version of it","devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","handlebars":"^4.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.19.0","typedoc":"^0.15.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"45e6af36cb09080c2380573d31dab047e50150dd","_id":"@atomist/automation-client@1.8.0-dynamic-goals.20191202211216","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-GRE3+MION3wSdpIK4vPDnXymQc3O0tuJf3WNtRElYJsooclfj9NdUbTVfC9IftJ3g565rft3jDE0MEVVaru2fQ==","shasum":"d54864b588d4c833adf310ddd2040c0d98b4e903","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-dynamic-goals.20191202211216.tgz","fileCount":1040,"unpackedSize":4377976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5X/RCRA9TVsSAnZWagAArdQP+gIGJ5nsDmtAW/DHtpkT\nXnaISj1xmG4BuJ3PYdmmdVFqKF+ETlxnV6TfAVena502sIByzlp2+WZO9zq8\nE8sBledi1wfdHPFfinTZ4oZj7fUsu1NldNx89gwd8URBhZLLA69jKmEKNogw\nxqx3r2gk4F12sndC7zbcZDbL0eUYeOkuGpx8zD95ojVfimuk1X+bSdMf7X8s\nf0/bxtppI8xEwArA7266VLlvZ4E7dwpjHLScbUFSrYimxBqLCvIAdqEEICdt\nnRoh432Ok7j25wZOkwxfHGXUdVrLZYQ49PV8z1SFW9SF99UbC6JlM7B7O0td\nb+LRoWHWl51Q7xLdEiP01eCxG2zoKYSIF27/xQSI04eZF3nTNdZ6/3Cldd9d\nErAORqTRkG54zwSzPdLQ5fNBNsDn4NWL3lsDlC1vm7xXRkg2Vrkc9bgTp3AL\ngeSsXoq8ViJSkKuwPuXSpP6c4jV98VN9zMbQC6Gc6CPHyDh4Yt+8aeNj4MPm\nlTI2vTLNiRXjfLo8kwvJ6nWnZe2R6JvA2xmh5kTJPdcB2KLLM2P2lnHCiNZD\ndHRzfL2DnAtmBs3nuULTGWXzwVFaOyKsW/2eipVkool59S3BlIsFyq7q7qpp\nhHMWtHgO9MSZnw/yrayEm+WY008vZeR8pn32gN9v3J3cAdkAnhdDb8W0El7Z\nbHuU\r\n=/lqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQXs5Me0aXfsDe479xoVTR78E2u2vLViNoeEt63dDosQIgeBoRE/HlU9YbpqZOKO2TPaUsvWlQm2R4wDTJ8pzHnPg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-dynamic-goals.20191202211216_1575321552575_0.7663629764600994"},"_hasShrinkwrap":false},"1.8.0-master.20191206130510":{"name":"@atomist/automation-client","version":"1.8.0-master.20191206130510","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"23c3d8d90233de2b4c8c8f76e891f4117a441c3c","_id":"@atomist/automation-client@1.8.0-master.20191206130510","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-cIoZy8cseUsU6IcpNCWJYptM9zBhAthyLCUhAZ/dP92wfBGntsg5olgV4Rz8yRCKreY5OzPa/AKCssQIWzlP/w==","shasum":"50bf90566e7f54510bbff5581425bdaa46bd772d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0-master.20191206130510.tgz","fileCount":1035,"unpackedSize":3925048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6lLqCRA9TVsSAnZWagAADZcP/3MMAlV0NX2claG9Nn3W\ncvrF6c5cxeNqONKa04innt2qGkiMbOH1hK4ZIWQrmYIKP9HUT2ihMMCizOJn\nGdLRGgBMQjzxv7OtdC01di2kXkAGAwBR56TskkMGa8y1vlZiX5b2o63N1J5m\n6Zm6bYouwJRyjaf/YlQHQgveASapbyKPVkOd570LYz7LDIjGl+mCCeSqer7D\nbNn4LuKiFfrWazUpLdVfbOTvXRfRdLCZxyeyHn/B94f6+15RVS5g6KNcqtmO\nSil+MbBwq8rNth7Y/NK5qY80m4UJwDclcPnyBbT6ybTaWbH3tNEAItxqBW5v\nN4FEjCI3UizSFgIw+Y+ipqD37OoBNbgV6lAS7p95SPcRrpLsdcbGcEK/l5t3\neTe0P7uvpvWnO/5GvGJb5zq5LWvMI94nL4RJEAdJCvfzw5g7CXVUDkVu+ymo\nKHvBaT7x4uxZFklhTGMQjS76mvjoMh4J2/EDF5DVTkHctRw8ZkWtZwmcFZ32\nVcbF/jPNmq+WZQcInaMqUVyz5DbMPXc/K6Tr6tCasrpEhOcHp1UIiamppgoE\naMyhjPb6JMAbDys+/eDv9YDJxj76gMsEqJDrdpY/ByvAv2eAoGHIFbK67c72\nYJvhzdwdpNbJIZGantU0lKbe6D6IxPxs3W9d9EffQnXV9dHprS1GvFQiDVwM\n1Eug\r\n=nOOm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKSvqUNDPXZxsInbxpyQpV7AJUBDRvo94UzzLlMyE/MgIgHjNa+RitOCdZrhE3+i7bSFq542lV+8E2Igggkat+qpA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0-master.20191206130510_1575637738005_0.8097443968027427"},"_hasShrinkwrap":false},"1.8.0":{"name":"@atomist/automation-client","version":"1.8.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"eab3a5c5bd5d62f5e9e59394ccaa1c08bd43ba46","_id":"@atomist/automation-client@1.8.0","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-kJptvvVDIadJsf4gYyjSntDhMxoswScwRJoHo7jj6GFwNqY35VU+TU9wDRAm++VUUJIrALIK/2J6emUJmBRK5Q==","shasum":"0863c0a78fc25c0c1915381b8fa5845a8b5b1b87","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.0.tgz","fileCount":1035,"unpackedSize":3925026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6lVzCRA9TVsSAnZWagAAJYMP+wQNc+FzMhtrFMyTmIJA\nSTLkQqUV4wWLJHGlTSm7SOQcqgM/B9esHiHjzeEMPKvJ60yUk2czEhTYUxan\nvt/sRmXvgcRGXM1/B36dKicgJm2YF9DctZ+YPX+2I9t5MKF+IueyIAd9HIHU\nZ2IQ+JTiBxyhjiplxe+ReQLTjImJilZO1wxSun8k6dCjXCQhfwZIkorCMgO6\nm0qQEJCX73umVZCEc97rslF6Z1EMt9zCXdEPyjcS45lx3amlwx0wmfqbbxhl\niIzEI30fQqavgaICSOinmat85c3B9i6SRBrFS8r0Y03VGigUdZW1zQwkVGvL\n5leZExcAqG4RZYt8pbD39AHPbTcxOzvoUaS9MTXP/okgYywWeYpz8BQAH/Fz\nL9FxGeF4E5LFC35IK7yyGFBDUCGJpdvbyy4hJ3scKajfvdSnH7z0hp+D2oSt\nojAp+qqGE81qSNjO7+Uo2lwJOKkqmVuAV7PwyAZLasONlqq4TWyu0YNQtPkt\nvtAA1D32lqUh6cdJITdRBrTlQledD1RdVh5UwLGs3nh9NAZ7Q0Y+fS+KVl/z\nLkDWnlCnCT7ldRL54GXENIlLHzJwPMga3MRpTEIakvj4yWD2SfWjgmJNt0zF\nqpJhHx5o7KgXIXVl/Y85Dt6N6zBUZpTfMlnTG68rKYyAN8htjnNrVLxO48VL\nt+LL\r\n=Sv+/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE7/z/5RBxNWZyBhDuglQkmCeAoRiKAwMeLrbw9vpGwkAiEAyVQ5uYPyBiLQMAiyrsKuXllV5Y9RWYcxL+d+dWYz4lM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.0_1575638384361_0.4794006584409609"},"_hasShrinkwrap":false},"1.8.1-master.20191206141736":{"name":"@atomist/automation-client","version":"1.8.1-master.20191206141736","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3d386bfeea2d5ef044adc054987705b321beb09d","_id":"@atomist/automation-client@1.8.1-master.20191206141736","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-iEvcEkMjdTiIIxngEfoZQqCv6uB/TNx2eaRCfXlCgyubaNp5omPtxQo668ProD1HyhQCpso4TyHLhpF31bgsTQ==","shasum":"35f5be2730f637b18fdc521e8d7be8c2fa6283e2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.1-master.20191206141736.tgz","fileCount":1040,"unpackedSize":4378338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6mPjCRA9TVsSAnZWagAAchoP/0fbKLAobQubif1UScGB\nM2G3a5QpkxybwnsP+EsLWHvl/PVkhieZnJX/ChNYpO/12g1jFMdsxIANMYYF\nbkMXYWDkBOuJleFrJ9mpXgQmQNBHV7VWU8gG2V6if2qG3WPT1RPZEtehxL5b\nyULBmarigcAFsgDsDlLirD24bDlXsus44sb29cnnyOCIqThkeVneVcMZTyO4\nQ0aIfQpyjK4rSVilMkm0RqFz5xZSw0Zwqh6evaSFaSaZxzm2ASDgGbPx4FlT\n5lum3h5xANTN5vBrBiiYMfimt1fhpo7sHWEd+xAU5Tm0GaNzRrh7+Eg4Vmio\nXcwogRBWI/OBqKjtg9cZEimRgsuijJaAy5aav0NdsFvn8GGQiXNG01tM/dqr\nxbdH5qqRuN2jAMcBzBYuyvPkNEmz9r2HeTFCh/0E3/FKQ+IisgAA3vBofibT\n6JXXdrpnIUylFtm43jD85wPHqLbWSRzd0CqZsoAx/ITVXc900g8ippsxL1+B\nUp/b6RtUouSOUMgF1y840aaTuxECnkGljBp9ys/E/CGXp1JQeYRqerI7S0kJ\nLYfaEUias7zCZVJBaS3jkJI5R7tcHgsPZbkM1HcA/qvkongmzq0zAqA4v3dx\nn95JwUdaugFHBSiV0ESTNRIj1Mg6SPM37fkeLV5ZJnpzNcjStMHJhhW9i0Ui\nPzM4\r\n=VZ2b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3zWyhv/CSygdOICB47nc5IESYghM7JGQCAfcc0mvqjAiBftriWbOCDPSckDSqKOe90e9zNoeaTIUY2gduBDryXTw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.1-master.20191206141736_1575642083242_0.6350545970973924"},"_hasShrinkwrap":false},"2.0.0-master.20191206152722":{"name":"@atomist/automation-client","version":"2.0.0-master.20191206152722","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5e423cafd41957f5bd171f2dcce5c4544d86bf7e","_id":"@atomist/automation-client@2.0.0-master.20191206152722","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rEs++NcsZb9/7NY9IG6OXj+XY9ZF5qN1FpOSpM5mJTiWXz7kd6PqPysHu2jnzjoxJzv5Lffo914q4hM03FHl2A==","shasum":"021d2f499d75ccec8d8ca43367a00f7b3f788592","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191206152722.tgz","fileCount":1040,"unpackedSize":4378338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6nQ2CRA9TVsSAnZWagAA6H0P/33dixAEeLLmgLVNKujE\nclXW4e0zvSILnw2dQ/dLyA/jOT6t7OfRTnWUZrd/v64K0avSF1jBcjS/dYlq\nHaUd/2SyQuLzrzFUlspynTq5YPHntXuh06KU9WG7EJZAxSY8RvXDLzTy1JB8\nrkKtbD7Pv+/u7k3lEg50LlLScVbtTFzwP60b3+OVZBg1UB3nrNqQJuRkMieQ\nW9LQVHuWimZ1OSQ+rxlTOY3k7ZpzrQRhBXRS6j9cCfncn3U2DUx4lJM0coDj\nediy00aGNqgKizEk6bx9eElYDP3MW7CDDwDrlU9DWlMyl+9STB+f6PPrgBsS\nroGe2qb7gjAlwuVpMcysbwYyt+yktxmP4fLNgpaknIYX7pPwrRhtxyRYWdXp\nT9deagkdlgbUWrHOAaKZBSeIO6d8QEmWVjZRYnMOHuEpawZqt0Z2cKb0sS/9\ncgX1ImPuO4xkWFCShdawBJUfsllkxx51Kyz3ypC1c7UtAVWHomz/x8Ov+21M\nupTV+VuSLtJm9LDk5tHU1Kaa8JYy6eA+BiOnvPgm0lpjl+Rp7Zg1rBP73sRh\nYG3tIM2vDRhj9ezH9J8lFbV4SwWZMXCYV8pVwtJG9wdaTHNqEiorFpOYQ1fP\nkv4tExyXXcqgj6AZcVzgZfBDe0AfKeRMl6yC9THqfKQ08bTH/tM4RyJYZI7Y\nf74q\r\n=sh0k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdNt2ddoIIyX4sVIDknvp4F6IZxa2s+yQhRDuHbo6I7QIgHOU2tbgUsypqP4b6NZE9zhQ5UxDcChpt7cDktk7oC/4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191206152722_1575646261451_0.027159622855844834"},"_hasShrinkwrap":false},"2.0.0-master.20191207110327":{"name":"@atomist/automation-client","version":"2.0.0-master.20191207110327","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7015c7e5a5280beea72bc8d69bc2923e12e26f28","_id":"@atomist/automation-client@2.0.0-master.20191207110327","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-LyIoFvyJVc55ST1/MME0g7vrcWAhU+s4LGmaWH33oxupo6pG/MbH84/38iZnkgu2UvWcp000iiZ78dILnH6PJA==","shasum":"8cb5dae5be8002177044e6cb4461f9fedf86b06a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191207110327.tgz","fileCount":1040,"unpackedSize":4378985,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd64ftCRA9TVsSAnZWagAAh9MP/1DeJPzbUQicRK/Zibrr\nR4qOCSXr9JpVbxyf4JrhSw7s+YVmX/8j+zDptnWK/tKIpg0BNPVotES9BmNf\nFh7mkkPfBxdkG883qIoaG+Bl0yY/xse60IpM4O7IRyjioHttbIpId8v9+gk/\nEJj6aaJ35367tzJR6nxKiHuMoXnQ0f/sqB23l8b3EKdObDVHPbJ9ToDRoLqw\nDKqc+m5UJsTpSjOLonz6BGwNY0Ba3wPgdQ/PbcyMqLlJDMerGpr71wfIh/M0\nMziTvD7T6eRPEm49kM7mCwAasPZpgUNpy48gQD1NAONGh9lhISs/ANOH2fcb\nnQhNFZVeaD28ZAOAWJUCOo1ALRXYmBOHgXb6FoE4ZjnhBhX9ChatIdVCrD0r\nPHUHJh5VUCInmrSfYQyEUoRywklqq10Kc/Tsg2i7MJuZzM9myetu3AbXNfF7\nEWayoWq6W3BtWsyu/a1wV9cuLhdV+fgdEAHjAu82L+grk8gSxk8h5lzNbV6C\n7BQmc5LegDUZFG4mleVO58mdnfxjBh4vNR08w9F7zKttH8aJ/qpnVKQhLau6\nqujPXM79zJ3ea8QD8fGwzAoe5ypf0gnM9nYjTVNApYsfrl69hbGNqIZZilj2\nBN4C60C0ZZyGfwJ0B+4u3lIZFNdkngWmHN+2+Nd3dSoIFQS2bEad5LIDn5BF\nPykE\r\n=p8fB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7X+7HjbB2IGhu548CNiCNLLmq+bmcvMaOq80tp/NkHQIhAOuZgN0BYNRNY4kw3LZcsvDy6I3PsXccPgFc+L+pRz8F"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191207110327_1575716844891_0.4893110022510707"},"_hasShrinkwrap":false},"2.0.0-master.20191207120714":{"name":"@atomist/automation-client","version":"2.0.0-master.20191207120714","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2c117f5978bdf24edc83368a97ed86cbbd2b1f58","_id":"@atomist/automation-client@2.0.0-master.20191207120714","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-X5t1xAh5xF23oWwhRX3COeECeeOZLdwfVsKlP7RXiukEaSXNNmetK/mWnTFGFSQVX1yDlQNrp2I2zUYZnHO+Mg==","shasum":"58e567382d23d1537421d041cfa819024aaca165","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191207120714.tgz","fileCount":1040,"unpackedSize":4379564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd65bMCRA9TVsSAnZWagAAMgEP/RYQF295vGbW7Whng9Hv\n/jOTSbto4/p9GoblvMxICkihuCuW5RM8nWzZzQCOrJTe76llopfe4oGb0pn6\nwQkh1c40e+IOolRVJmtKOxzRUsm2OmlvmnyEi8RXLie29R4kWE8fl7FjP9NZ\ngHDDlXw4MH22WPhhaHnKyOdfUBeO3IFPQ+eK0Gz0GOk5e47nWRv6jrqQEnAG\nBrb0ZokDeGQEpNZeRbeKY/hxCio7Tum5MkI6ULbOOgwlBwQxINduvs1T5+RK\ntPUoaLPgViuzSY9asR7WNV6/P/h/z9sZjiE8bXFgRDHMtuMHoVyfftrkHqRl\ndqyds7j7EmBff75eSWjCWnaKWbFblOt6IopXmefcjj9yyvfBBicJpp1EZo69\nJB4jtPuvR8x+rVYfyPsVVj9qe+2JDFKa9l0+C/eP2u/NHtboOwDDtLiRYcIp\nPe29hUu6LnFnP6XayKqhUC2tu3PoW7SlHS/kbcWmfLIZF7Aek9mAF83f9FJ6\n/KsW/qc1x8drOMGl95IqBUuwVOEEkEQMXxzNbJuWq+hbSmoFmsqE5OGgY+vY\ngI0qd0x+9/29fE72Xi+Kc9Ca7LSXhZ0t+C/Vc9X362MRpqCyoUV6oHIo3Bhm\nomfd6klJhbl0VUQPiGQ1IXxeO7VkmBlhScp+d5DAYMg58Xl8CysY5W68afy7\nGPKK\r\n=ZqFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOWVV7bZtqyqWbG+0eed9+vVo5QHe2bMGvytrcIp9M5wIhAK98QGrnlOwYMNcGVDcJ9OCNqI9W13achXxAqUsTWOD2"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191207120714_1575720652197_0.2705451082272914"},"_hasShrinkwrap":false},"2.0.0-master.20191207143036":{"name":"@atomist/automation-client","version":"2.0.0-master.20191207143036","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"264bd1ecc713674bbfdc2395ff9a825774f399da","_id":"@atomist/automation-client@2.0.0-master.20191207143036","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-co1X1mGeAZESwDpzgJyt1JF/i3A7o5nt7hDk6bqa48VbcHZIM40DhwaUK4q2tO9BWwr3gHUmzAGTJMVan3x0Mw==","shasum":"f0252020313bd0a1a29668f0538c682f8fffdd7a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191207143036.tgz","fileCount":1040,"unpackedSize":4379465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd67hcCRA9TVsSAnZWagAAunoQAIC1kPmu8LhyR5Q0QvKk\nhFD9eNb1jTzVlVwKsYYXczZ9y5uX1qppUG2Yd96U3bZ6iMIQCs+zudzQuhC9\nQEJMilaqIwMQ2d9PxDHwLKwgu/ddk7LYBHdBAW54/mEDqoxAEwAGov8W5Pd3\nAF0ci1QIrcXnvRp/LcVnI/hlmF7hVjsjOCm3neg6uTY0O3ynrP/VvOLnx1dU\nbhWKR/dlWMjM1qo0s9ibXI0DZktrqWP1IpGcrf02HmdPo6yEMWOpHRi9dE4c\nt9gNnYqKDo+bSNcqq5w3aZfsA3moKebMenuofvDHKJ5IxS/HIipo4Y1lHkXq\nvFMkX3IfQN9fbnUnFfOMeFyJbzaWIbKJuyx5s+NhTi/0YhwHnqJzHyJxTTEO\nBiBendYPZ+vxwPvhKRIG+E+sG7cviY8jlMbLIlw8kDokZAUfYSfzXFHECLC1\nn7LFk7aiAA+VtupMOXW04grXQIMvwszHDI6rZPwn1X5eVbPhpJM6PVk8QIs3\nCqMGXMCU0EbBc/ZecijBTdPecLUnXE7S+u1PR246CyFUbYUdslgu8Dj3VsaT\nCDk9a9oxTkFRyMucqGXL2j63JJH+xiaykpUYmuZJD9ry0CSkx+p3+gUJzSlF\nXuPVqz4BPBBpBWjjhR+TlMWoRgS5phRdZtdeGeaVSuZIsN/dRdVNT9I3PWn3\nIa8S\r\n=fdfD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK3ySy/ybpS+ZCB/SR6HxT1VTFvMW28MmMQhqyhSGWpQIhALYKsTibi8UOwYzYTeB372r/y/ZPcps6O03hLto503y4"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191207143036_1575729243875_0.9161716596538396"},"_hasShrinkwrap":false},"2.0.0-master.20191207145203":{"name":"@atomist/automation-client","version":"2.0.0-master.20191207145203","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3a784faa9bece3061293dbd1a40136572af66549","_id":"@atomist/automation-client@2.0.0-master.20191207145203","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-7M9XmL0NgIxgmuJcJFA4qmhLNhUHOGu5W5CeecHL65Fbjri22/mCnqSLf8Pzc/heWL3bjOxN7SuNPaDH7HasuQ==","shasum":"9612120902b56046903dd90f88509afd3584e008","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191207145203.tgz","fileCount":1040,"unpackedSize":4379981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd671oCRA9TVsSAnZWagAATKIP+wSZkZPJu0LwzzR7ZMvm\nFtA3g5Au27orwdjV2BOPP6m8mdP72toN5SHKT+NZJPNnxCbnZ2BhuUm8ZVlj\nLd0Q5uAsMvLhITLajkws44LsNHZx712yYjep2MEC2gNK2R5gcZeGJY+CXc5o\ns0G0EEv0NjIqp5f/i7m7sr6h/mls/1Jcyx5898Nn7mVasmvj8+U/M1V8mU9t\nJOId5VnCT3ETGUYAmqWgltpXfuOto1WRQUdtIFN9mgJvrHg+JJXKvRm3nDy0\nNfAI1KqXnhlcxnk/5ypQIykU0WmKCm2VZbZy+tz8zLnGPI4wj3y+yvDOe7jF\nTCCofLEKe2bAtoceBiTvBhqJ+uKHYUI6mdYGEh0MrtHQoWoY7dXvn3HKmI3+\niGL0rZOxSIaafQPmqoccYGyqeedOzdvmYlVT1QXQeYHqeTrwmcwB75O+Dx3e\n4mBGujUqkzK8rgDCMGExHGMsm7DAs8E99Q12yCqFzenVOc7MfJgfl0zOaLHP\nnlPQtOIS1DfVlk1RCYzRg7Q4RYksH3avOFpLAVlIkzQh30KeBbGe5v9kL67b\nE96K9fCIgvwkSXwQP/uQGPtufHWah+XrpPtDl61DT2cW4BJoYb9fVeZ+zkvr\nrp6vyNgzwYAMYXi9zElQ119npnq9hO/GUFnyrqch/y6b1uOSoVCt95ssUDCL\nwuCQ\r\n=adyU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfr0OB3m+wH0tizanktUYI2GgKR5aor+enCBKxA9oAJAiAjKYs9CoSFPRY7k2wzTFW7mCH0Ujed/uMvEyCoiPCQiQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191207145203_1575730535811_0.5056922389524476"},"_hasShrinkwrap":false},"2.0.0-master.20191207163337":{"name":"@atomist/automation-client","version":"2.0.0-master.20191207163337","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"92777b4d9a8a82d85b2a02e2249c0a511e51e756","_id":"@atomist/automation-client@2.0.0-master.20191207163337","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-hnyi0Xxss0y8gPEHYRzyyGf/tzHdJAuV0UOTIEbqZYkEafT9oghoHlLlNo7S1krVKfP5pLu+P7Fp21rLpKhAEQ==","shasum":"833380fa2788c84400cc7c4c3d22ca8732d64988","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191207163337.tgz","fileCount":1040,"unpackedSize":4381683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd69U4CRA9TVsSAnZWagAAjdkP/ilVE040Ixy63GDXh4MR\nnI6c+JxO3R/l/ui+tsuyEzaHV+PSMJbgWQqMxFRlQHk8SEV80/AYQavKA/3h\nS0PRQEzx8Lth2rxjhpYUiFS96XYSKGwyU/ewAitiqBseOO5eWAthIkrsUK0M\nvGlM2FX6Es8Jhf8o+Pka/w17qbdjRZSGiW51lH8n443XVar0GDs2tK9x7ER2\nrcmz8HVt1B4e8PKx1LT6wY0KqF66KJoszriLSQmpej3k9t4j7/GLZPGgX2gK\noyTWqKAc1+SAPs/Y+gEd23/gDFgrbOBDMbZIZT6T3/I8Ug/+sI17FIksOu3S\nfV4dOVPXMX9M7xkS+axfSJoRkYCYdwqADL5xqnViW4K5N2ic7NnzXTgLCcUZ\nx9C1pmZNPNNNZr+lNfIH2DnWCQcaQeRZN7Rps97c9aZFxq+e1lVdEFr2Q+ep\ne7uMcw66sUtW8FGSQoa7m5oKDMevCPFUsI0OIvUhZA6MlNYThOvgkGzAomZA\nhnee6sepHASlkTNivAbLOktM5o8riQrWrjTwKkqaz1RdaHGDYwYPdsS2uk2e\nOPHubvzQPjRSWXCWzoIwDVeALd3DApHKXI65BpzDQv90Q3SS/4nV3VD1MSpN\nMvI6Lmh0oyGcMcg5mnHMSeKOcckjOFunPfVolWG+db1KKogPLMXPN0P1xFtC\nbvX/\r\n=fi+n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbrrqBeNduqNOy1jzm06lASIjyrsKIzL7XfVEGr9f5sAiA4L0BdaIxXFMDdEbkQCbYJd0D/tRlQ2sHJp4CejgdkVA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191207163337_1575736632172_0.333637105020244"},"_hasShrinkwrap":false},"2.0.0-master.20191210214700":{"name":"@atomist/automation-client","version":"2.0.0-master.20191210214700","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"df9ecdb0ab2e3774812effbf25979a5cbc451106","_id":"@atomist/automation-client@2.0.0-master.20191210214700","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-oZxoBwcCIpPkZUruyu/hZjZkBoAaojEyaYRiHWJFlUvWlx2BN0tBp5Uvk1W2OZONuesuoixExS7t7Y+zc2K6cQ==","shasum":"8cd322cceac36b0a7951913f54f9daed85424812","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191210214700.tgz","fileCount":1040,"unpackedSize":4381954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8BN1CRA9TVsSAnZWagAAi1cQAIav6F9kJjByGcZiUdkZ\nKS1Tj5d9q7tRzXfQCn7SPS21oVi8aeCgIAbh+LaJMqRq5nLAGT7HXJWiGPnX\nu5/itf2EEd14BSCmMj2v9M7hZrW4/Qd8HMUXGGHWrOB3uSm6lJLypO4UfKwp\nj+uQn0E9duJFxQpz7e+5RNZGa/2cD7j8cKLDEh4ogsj/S/tjPuiyoyVAnZzs\nfRyzrK+zo40dkXdD5uAvtyECkWEyLoNCilWiqpxP39+mV3Vk0AsRte9MeY3d\n72C7eVfecPr+1eEoZSVt9h7eA1uQSSsM0qJ2sCWZWZl3fTp26ZaMzzDNnYZ8\nF/FMNOWL82hWA7Q/LKuCRDUak1X4xV3WIbg6PvTonLMwEN0MLOd9XryITz72\nyD9rO34V3ntE3MyjdmggJXv3nyfL3lbmVtG6MCk8P1xgDVm7jYjRf3lu4MGg\nGx8NutlsigsFw2z/fuNEpjbGPg4CIMVKn9P1+hu8Rjv7GQ7NocXeXibFi+SY\npf2mWeZT3ySH4Ii7XKWDigN13SAPtrOY+Cz5mwyvDMhaUqQ5y3Oc1TIgVH5H\nt7237pzN1vSP1N5wvcfgWt+txCKOjaM7WoEpR8Q7CkUPghicY/WB1DKK4QuU\nqSFHDOx/R4i8cFVH+PLPlBHwMaASpjMh8lI/cb5B7gobicc4/5KbzUSXSt4Z\nUvZG\r\n=d55j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbnzPAbewWykVzCe7ItI/BDapD2Aceyhcpo+GYtIS7kAiBeAVGd42Uv2issOg3hfThO7dXHH/KZc+kZ/9drzqA4BQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191210214700_1576014709015_0.8517648771005639"},"_hasShrinkwrap":false},"2.0.0-add-name-and-version.20191212160841":{"name":"@atomist/automation-client","version":"2.0.0-add-name-and-version.20191212160841","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5cc1350717c24510466473dac4204b041173ad9b","_id":"@atomist/automation-client@2.0.0-add-name-and-version.20191212160841","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-RusFMaj1GD0MMtuBh92I/L+Dy37W7Pa5dPmSZ0LB52PDP4jvte3kaCVjL12xNQn8sVYCZdLqEy4siMMITXysGA==","shasum":"e15917dfea10c8d91cef2675cbf977f2d7d54f6e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-add-name-and-version.20191212160841.tgz","fileCount":1040,"unpackedSize":4382537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8mbrCRA9TVsSAnZWagAAs1MQAJGzNRRzM4aApAp6bIQL\n3IclXmo2HkrHemw9HdM+U0B2fvaI48YK4JluZRaoPhlDvxyO2e7BegXvOEea\njRs3LJg6jcnDbfrCXkUUAy0Lfkv+fEEFaxFnNtxujQOOd1W6755m7IkaI1nC\n2pZ/2BX6FJVN8JLBSSjdDxwMNvBoo1QPkyIrwwxh+6eqfFqVwmgvtaDkm5tQ\nduzOoUzuOnnKzJf8B27id4zn1GOOOmhoMbqr31usomPqmpX8RnSrReabQNSO\nfQzfv0+uWLIufVGorGyuNoozZihbcNtD1xsMrzX2hTX4rPB8gjQV0AJPRmFN\nbX+Bn227+1NuauXZ+rSCWO51QEXlHUFXMW4evua9idBuzMM1xrARi6T/vBo2\neImzU/2W72vQSJommX/0SXTCSC8e2UOYntQHVgjBMLk1mGsp7GgwFYUIjeCc\n+lB+uzl9rvfqDuc6JznlLFZyTXGi+pw9g3Aj9giUaCrYqRgpOalNn5+3cXOz\nZ6n5/fCZY7gP+dJteHJH3FIzqW2UZNTmatAAzTfvTaXHB+g9xpsBj5ZjP8oG\nWxsWdm1qESjNCdbfKugXAct5uve8xD4fLQoc1wGgYxYOS/Ss4q7xGGZ56O4z\nUzTzMPYAmmxjKG9QjLuiGsUY3mCKpkW7WvphBsxTbworMuJHFNN9xDT0I8+k\nonCV\r\n=ISu5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFT6vG6XcnyggUpTnUWuTblns+u0sC7cvag+ODG0Mk+HAiEAhk0b3ogME/fnV0iSNY7v08a6I+7krI06fEjZwE31Hks="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-add-name-and-version.20191212160841_1576167146724_0.5840308947011883"},"_hasShrinkwrap":false},"2.0.0-master.20191212164719":{"name":"@atomist/automation-client","version":"2.0.0-master.20191212164719","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ca3cf1a9be93d48eaf801a6fdd6bd3ad4255a4d7","_id":"@atomist/automation-client@2.0.0-master.20191212164719","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-3KiWhqEQl3cxpRdEk5WAM1/E6VZMqeOhcJKU1OH6t+MrtxrlC9XFlfxfuficRnRj+kfmXojyQlGrynC+v3hsNQ==","shasum":"017658224986492034e83e4e408ecacda79b5a8b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191212164719.tgz","fileCount":1040,"unpackedSize":4382654,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8nAPCRA9TVsSAnZWagAArRoP/3Y9dlwcwx6HeQlgSrTQ\nw0ztypGlUJhGJZb1bGd8ahDykWKa7uRdeIUbnNvC1SZxxincPcN/l8K8VGpj\nMKAVsbvq4oF9mBEJ/UXKtSmfZI4GgRE1ZB9DX/0+cOXooPVc+KQ/tJ7114eU\nLjMvLOUC8xOebAD5ETqkHw3DH/YJimLVpucbNczeuA4wQ4/bZMJG6GEoFhXW\n7ETIy7jat/QnyK73KaPKIZXhsdbueDFEGWLe2+yMTmtIa9DkAsaWoECdMAAu\nO+FFYE0YiQckfiwAgPOWyhC7WOmPpQhgpIz+AuAiBFwdpbD7I0Tn4R+xxOXC\nP1iblgR1GU3C7jtpWqj8CKScUb/P08XjwzbZJaWrff7mCVLMrFYRnQNTpV63\nCYEjOtLu99FKeqytJV78jSt/X7vdqzrm2cqeYDtUnZNBj+YB9UC6P/66RQ5v\nV5grF9ISIZduggMXHzvkYSpoc4tfCu0aUNQ24zvo7GArpoB6+tDvOcWb4otY\ndaNIurPdjPFDzgq2rO30jq608rASnz0ROoCDehnGbvFLXEGvZKYUQgOcrRIz\n5lIlwLTiA1mLvUlK+VXXBIf0azSG9H9VNL9ZHOsakGYmyeS+nRV6Fl/QZhrQ\ny6KN+apOd2KF8iz98HlLkEh1H1sFrsfFVXYxl3JI1NM3CK0TlER78HyU1IUu\n2RNi\r\n=bt5s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDYOVEGbsD7tBKNri8/sv30eJhhFvgzhP5/7M70x7/xXAiAXK1fu1UIChjdc0TsAcswmRD3oqRs0ApquhPzJFViiqw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191212164719_1576169487191_0.44337069491733416"},"_hasShrinkwrap":false},"2.0.0-master.20191212181545":{"name":"@atomist/automation-client","version":"2.0.0-master.20191212181545","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1ad30250fd142ff1bd94a2569d62447f6e5a3e6c","_id":"@atomist/automation-client@2.0.0-master.20191212181545","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-wM3v7y20HCfmX6//ZixeyY7u2/h5f/ZxqnW6QSPbbV1XG4ujgNoXyAy+Ahwsi/k9dq0eb8fzMGLPO6fMB87FMg==","shasum":"4ecbc0cf9a3d9076e9e411c6ed4ae26483b6a6ab","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191212181545.tgz","fileCount":1040,"unpackedSize":4382262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8oTNCRA9TVsSAnZWagAAOs4QAIaecG6FFpklVkgiWHvt\nvA1rJITDPXdM+F7IVLOt+pRt5OOzyIx1AOUIZi+JOio3D+xHxakCJBnZazsd\nnKEiHGxl0GXsOTzXt3QgJvgOg0AxIfyGmkhW0u0EMqFBZ2BYZwdC7oEleBCy\ngcN+PzVTtaMjDoRZrJVot6UDrpNkL0POHIxPbbWQVyHxTDqWTmw37s5rl0/z\n+cD9rUkv9EPJk+9Mlqdwe5iua/NEZklLGQE2XU+V9L++HtxlurCfspPPyVYu\n9gv1CcJMC6EPJBZfJrDDG6fvrb9Dmg0+/XbriFkPSpSD8whQ+dm5zQqGUeVG\nFiTVNwFqa1QBfEA5HXTECyP/YSTL6UcGxZYomZbyW5QgthQ9OhOfPHU1XNUn\n/nDfCY9lfX4YDlEBzOj4Lk07Qajvq812ybhdOYZWo4bc3PrJ5Q0eXxdQG87y\nnphp2L/p06YuUnWrZ2O6SzNtGrwzu+sLPVHKF7umks1RT4rXOW2LgolVjI05\nP43ZkWAz4QbH+w5AuGDMO4oCz0I6Z23rprhrRv3dz9jrU6kd2mFhRTeE5mpF\nix7phshArUDfXn2PxE6uXYnpDy914tjcNOVy6XuHxv5vLIe2ECoBfxG5EHbn\nf9sU/zDEEu0P28Yzqn0tkIrH/3KkhLnZW4epVbdKljTUHEqGeI77q9UVdgFT\n7A5h\r\n=Ypzv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9m6ZM3Z6bhg40HRGP9Sl6fJVYkqNcMF8Vmt7kG05HjQIhAK8b504TmxcXWajcnfzBvWO9av4S0gJ7V8FdN8flEmKG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191212181545_1576174797206_0.03458739708484382"},"_hasShrinkwrap":false},"2.0.0-master.20191212203327":{"name":"@atomist/automation-client","version":"2.0.0-master.20191212203327","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"410bc99569447197fcc7b5a00b825ae8ab0dd6cd","_id":"@atomist/automation-client@2.0.0-master.20191212203327","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UFfisUUGYhjo0aZwVte1zaqU83JbNYQgTiqu9xjJhJrZlSy7Q980PPqujGmwSH1MocXxPFL8VHOaKq1x4DWxGw==","shasum":"e948bb596c6658bb3c9bef592ee55f150b356e4d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191212203327.tgz","fileCount":1040,"unpackedSize":4375023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8qUXCRA9TVsSAnZWagAAikoP/RnEa1eA8NtcEdiQr2/b\nVDn7HzOxUhJuIRWWVF9IPJT3HHegfQLh1wHc5B5FYxxARd/qmRkL62xYfyT/\nPyhvtUjfTnTXukOcLHMf7EBQ6DXZQYcY1dirVbD9FU4UwUbXWjLojDsWns0c\nH3TMMtVLlqd6GV/fBjmwT/bRkZsjRSSj1m0+64ghnPTFUraIbin98DRefPXL\nDKPXjcLOcNTj4TQo/gcBWMkYJgP32zdhLMIQek78TWRh03UN4eVWETsH26eW\naHK0dfJAzV8fAmJsT32fnENM7Ol25h8Z2xRTiqFqDMPt3SNYwd2n7h4/sesw\nskXsGEUCZRtvjSEwXQsNF6+S/22R4n06PHOVzkwBkJOgK3/rtZIFH2TUyXJV\nZsdvkNaYkLM9pkvK1N9+BC+rda5iY2y9DySGkjsxT/M2rwS2H2w5d3bTSAo1\nH77Cs0MxKfhwZz6MIKtTXAVf3rIo/OP0LTJkph5qJFmbKsZQNlkeACbXxF2d\nPuWbGbOGztczDig0TPoU4Jut3jx017IKObXTBOyzrkUDkUsY0zuzzmM4Nr+H\nU0TfdkwuDmoH+GBz/KiE1uE4rMQP5ZreQB+HPdbK8Karo0IBW3OvKaq5vnzz\njimsBV2Ls1LLweo0r38yuS+6XoMFNyIBE/2OcGWf3fSPmAlyopeaR5Vc+dC/\nXKZ8\r\n=HlhN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCB4ZkDGGnwPylxlGnA359ZT4CKrUyKyWjEpPW7it9CsAIgXhnIACJl/V+UexDqA9pRyaGtHMAVvb/yiuFyIoe/T4Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191212203327_1576183063178_0.3497548616874757"},"_hasShrinkwrap":false},"2.0.0-master.20191213125735":{"name":"@atomist/automation-client","version":"2.0.0-master.20191213125735","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"31cc6070cc7ad47d1082b09bca059aa3c833d78e","_id":"@atomist/automation-client@2.0.0-master.20191213125735","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UyVT0TSgntufQGiS+uB4sGpEBUuPcthC2SUEBxkYC2EowKUfpUm03LV8lnz1gFODWgnDhg2lbIAkZeG6yyCAnQ==","shasum":"aa681356c9966b86e9e73a089ac15a99b0c0af9e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191213125735.tgz","fileCount":1040,"unpackedSize":4377049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd84vPCRA9TVsSAnZWagAAWD4P/0Al0Wpb5cfmMhIglNkK\nLPtYdsN7Aie3D8x/yFnFZlkhWN+NIsfkmKqFu2mZkq1Ps71rxorPG6XDb8jV\nLeBzOjOxUt0efEhFyR/GItcFwzPVqfIbVi1LAom6+wQogjShQvA6VmKImn1d\nCYghzaYBg1Qq2He6G4ji5vF1bSvgJ+W3XNhhPqnTZ5sgHU3qXNDB+5UJqZ7p\nsCCD4/UTRZhWK3fkNGUmub+r0jCfkr3RkpqnhCg93DOmXIsPUWxKiUJN35ID\n8RFFR9BIh0NIh0lD/zG1jpQYASPcspwI20ustuM6oD9g3UcKx5zD1g1KS4Si\n5UYti/GyMcVTT7N0aPf50H3f5DNVr6O5cVD7rNysIF8Aa5S51RI4k3mBbaNB\ndfhOdZVO4QqoHNBepO/DT7tMIvBHeGVgiH+Kfk5/C/4qanLC7yqnc1r57xVu\nNSt3OJeGjSW4TipZW+GCIMe1gUPBSSyFJOG0h61GJ1msqRVuLN+fx1yszvl9\nXPQAbHLOgUs1NrB66xPFiFHBKhjECuZXMOKBHmn64bcyV9YhBYXqynZlImxy\nvPwYW5fxJoSFXDDezqMXn/r/lhL1udnZHg4UUjjZQHIheKFu0QukkctBOAly\nOG4aIElVp4f3YK4a9hEk+upN4yUIgHr45MHHFDb5yB2r+4nUW+Y5M0sJhlvh\nUTTc\r\n=okgi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsrHu111QuPvEDVI2RWdQju2WdHSzC5sjfFKmUdQNQMwIgYzeAbiFQ/J0lRJUHBgIp6hReaEBusfcB2GtNtARF+H4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191213125735_1576242127158_0.21311077176581272"},"_hasShrinkwrap":false},"2.0.0-master.20191213130118":{"name":"@atomist/automation-client","version":"2.0.0-master.20191213130118","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"31cc6070cc7ad47d1082b09bca059aa3c833d78e","_id":"@atomist/automation-client@2.0.0-master.20191213130118","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-+pT8MNzS24V7ZMoGJQuUCGxkKYEugBE93o+mfhMBnEAcZnMFCofDiW1NLa5n+DepIwrlJDGzUPMaqQgLnoEg7w==","shasum":"3d7bf38ae5314863e990d3a426c250fb5dd62ccb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191213130118.tgz","fileCount":1040,"unpackedSize":4377114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd84ykCRA9TVsSAnZWagAAkrAP/Ar/GhwsBfVGImSQrPqH\nvbqsT6lyKdYQspAcwNNVF6k5DVIyMd+zrzXwzpY3CtKY6AJDhhlCXNl5UbCk\nKHSKRMHzjQJJWNe/r9XkVKaKf6wQq1H0qNeqnApz02s+eSco98xgpXLBEvI1\nko7aZTkJaffXJ3SA+G7e7U1DXkfMGToe+MUN6daGMdPBaKFhRnOWwUN453IX\n48RgO2px1KiAVt6YsT4QM2liwQTlJcE0YqOUK+xxiIYWb+3iNKntyd6U0BSE\n7ub+g7pPU8FlZQabd3z+gEgpAhSMMFQ/vDPZC3KGzR4hP/uJ6OYMEr1hnJC9\nysnMZ3wVa0RFdTX+LvbBCkH8oQkxKTEctg6P0kEqb63gsDz1n/k+B5UtCngq\nVXtty8dB7SikmErCe+axJ+Q+lVhBS07hWrORJFEMkLeDybJ7hG4i4AsTPjJF\ntW2S51SzsXylAxgybMAZrhsw01n+HGlAhASPtD+bmKK6AkSduPrtdKnUMc1b\nBrxEqcugM3C6+U7Rlf8mBQhnbm0cJYVn6c88IBtgIQ44YPmEnIYjlw0+jAX+\nR4RnOarwGrOiL9+KJxZk3aeS+UjP1aIQMvs7cycBCByKV+Sk7hQTGePd57vB\nFEdMXkAVHLnPToC1Lcv5IOsbIfyR5qCjNhM7LzoVfkh4v4wRrdM2bwfmXIpQ\nOkMO\r\n=qCTm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMnPNaYbNfZoHdVHhOWhEhjp+sifPql88FPEPOXoG2MgIgVu3L2FiPWER5cGBahLfIcQuJOMgzij/x+WBtOLvn3oQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191213130118_1576242339453_0.11282787679201256"},"_hasShrinkwrap":false},"2.0.0-master.20191213133922":{"name":"@atomist/automation-client","version":"2.0.0-master.20191213133922","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"52e363c36ad3fbcbaffd2fbd3bba0a838104302c","_id":"@atomist/automation-client@2.0.0-master.20191213133922","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-nIEoXeor9QWyhjQVZhdg8uphklovdApz7lJSazAQA0UpI+x/Xe/iH2DnCk4pPmc8BtuO1yJ6VJCAYizqBbqjMw==","shasum":"9784ae19401050258d306ff9db30c5072e781fda","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191213133922.tgz","fileCount":1040,"unpackedSize":4377173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd85WGCRA9TVsSAnZWagAAO/YP/Asj+RWxbvTXTPwhMSDF\nxW2f+jylmyxmZ/Tcwjzs/QG4apNGoXb6z9E3LdHqlQPmHAaJG4YZxCE07poS\nNtj/oKTu9MHiEtO+GxWoQ49Nv9u2l1mN4aISgSKyWKDLpZn6xCcyrZENyJCo\nb14i2tBHrZoxq28gb0L4ePL58omeOxtxjP/JOPwM3XuCoBwy0ZzFoo41URu9\npL5hBHae3ZKoYizrofhZcIdXCftjRyy5z7U1kI89Ir2aNRNF94VXRJUMcRvs\nuNf03zXHptwQ5RxiyXDogdvIuOe3e0QArk4kGqRVdnqQonbLIX98axWdyCWX\nuL7WUHZzXx1yzNhZ+GsNlyntNaQNYnWcEaOtD+zBHxX5UmU3I/IUF1Y9vESj\n/QI2nlTY3tzRabrClzyM2H51UICNoZcxD57EQfjIYV6a0ePnWWHxdZRzIhvs\njzq9/AD2FuecH7zQxkMWyHg6t3vd8hCx/Rb4eagUV3d74umVO9FGPjWrucnC\nKXwYtyfuVGm24+C8PNg1FW92TX38UNHxuSWkH4ONjJIF+eJ1LKF9Jd4Wx2+j\nwHrt5aGU3Fj2HBrI0XVEAom/CUnHwpHH7PGDra/5MOVkuH7FxN4F/ewK7zeI\n9L9tFA4pjJ9ARdw1kIUSV+fSBdQ0DgA2zFPJxR9yW92Bd5oVUw04uhZDYa7J\n+izB\r\n=7yGy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjDUegTzCekiH7l8XNnuDfCqSKlDW5tsdn+PNaPsGJyAiBnRfTbNQ0XOSCL8LwCiiYwhw6FM0dcdrI1Jm3C5Lst0Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191213133922_1576244614115_0.04211443346223276"},"_hasShrinkwrap":false},"2.0.0-master.20191213160252":{"name":"@atomist/automation-client","version":"2.0.0-master.20191213160252","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"625ab78c39a43b5910d6840eb8d20fd77aa8646d","_id":"@atomist/automation-client@2.0.0-master.20191213160252","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-qbSbOunUttnFU+qBXdkSPFVYua9IMoL9DekbzJleG8Nm+TmxXS3qS8TR/XLkVD8OuPbyLQj5FaniZZ5mp16EMA==","shasum":"8ad07cdc3c1b8db9e86c240c0bd181b2e0ac5264","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191213160252.tgz","fileCount":1040,"unpackedSize":4376590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd87deCRA9TVsSAnZWagAAmIAQAJL+ySR38fXacsq79Lez\njattDHq7qnFs0HXWI9aDYlS7+7xy1mOvVDv2hKiWjuNbb5x44SWh4fQBeJ7s\nyZVJWOxrvhWwZAzYYFgYCmx0z97IH3chC4woOZ5cUQRkaxXS1xcQzuCysP1t\nPFU/daQt86YPnKinACkkhJLZ7ZtYCuN/wkvtjiuNliMXg8iumFMqGpBwBG41\n8frEaLSUbpmObTWrjg/CgnQb8tuRWOjBpBBABLg8XYuDB2ydqHealA+NB/nH\nZ5uExw5WkJkL1SSoII6e8OywpxN/sSw/OpJrNv9IcVHsLwwTcJby9J9Jwr4Y\n1NAsd1S1RtnzXZ+EYOf2wjH3r0VHLQzExbU6b+p1vsvLG4QsILUVeG28dHVd\nCNVR512qu5rdb9IyYDTPpqLdCGNYduQPXRaCRSqHlrOHlu2tu7RuYggqHvQr\nbHReqW8mWkOqkvTvbSpe4BecV8rIluzDbdsIKOlVKQCF8KvXWiQp8Y1z5zm5\n2WVaj7IkEy49bXv20OISqWmWTCRxZ9oRrlbUsvyb8WwzFie5kGACoK4ZUARI\ndCILFcMLHWXIlj/jPxxlTllhxB9LfvrQct1tMAoSm3nkJOPqv8HTkVIe5SmR\nS/J3T+oeaiyASO3Oqg9sj17cxd24Cfhk3kYc5DhkaJ1qAsLmGryW1c4NMd/I\nru0B\r\n=5j1K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRUnOJnU8tr8SSFYF1X9C6jKBmZtM3IJgVzSIx4fAJNAiBNK2Fanf0FRY/n5tYbUthtpA/TYQtcYfmHK59k/Gu6sQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191213160252_1576253278406_0.6815034378327747"},"_hasShrinkwrap":false},"2.0.0-kipz-threshold-safety-1.20191219173036":{"name":"@atomist/automation-client","version":"2.0.0-kipz-threshold-safety-1.20191219173036","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e2508f27984e1f48665b73ee4c4dba91fe78a583","_id":"@atomist/automation-client@2.0.0-kipz-threshold-safety-1.20191219173036","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-e5VJGdE0HgQDPoELoyFxUyD9inYnPHZZQaPRpeViCpmi3R32XAcct1fYRJ5E0DDoITwU3KzjnYDNZuZQZkeUdA==","shasum":"69ff168838c44dd162831e16022cd67a5055432e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-kipz-threshold-safety-1.20191219173036.tgz","fileCount":1040,"unpackedSize":4376668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+7SuCRA9TVsSAnZWagAAGhcP/2nYqwedg+m8EqKQE40e\nscgb7sqTIjVXsezK8RBlFaJ+m0mZLFhIr0NIAtf8AjoJuJJWyy/xzN9Y/4ZR\nPrW9cshWMzG8mmQBYc/ORdQfLR4NGFS+kEejzq4yqTeY5j7BjMTEIyMyQzc5\n0zb/H1pHngkesitEG+RTvk3YKPGYuRedP07LUlwDIYgQFo9mDwuv/7r0YoCG\nwdjMIzkg4pjXaOZaPPJSA2NdPuG9YnDKPrFYhTkwFWujfi6PSpoG51OT8pEc\nLx0S19Tan9+nkTdbBAT0Cs/q3FsCG/P0Ss1w2ji7QF8mXAKXud3yxdYjd9Hp\nFKVW7NkoDYf6khVYdyfnRu3uUK01nIqAd0NfcsXE1yElDrrNCmXk8vqZ2Fdr\n6TA0sAIKahrN31LIbHmw/8yieTUJbTyPQk+5znr36KWwH6ODekzHMIiEnsr7\n5zPSfWz9wvSytQQ6KWwBE+iV6jY4OBGflP4eGM4tVNOIvCUb4zET4Wwo52md\njNY2xMVawNIcI6G4dDS5KC1eIerR/aILDb/fUqMgm2Wn/K6F4mCiLHVYGUkn\nukl6SJvBpkcvgZk74gKLMbtuyNADLReXyAtWv6o7i31tWvxxASBRIhuLeBhp\ntIqXGpX0xzFHn/3jeG4ZXhGb2jSOzAQUrJcFMy/Z8VnZjducBDx1MFOwpYHM\njZoA\r\n=O3Vv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXHo61RajdrrAo333G3WWSTf8CuaPgTMmTiiOcVz6XbwIgO4I4fYOmJNdl/a0tsGk8m6lYt44LWSGkxjyThy0t9Qc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-kipz-threshold-safety-1.20191219173036_1576776877400_0.13848629232727783"},"_hasShrinkwrap":false},"2.0.0-ipcrm-sdm-793.20191223223841":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-sdm-793.20191223223841","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"74f1d02e9c522293f347c7cb6a17f1baf106d701","_id":"@atomist/automation-client@2.0.0-ipcrm-sdm-793.20191223223841","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-PBDNmwNg82wXW4rcwapdtgby2httZuE9a0b8+RoZ0UOaL/0ujIC01adf1Y1dS7G+dIT6z8gqWUFce4p1UoG3jA==","shasum":"987fc22d866a440df0367b5f1122f787892820dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-sdm-793.20191223223841.tgz","fileCount":1040,"unpackedSize":4381498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAUKxCRA9TVsSAnZWagAAkbEP/AntOBSyDp8QL3B8+2RU\n+ktxb6Mb1Jrq0ffJzkuTnqB0IrVzGRinlAJHm5RIb6F2LpZVRt2MO8Su+DoY\nR9RSap8SliFvWF18ScQ1SA9upIq3CwzaeTNIQdh+Rr9gutYujyI3C9C5Iw3c\n9MakQTb90oQs4nrYhzhZt8SMtabbZunkIqFzyvoAJkl+11MDcxdHXPqih5Vp\nDZTomgPrd7EVAPGqzT7Uv2fRABSYQe5HPLv6dnThHK91NA45s9Ve+6mbc21j\nFdRx3Z4ksLyJt7svfVPotkVthk6rvZYSqzEINrDl1p1r/jOWbuefajUrScxP\nlqfwksdX6+Plqq2FLoqbV6EuoCC9HIPVyMjXBmssUJXXX3YZR2XmpsWvCesP\nQ7crDnouoh9DP8UgkfOIkrU94qRbqmp0qGdqniniG4Eip5ao4NXLJgCAxBoT\nLDx9uLUnhJ4mVweRp258FkCRbIrpRZeCpAt0+Sr/MZOMo9KU3Id7LFynniIb\ngTE65fAXqAhntp5nm6KqLDHVyrHoQuWLmhd3b8L12pjI2X2ff5Neh/ZFpMg/\nfEXLJzaXcH1CHuMxD8rAaxJQVtw9vZ6TgfFnMBWyTesy7HucsKJOpRHFOBa0\nSnT9O+l2wuDzwALAx+zZnEEuGnSDxo+C3ViQBtLky5p3WkPWnoRC+yCJ3e/t\n3IxQ\r\n=N0QX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSjNkgYR8x5bVBh6p36Bh29kTU84XUseWFFSercNPwmQIhALQT/qupIxeiXWeGcJ5W1scBrZkfj8kCGB/zt1U0HpcT"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-sdm-793.20191223223841_1577140913140_0.2930778668367806"},"_hasShrinkwrap":false},"2.0.0-master.20191224225156":{"name":"@atomist/automation-client","version":"2.0.0-master.20191224225156","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b5bddb5c539fdb993393b37f0f3282ba37963f44","_id":"@atomist/automation-client@2.0.0-master.20191224225156","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-S6GNOycwYtk7/e70qXPImUYmFAJ/g2d9akM32uXT1C37vZG5IkUUx31tKwxABNRkpwhdXILmhbFpBF8UZ9oQOQ==","shasum":"529eafbddab4e9ab33ed386cf8457d701e1cf336","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191224225156.tgz","fileCount":1040,"unpackedSize":4381586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeApduCRA9TVsSAnZWagAAJ4MP/0ptRAueb4Tp1X794hwz\nakzUwfqzphYdbMbvFQGyl2t6JoTGN9C/lL5Rlumdg8Iwy0V28qh9PZScmY+a\nG7sb4zVF7YjbQf0TBKHQKZwrCC7tUHq2P1+2QmoSHmih+WeO7Wc9zwvTpygo\nzSZQEl0ZoXxQgjf9vTl64MKFa2bJZVrJKz8Xx7jO3dFhNyJ1Jxgmz+kXxdCN\ny7bap1FpSVi1S9z5aYDr8Fuorab03vYrp4s9XnwEuBeTEB0VnMcLqyMICpIz\nzyNNRLOPMuctuIsyBXzKEhqPmzxZoWJT4jo3eCP5DP3bu8cR5n5JqKNAbp7X\nDPD3E96NOpKx1YN0CbHvQQdFpc1miwFBqsokA/8PA32MWxwu+tQfbEABWw/d\nJ+SfwyLuXI0NvMooWEU9uB9hE43xOsV5VCvOF8I9VLX2pVvmA2t85x0SaVfq\n3HUiWBkqJRb4rVebgdvhqFMDtViuiVwEhBlBZWrlIVKEwqJmR+vspEWX6x9h\nwPcFjbnL3wxzu93HTvXhO1CCmN0UkIPVl1iiNUW1gZ3xuUOs8kzTE0UuJ8Ul\nMnRoNjUAatlow+pA8pkU0oELlIsgQgx6zNemgAYtohLjM/R+vuemHqADLB2U\nGbNSODxtyo72V1uq9SW1z7f4ZlaCSyoWZ+eQLXGU+k87ltuvmgPyWG4QrEXe\nsgCa\r\n=AVS8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsJN3uejQYGct9Fa7lsmqPe9Nb5ddaPrFgO0nYwTLi+wIhAKkO5UeltdKZYmLhZwKTNzh4NdaLrNSdOBeCi/ulr5Jd"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191224225156_1577228141511_0.07459024311195073"},"_hasShrinkwrap":false},"2.0.0-master.20191226145834":{"name":"@atomist/automation-client","version":"2.0.0-master.20191226145834","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2e3aee2234f3067fe1d484978f582eb10857a79f","_id":"@atomist/automation-client@2.0.0-master.20191226145834","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-t2bQf1sQn20msTHyWzrarooxiQpp8w+cJuCnV6aXdcVWb9mZitTnV16W5MuI7hm1OjEauyr7UfJ9G5f1rHmiAg==","shasum":"48bff3274f41cfbc020ac5d21f653f3ca6afc6dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20191226145834.tgz","fileCount":1040,"unpackedSize":4381136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBMtkCRA9TVsSAnZWagAAA7sQAJQ8g5ggVuASh3EhT4/0\nvU9PRlRydklg/4BYS7alhUI5YOPj9BoETtPupj91kTL/Mq3WbCxAcBET8Kvk\nDR2tZk0myFZkqbwJFZ+b9Y2ZREkT1tcolaBmK8w6Mcx4KSNmlSppY6RHqWEs\npcilekzg2+Dub0WrAc8O5W8V5hUeZSLLktbsFhLB+wCosRycoL5XhHhsHjMr\nUrGZtAAXjIBKllqMs78KwklOIb5CPtymzCJdCjw44/kNTr8hHKWzT/hzRmMd\nU0JuhYE07KWp1zV9Pj6knv/kiYiRa9xVBWTS0iPHkxhs/6SRNYfM6UPMucHv\n0jX0UxJ3xjP4wxKssLq6Lb44KpcLexI5fhg50AdNi6lxlvsgn5yTh8LFgMd5\ngmwB6xoYsgJjvrn8DgesMcJ/YFMfmo8U32uagNH687yPD5my4KVXI6+bSvEg\ndVHrNPrCaQlia96n68llb5azv9FvQ0NnCdXbLqQ/vj4O77SPDugp9DDCPl12\nYh6DHH8ap9tIpXsIbL888z28EvqaFmb3Jz6RaS34ejaIouBty9IS1oqFyNO+\nyKZt9W2aif6Aa2h5cRlSMDJEO2W2Q+x8BKFNym9fWEwDRn/NyOf8Gt1a0QAn\n7EdmYAIy/i9g/vWbwgfhZlCs0muQrTaqUCeRpYRMRAKWHtAmYBrdCpqoQJpm\nh0Vk\r\n=EMJF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjtls3WhqirxbI9TB6QqYkZYWojqczUpFYDQU1zg2IQAiBZSXAmOAU8VV5+uLWYHWau5msikN5qhSOVrunTNh6n0Q=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20191226145834_1577372515399_0.517588261784105"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191226203221":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191226203221","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"4.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/proper-lockfile":"^4.1.1","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d496da06ea3b8c658d2b3876c2d09f8c95ab9d21","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191226203221","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-DubCwZrCQu8SMwDNKP2LNa/7KsaYS0+1TOL9dR15DwWdFGuY1j+AluXaqjcH7H+qFqd3chcvTG46eOiuMiDpjw==","shasum":"f424e602a0a92e9240a3afe4ee791e8d3c583277","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191226203221.tgz","fileCount":1040,"unpackedSize":4381112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBRmdCRA9TVsSAnZWagAAxqcP/3C2KS4z2B5oGo1V9pt3\nE4ATarsh9H4KBxDRby96onZY4eMswxsH9OBTiA/C1aV+qB2FZbSZzz0Hnum8\n4k52FQAm36mTp3tkLqVPJakGyvUWTII0GLbgmeOoevsgmWWL//QiZ6t91u/z\nLE/mf6a8fLqgxW6N+6U+j2T1OxdGV8kKONwi46W8NDuuBI1qJZfiQ25nwtWy\nGF5T1aata9fZ4i1JMEjXaPq1MIDWyL74hbVii8cH9nJ01ST6+AjIYJVvOr0G\nhIkPqd/EUCf7fxsO63eu5hJOUpSza2FPtPxfgZHDPhcfqsFzISr3sN+24f6I\n/Vxe3FPdNORdg8OHCFB9pYRXq5b+2L95U7U7YEzfczWrEtqHJIOpSimoctfW\nKzhPIcxLP0Zbg9oRUddn7ie+83nAmzr4S2uZHOoheYeIbniXsYN2EjODZkT0\nlLfY6VQvy05Sz1er+DaP9i2xAqwq+5Y9ap8AQJ7L7sEBPda/37lpw5BhEspw\nGdwMwNLBL12dB9gHSPygHi6Xqe9mfN1ni7W6nJWFsmRNHWck6/MLGBsEyUNH\nM6A935BuMZPxOJHagjUioeqkIrnOwsWlRqIk2b9a5R8lPNXvKFxTQzd8JR0K\nZcmQBOf2yR9n5i1iC0Znd7X8v609kVMB7d+y3zWE+ueC6n8ZcEKRP2CNstyh\n3nkZ\r\n=Vkuy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB6qoWuU5WrwkRafw8x4cbCxHfndEOYtgT6NBFX19LvwIgRjYMnb4ExxjujvrFPCASIk+9UGw5chNQ4/wIHxPFIBk="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191226203221_1577392541063_0.598631945068592"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191226213641":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191226213641","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^4.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/proper-lockfile":"^4.1.1","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6205fceb67127121d6d95ef8bd746437aca7ccbf","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191226213641","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-029ojSRwkzEzQc+1xi1+ZhiiEID6ztXGZIwCgR3n4wCVnwiA+QFiH4esbqJ05Wkug/GKx6W7C+kZXVC1UYHFeA==","shasum":"3eac72afe97024f620c2328a28a52f90cbc6f215","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191226213641.tgz","fileCount":1040,"unpackedSize":4381113,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBSiwCRA9TVsSAnZWagAAIasP/0u2OzOaC62Lo7Jlk38T\n2nOjnGWr9P7vbp4qrNsWamPW6tDTd+mT6jJNx8yxCk5X4l5+xE5RatX53je3\nxmTim19vHZqY0XCQwiLRoh1NFzda1lW2I0oL5SqmV5Fp9ZLTlwTyN/zLG3Ly\npbMB19QRFRK0Khhq34QsIVW4RvAL7VO/cIibInSc3IJj4IbdhqDGJaadxMIX\nXSakTYdsD+Ie3RHwsaORZoGXqg60Flb3ruJi74p5JlktL3BqhhcP/7w7+ZPY\nRp/TzWTabBjGZODWagzYbP9Fq5bt8a4yeevi7M7dkIP1p5VElgF5hz50MpqE\nvDqNmnM3kXzcp35rzPmoV1PxMiF6aUhpTVFhr1LkA0QZhIHUUj1NSha1n1Bf\nuR+v1qSC71qIyNCOGNBUSVEhpxFraPLiOfKzkkdh92CTefUecegBctOUVjA7\nUnqJoQCvuBXUOP1k2grtAtftYfBNp5dHhUd8AcYhcI8SXTxThBormII0aUJv\nEh6zvhZAvag6hXe+2JLAU9I+6GUWYx1FqsatsMU5bGarUsN7mxyM21+sD48/\n4PqBLY5sdzTlZBLFTut+KccOGFHgZd4YxL7k7CN/cWjWSPFOZ0AvTNcDk0SB\nrO9AyiJlzClH5fo/kuAaNInqrHWqdyXClh/erpoks0aOY/nCfNpVgvahkaTP\nEYOG\r\n=aZix\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFgoQ9k/iqqCeHU+RN0YSZMovUhjvhEUOnu1T91j0+LwIhAIFxzcbNKiNw8RZOUHFUHKjaGS0OmjduJ+WKVDxDX0WQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191226213641_1577396399704_0.048344197348514806"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191227010200":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191227010200","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^4.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/proper-lockfile":"^4.1.1","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ea9a5fbd875744be4da4114f277fdba29c163d73","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191227010200","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6ml7rj1tp73uXY0dNDOaJgO3XDvBnbgKQBkaRRPatzj3oarrXSbTzobHXVtCLYU6//TYPb9gr2u8IZsP3eBQLg==","shasum":"bb0dd1bc36a05b5a497620694586ff921bd25253","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191227010200.tgz","fileCount":1040,"unpackedSize":4377920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBVjQCRA9TVsSAnZWagAA42cQAIHYs6UJGu2Om8gF5eiy\nXef6HYwV3uVgUQ5DN9+pM2TZK7KT8Y9sASDI9Ic5Z+RSBgf6NssjCvtbsOWa\n0PlZ+NqP3b2szcSplyPBbmk79G1epkStnXw3IG1Jcjkv4pFkvSZCUfyjGdTJ\nOHYFKua50QCQX4rw7i4SvsaX9Zb/2ABldqWYAGE/NrMtyUYZc0St9sL81pM+\nRd85BpisP+1lYV2etaBI0FCdQUPi9p4pzJZQtqP0XJl/C2l3La2QogchePA6\n0bUPlECkgrw5VnWBoD76QEKtGhsm6O0Bvicz/Lfn9Xx72h+YqOwAGmJnKsAL\nmUXZpK2Txq9D6nmFTVukrautxJn+xtLb+PbS+M0uuVCQvxtot/TP5R5vba5v\nPipg9e/Jus7fLxY/asaEFDaaWN6vD/q6JuELDIT+xy6+VIWp/Nm4VqsEf7Zl\n5Dmmi0ceZSl9avhArIa7CvcUR6XGB3kYnnEX6IARA5z91/gD/glN3l0n9hjM\nA+gFEHfAVLi9oauRxKaODDC5KQyPxiEgGhucrObLEA3StR05fIZB33szZf3A\n7LxCp5T0Q26miO4ZsOn6Gz3Tpqm6EAFng41NxdUQKz7btI6cFUlf3b710UQW\n7T7Qb4IF4ZTZnoAEQQgwiz7ILumw6xz14KD5zu/JmwW5ym7gHSwOsmXoKgYZ\n53oU\r\n=EWEZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaKhRS9T3+HwRgqKgHS2lhwizMGtuxqTIGeyLjQPE/lAIgUNFLkVrsJI7JYtFZGU6Szc9XpFO4pCGbXf92sKwgQdg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191227010200_1577408719475_0.4623961963857941"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191227013928":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191227013928","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^4.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/proper-lockfile":"^4.1.1","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"928a353f8ac42c96471e754b4b4115fe468dc686","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191227013928","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-N9vgkWMLWK8wXnB77tOQ4iDb3bkiS9MPr60K8HwjPf32mSYY3ugo1YMg67SjOczqJN447ASBDfBjFpyrGl+3jQ==","shasum":"d27c4f7c530cdef28779ccf141bec83f942182f3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191227013928.tgz","fileCount":1040,"unpackedSize":4377920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBWGZCRA9TVsSAnZWagAAiIoQAIm+NgXp1kLeVwrxxfTX\nn2HBeuUjBlQbTdY5nmg1nElIJ7OM48kVG0X9j8M07dg+m3w9YAxtee1HQeNy\nJTttRSGX855L3GX/kNNhFrqLl5EBUfyPWnv9xb6VEbApQ2B6qeV1Ysju9ANY\nbA+QeXTzVKhd+t8NFq9SAcnclOByZ67kKicjzu5gbaNsUwWe5CPITEy7C99M\ngvBVk2EwYp3bvWjd1nLHinXE+r6SGAiSOLQ2ZpBKnPVDs39FT+LPLlR9x3np\n6nz6eyJTWg61RGrEEzCl5DUj7FZi+gHae2lDPo4VpfNRmu24FsWXIOEt9JNC\naTiYrSRitYgE+RIAUC2zpRxBkdpGHIKv0mQVKBHcSf4unimHoDRGJJkohS0l\nco4g/XsQcC1zJ+Ff9GcqhFITuVKssyHA4P73VggHSgdj8Ji++NtwnGZGYzdO\neH/g7L9ykFIXnSrtr6iGY81aGWNKKQdpyy4H2QdwmTHJM8Ccl8EnRRJFU7Ot\nbpwqs7j0bIkW2E+LrIxjIbtU4LSZWlkiuib1O1cfVWCViw8iunWOBnMiwNyD\nMR7oySr9xhkltdd8hBkgB8YYRJ/C8qBcEWGP7vFyl19tTgwkQa6UojhyRNko\nG/OinH779RMeA0Za82c1zSeXm3Fu60MkiDTxuvbz1lrlLkUMyccFdJEPoxOo\nfgco\r\n=ozPK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaIupH/Cydn8iwobbBX53my1CDybFd6eUmExdfS9gVVwIgPnqyBe/lEL9CqsYt4OXDYir2dPXSDDQ7HJBDIybza6I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191227013928_1577410968396_0.4346084403692567"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191227191516":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191227191516","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/proper-lockfile":"^4.1.1","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^4.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f6c56ed05bd532f547c4fc43151c262e2302db5c","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191227191516","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-OqagkJKKtua9vK/KDcn6xWOS1x9hFt2WosFIc0OIdkc/jmIx0FW4y7sC63CJp/BoxZjlBg9YbCRN2lpmYh063w==","shasum":"cbc60d90d910c96951e3ca4d4cd44e050de2d774","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191227191516.tgz","fileCount":1040,"unpackedSize":4377920,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBlkRCRA9TVsSAnZWagAAiKYP/0Tzz/wB52IXGeS/XOwA\nM/4AUAcmPYQ0SK9M4hAjCaUxoxbVBazTZjyar7HzktWyWJpBOoH/LDCc7fjg\nf6PfNcRhC8irHvPFXU5MPZ5clWajsJBhcKeSkp6VyBA4ORsl4xE/aW1RddrC\n9o0h3enSlmR8kuOdfvSAihrvaYnLWlJZQ3AKEqfaDqetHj75zOmAyQWuRH/u\n0VKuDjKC4y5EpNPAGp6ZmkhSj2OVef6jtnOXb2eSlKCFlsA80Ok6hM9RpILl\n2HtoD1myHAFN1yhd/Cjtn4GLwNDdbJSqGTROj/eIiBWUjLT4qDg/gXRELgBv\ny6toQp+wK+/z7Xl/kyWshKe2ixp1GP2FX5foNRNFO5Z9uVxxoZKutoVVTpy4\nkEJ+lXwLxDAUkBZe7ysZRM6SdhYTvRzE8gIPPh8qT4pGMXjrZJw2uw2xFpyY\naeUnEg1NXP+WKOOQkT9Tl7n39sua4e3F3bdaPlTUBm3TaxRCkIsFJKpdJUY2\nvzWNtLX6rx+4hNPFj5GRXnoV17nyPJXWRUqiNkx7XnelLQ2b4/LkXIc+ygyG\ncghGZXrv2SesHCghpATorwDRg4cQbAzN8hpbySuU4Enx/fbgLgtY1nmkkC5m\nXw097BJiJcBtWKSgREe83DGe3JomeoLE871nwLV5Wg8zYEypxEo/t96UeFwR\n8yug\r\n=0zNI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICng6VPLbm6eEf2KFA3ztuiP2YpD+UKQW+T3jkwI70piAiBkuIDkkfevoyYyhfVRLhKvaMqn6Eco23pOlRPxpYRCog=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191227191516_1577474321289_0.06823375526026187"},"_hasShrinkwrap":false},"2.0.0-ipcrm-proper-lockfile-update.20191228171934":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-proper-lockfile-update.20191228171934","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4fe87c4e470b053f7f248153d8c102bdae75c709","_id":"@atomist/automation-client@2.0.0-ipcrm-proper-lockfile-update.20191228171934","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-K31PFeXReXYpuHk1X+1FBUolxo9//eNlTZr4ddlLq5V1OZqXJxDnngW/DgIr4Q8lZ+yv5Gq2uMpAFqcUA4ZvMQ==","shasum":"cee90cb5b74f48aab3f74eff0d2066b7c10b1901","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-proper-lockfile-update.20191228171934.tgz","fileCount":1035,"unpackedSize":4366249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeB49lCRA9TVsSAnZWagAAoTkQAIk9KSizvBCLrTn8qRIl\nXJqNOlkeP60N3qu8hKHWI8cABECI/sapmUi44XJ4f1JoopGTQ3IRanohz2QY\n2Ew6f0+CyIMj8tC4yW6+KIsUcdrLRfgzec+65pciK/AJDgfbAPeNAAKL9VwD\nOfpU+4XjKtUIk2nHp1/veYUr3yHPwyrYHFZDsYn6+tFd22AcqjnHeXB872l1\nKdXoZK0NL8JLW/SdfFOuh8MaxObkb7ghIj/cnQ2g9O7kwTpvI6Q3W2uGg4wv\nvD3eI2gP6bRKdW+Wy3AZF/cLIVb6olyNc7prAUX9t9FuHU7nqW70pZ9pACv2\n3Ft7k3MImKmrBcjertaaUIMkMO1pcjlupviSHr4bF+oIkuWA5FBShSWW6/rz\nMDjyrqAn5C/dQ/EB6FcUHjwuJyYtzFAekxGAuYeEs4SpEDmopL63l/lAazl7\nUibCzpx12OVoTbxiWAGlfKqyIWCG2IQOlIw1h/y0Nyzl9w6MNaF4BnyN7GYS\nK/JMLpG/2oSRjNmE1tIY7VtGkCMjeBYiE+M/zdXJQDcw30tHRhqqVrGpKM6Z\n9CyH5uUFY5ScSFaTw4ZDw47+75WseLRPUMyDoJ5CMX8CDFHRn+xXZs5pMKUA\ngQcM7m+HwT9VJVGuSq83RpfRLhC/MY7Mds2PDr8hA6VCuHplZPcU0UwxrCcs\n5P0/\r\n=xKSk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEEosdtecdsqLk/FDd8+Ay2MPnfhFxbLK84QULa9EhnwIgcs0O2qezSoJnlgZBhfm/lw2pbW9tDsOqmZ8ZQKEm+Ws="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-proper-lockfile-update.20191228171934_1577553764724_0.16000697262170926"},"_hasShrinkwrap":false},"2.0.0-remove-index.20191230144029":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20191230144029","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4bd09984e478256e8308f24d2a770e6126bda3c7","_id":"@atomist/automation-client@2.0.0-remove-index.20191230144029","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Hxr0W1LusXufC/2HSgWmacdPrxLNVUlgk/UxBsFkNCkOVwPfKI2IdAVi7mJ9TWNDK3qFYZ20gwjgOncAqyRZqQ==","shasum":"16ba1478907c4f652dbb4f950e4ac4c49070b54b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20191230144029.tgz","fileCount":1040,"unpackedSize":4381090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCg0lCRA9TVsSAnZWagAAiwcP/jA0/WV27WpPLkFUXwTV\nX5X7KubhVl/o+q8afaMXbosq9SA+Q46XTV5JJbkLPAenmZsCrEmIUD8nDmek\nstwsIAKT1PdZAlrjXpdzJl0+mUa+dwbGTb8vS5dkwnpupg7XqbLG0qE1f9lj\n3GJhsq9vMs0Vif24tJWBo5ZT2n5PXDVqkqd/noeq/V6JiG7WzZkBNJNPt+gm\n2nThIVjjf32uwAAJtXMjjVwompWFgacK3QGUkOQ9SHya1jbezBvYz+vWd2Fl\nq+x8H9KO1+mteWM3Yw1TQr7HB44Fkzaa7FCb9t0YczAT8E3l0iQNiZlRw4ZX\nH4Qdx70MDqLBoyr+wtDQ5kgi9m2hdYtAgdbnzOVIM25ZkzxBhrgNJrcghghd\nFwhlcZ7VVNLzrBCJnyBgK8DhPv7/inLR+N/eZ7UmIFl4fFiIDHz8BYLRqkO1\nILPRjKFxXDc8wHoruQAVak7a74fcsxauf5UvizvMB+IEWcj9EsfQqPtiEIOW\nvAiefEvxtXftCagw7r+obOhZxBjV5lShlEdr96oVxhHQJLl/WuTq/AQgE0pN\nf511nIZUfGtZhBGzek0tuCrg37lXZxMi4JOQ/HRZR/NOtTN1p9bsrA4hyCeO\n3DjvBXLyv3yY7cU0U7hpNQ8f3lDzlWzx96I0CSIcMUaMY+vc7SWLwL06NzhD\nPfxr\r\n=2lFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3OqZTMSFEQlFYoZ2Up/jAKG3705JGOZME2035f/tQdAiEA0OB5KW0p+SFsqzUIU1H75Xb9AgmC8Dp6StcTOxKsozw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20191230144029_1577717028865_0.9795486616665372"},"_hasShrinkwrap":false},"2.0.0-remove-index.20191230145915":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20191230145915","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c8570d8526e08505fe635f876f05577e4dc6234b","_id":"@atomist/automation-client@2.0.0-remove-index.20191230145915","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rEmRf+68ZoTcXaeSz8DK+Gx12HmiVToVOq3jQiHyrcSHveS7WJ2LCSRY2QpeE6eG9yJC+VjjELSd2Mz3HqWS9g==","shasum":"06cdeedd7278217ca797e20cb50792dafa6071dd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20191230145915.tgz","fileCount":1035,"unpackedSize":4347640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeChGNCRA9TVsSAnZWagAAHmYP/RgK3FiZSJQGYnIh7xzW\nNYTpNow6DXb5HJIDzUY/XMMmNeaQiksOS6zZWW8I53F4dwnrqhdJeaTPJVLB\nRBMc25iFYTxLzRA0b71443aMHQwxnIw3suU2u2OeCIR5+IB5lVjI1TNtG5IG\nZQ/9mbigRnpGotsM12uC83YB4hPFag9+1uV//ySKE8O+XePT/bgLYtOu0oCm\nwhtHLjUlOwIkBoMRgP4zbZu6Qe+4apWNSds/unjEe1vLj7LFMNOlDXOpdI0E\natumFLVN2td+Y3MFVdBnrGOJM2oyfPLged1paV17Dk0Q98TsZVA4aNUIZJiL\nuf4slBGBpTw99Q2vHE7EzAAfWhdXGYiC+VIbbdzDPuhTYGrfDAM9TdccM4Zo\ngaAzwiVuwBLfbQce6yi+kAhnfCg0IEAaAs/DCTHO0mrZG8JvVuyDRCs3pKLi\n68bYrS8JZhxGMfaXsWOwq+yVWiC2QDzI6YG1se6vPzvsb9KdDr450ofj3vKl\nE6RE7b4PcOluhDB/GtqtT46+y2Z4fVInsHtr/Dfzs2Tk2zsdeezQTS6hK/SD\nsvhtfnRhVyChOlus8q++60IuPjEV3LVsMD5PMRx7D88eGX7Tp99LjSEr2god\ng9eBukB90OuBvKJz/Q1hl8Zd6s/6fKvnm5gdxvnYFLR2tanIaBPhryeOLEQo\nooww\r\n=l+M5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0F57Mdp/izOLsPZAnIDTiJ2a3zDJrFQm32XTeW0dZxAiEAgxlOg4DlvI7I0gY/LpE+emp5BPemzolaQbeXy6YYXNA="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20191230145915_1577718157394_0.7204523107085641"},"_hasShrinkwrap":false},"2.0.0-remove-index.20191231114336":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20191231114336","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fb0d49c2f9166811246994aabcc181344364148d","_id":"@atomist/automation-client@2.0.0-remove-index.20191231114336","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-/gjZc2qSeDpzuyAlydTcUZ48zL+OMWe2BJBFN6UHcQGIf5CW5nHRWsPl7xrZuBHHaBW9NOJVkTclVkxmRwWMyQ==","shasum":"2c1c18b5a442a0cb194ac48226ab218b1d934c48","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20191231114336.tgz","fileCount":1035,"unpackedSize":4347577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCzVECRA9TVsSAnZWagAAsAkQAKFoWsDX/u/mH7dcgXcw\nhwAVaXPKCIdZ668MEQiYT1druRYi4bIPbGo9eVw0FrJhEsg6C15FZ1+MlwNJ\nd3XA7GZk4LTsN1+rfhRvxbs5ews+0ajN1kgDq3mq7P35cd8tq1C+n4en0Xud\nmONTGTaVK5vdcR/1wPf+6C68KL7hxrQvxvEOtOur9TH4jFtrv54GLp7w/vQx\nLRcVDMNaTa7EPXXFIw9QuXXbftRHumUiDYrtUFwVuPFtwIckogkGHvyKAFF/\nLWJ4HH0jm7TxnPcHZXlkZw21D7sUEQuhwhbeq6vWeVG5IHAMbYhqrQu+xNmO\nZv8X7paeshJKLPIYTUUkGo3jUV4TP42l9BUxSTPhlxU5ens0+hWfGHi9Pun9\nbDUigDVTtiy/tiv6SwCXCs5B424ZWUCDPtY7ke9+9M976d9yUUMwpT75CAIx\nvDavWSkScSw1zDpq/l7CyDILeGjjNuDb3bnH19TDRUoHXfUlfWkrKgCXSaxY\nR0GHyeFZxrTu6a8RBMbfJyjErVOFYJWsfEBo8FXs5dp6w8hcchs/58t+oevX\nwW2S1UwmURjhTaw8zMdfq+g0AlxNR2WAH6euAj74RN7QerTzYEqeED5uATcM\nlF+2KpEU/sQ8N4jUMrX18fsDsEL7DLJXW7JfNQvj6NnwdF349wgV3fwbPYbf\ni1yR\r\n=rmGD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhIzGUnW/uPlCDhOFbrmUxkunzSCUom9yAijc6M38ISAIgJlU/cjehdBBC6jQutaCZrm/cpoJkb8oRqGu7EzPFBio="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20191231114336_1577792835413_0.6076097251294563"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200101150125":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200101150125","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"61622a078c81e2d98483937bb6ff2fd4245b972c","_id":"@atomist/automation-client@2.0.0-remove-index.20200101150125","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Br2CRjwSdBOiVBk5Y80d102EyIEL9pUIMbTkY46UxYissL3FRBUs9mKKOEThAN+5REfBOA5Ciq9lAWxQYeHQWA==","shasum":"3b02f45887a23052d975bd9907dee25763227c6c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200101150125.tgz","fileCount":1035,"unpackedSize":4347208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDRAwCRA9TVsSAnZWagAAo2EQAItZY39qWdYvWK8h2Uj6\nJi90oIOjp1qn38Nl73+7XOjYOlbKJHgRjt6Eyn+/eW16EfdrvfxwC26587X/\ntKRpUFLe9YjOhmYH8q45gcNpfuDlkXQ8EKR5ad/O47+jahooEFQzFl2+FeDX\nS/qAV2F2I8aU2Wmxr6zdQJPf9ySX+Ig1pqGGQhTqjOPAypiAg59i2w6YNAGQ\nuBQVeluVzOLxtsepySxAkcb4CNNnmCDwGc/QYaNjICJTpHDtK5qu24i+UQC3\ndqhxb2yjBjaUWya2K+8XiZvSLqUatrq/C+9lZQFXdiE3EKyCh0aRY8/AjUPv\nwr3/jk37l/Vcc5887zSI4pJUXmpSHIVePqVXsjNrc2XH6wbW39V3TEHe28GB\n2zyldXSapBaDW8Vms9X/ZcROcJ8UlxyBSbJt2MvPpnE7JovRO1k5EKpqh8lA\nH6k3xmDSmpQBQFUytraTic7xAZSHiNVY+s86SinfF28/MZoSjMam5ztCQBKI\nEtlZjrH8JMcNiy9ROhG++DuC9Y2Qj+620iIzJpe+A7omO85xpbhmEn+7GVP6\nALKeidaaNje0ZQtawXN0XZt78zZ5C3V8TwIGzRLz63UoMnfRv0NlgiDObeXl\nUzxmR0sdyamFnBv6v+E8dWJaiuz4kRBv2mBM+rjxBBT98Tnn+WiQXxVMfwkP\n9GWY\r\n=oQ6N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1lqbusLZrYZxay77nXdkmFkuovQE+Cgti+oMlxuwW2AiEAv/0FCYuYd6KiqASpokpIPO/XTYGiMuIJBi6L39KCx2E="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200101150125_1577914416104_0.20650143925981035"},"_hasShrinkwrap":false},"2.0.0-ipcrm-531.20200103174124":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-531.20200103174124","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7b1315a04325c82b5ebdc6a23c6e05218c798e9d","_id":"@atomist/automation-client@2.0.0-ipcrm-531.20200103174124","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Swgu6pu1becxnAX+2v2Z0ek6mzZvp975guDB1rYFnQjSSSsiwTzJpZ5JKPo9ReC0gvy5cBlDYKu6+fayO0k55g==","shasum":"347840bfa4905fd8e716e9e797ad409c0a37dd8a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-531.20200103174124.tgz","fileCount":1040,"unpackedSize":4422193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD329CRA9TVsSAnZWagAA2ccP/0u2a8234MVYGY3nJCrC\nJFjEg8RK7lW7s7MeVSrc7PYUZnHFLHvGtBBb3+01EcC5kE+D1y3VJFMqR6pa\n/v8s5oVkq4UkSOI++otlEIS2nIo+sqzrsr12cs1ZPTUJeFLI/zIsqAnAoGTV\nuOwFTGBDJc1ZoT0i2OSiLBRj2seALX0WMD6i8DwI4NIbd09BMliTGyWVm5sf\nxKeHFVv5RmBvGyHLlqx/Mnt5lArq7ENrwrB/GWrczIvs1VIJ4fZtF6gtUTTp\nLgIwarJdh0UR3kiBFZOT/p+Csl0Xfad3sDZ/1aj1SKrvKGssfeYJxRYLvWPZ\nHsuPOeUckxUzJGbfJrbicPy+rq9a6KjVqqdzgmKapSppJy8zXkiPL7EFIzMO\nWjR77ZZlwGp++ve2t5qiSdiMLZnOx+tuhnDrmvqoFuQHHCDIcZG9ZRDmibym\n1bt9bQU9Any5COPr2o5M51ACSM7TXw8WuHOxkpUQIm54FXPaDs7FymWJ3BB2\ncY7nCzZn+i+HfOICYraSqPTRHvxfJwpFv6Ga2Js+/cTfRXZzbeERurNyQBQZ\n2bVRrs7naKaClH8eXfBZu6R8deDkrGdBe3yXy0OzRFv4ovOQIaqBkEcWkDHE\nXAlxAIfu8Ncss9k4+TGZFxif6e2FnuA9oIzANOwp9hNLZWEwgBohUs4ZCcli\nsdTY\r\n=xETN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHIbAYJJzkBY06Wb7nlzUMbzBL4Ogz9/FAxbZfj1+FE4AiBMez5zccdksd7rKOD1z4aZCIhpFJzlX+f9MxFmQ7OvJA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-531.20200103174124_1578073532789_0.2989860482107045"},"_hasShrinkwrap":false},"2.0.0-master.20200103175243":{"name":"@atomist/automation-client","version":"2.0.0-master.20200103175243","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"eca16d5dd322c66b552bcdf6c0627b3a9e81b225","_id":"@atomist/automation-client@2.0.0-master.20200103175243","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-3mZUtehAL7TvnbAKWBwQKakAjvM+QHsR78m3S7lI47keH/kwx2/2VhatEq2duTFXXGWdc+TG9N5kI3kkSq1VTw==","shasum":"05b0b8091313175234cae7f82ddedae57e7357cc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200103175243.tgz","fileCount":1035,"unpackedSize":4366341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD4DYCRA9TVsSAnZWagAAdIIP/RNVlZEdozS1KCH9D1r2\npn3CbmBr2sRWNDI7DWQ2yGN5pg9gQ8bIf0abDY8n9/LbKM7eA/lBQ3bvn445\nDzL9elUwx1rJhB/u0TXMuXpIRASFtC21KitpWi2eG2DjMUFSGQfV8uMRYYLX\n8tV+dIJ+cTFBoA6N19osqo5FHLKv/uJhyIeYwc6u+6+eFMEu3uWvVTZw6GSS\nu9YKIiLE0Shfp1An2IKU56ROi6VZ1JIEQGPYiEDj2BoOFhj9E2N20SSpnP1a\n2zCyWpepd4UpzihzMXg6MZo2Q3CuoTZSTeFoNLDk1ZzrolSzscpY5nNl6/bV\n7LNXyHUiRPZvzuPGlGZIC86mmYYVtIfukMfgJLcVKtlT37QdiCWb4gjJj0/x\np7upPYuMpJuEokciKoZH+CHyKH9p/wH6a9BQNc282inzb2L+Da28Q+Hi/Dcz\nwz2wyGd+lTVh/erMRSmw7gvfTveqg31Kt8Zj8gcxaWsdSzRZVqLxGQgHRDOW\nP056v5CynsHhsGSNrT+iz7nEsWewIdMb8v88jwTo5k/HIu7Bd2dYUCxtHMyJ\ntE7Ctp/AaduevWW7bn9BekvFYXseQWjEqVgeZLjWs/QlS9zsyNEX97tVXpu0\nkdpFQoR91gjj4PiFJA7+GY7lf/E5dNuHv6J8/lqHf5LSi8I6fSsiS4j7nIeH\nlowi\r\n=Kq7U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBS9U49vJvCHtqL7tc2t+Jryz0Bh6UupTg5QTpRCJpceAiEA+sQwV04sS/1/9z49yNaFLPA7f2lA2UkumhlNrXqS7rE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200103175243_1578074327796_0.23862740511171054"},"_hasShrinkwrap":false},"2.0.0-master.20200103175554":{"name":"@atomist/automation-client","version":"2.0.0-master.20200103175554","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"eca16d5dd322c66b552bcdf6c0627b3a9e81b225","_id":"@atomist/automation-client@2.0.0-master.20200103175554","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-oG/77XBSefF0wENeHMCwP9pWVms1QKt7+EYfaGKIXG1yu7uP0ukccgv06H3ryCqCaUNNp0Jrde5o/SFDX4yOvg==","shasum":"d1ab27cee1f69708add37a5db40910f131c65c16","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200103175554.tgz","fileCount":1035,"unpackedSize":4366341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD4L/CRA9TVsSAnZWagAAzDgP/2jlrjJlmE7PHlRCHT30\nG4QY23CQ/x38ygx3VfChgSLcyTGQXeqhW34fjOGtScp6Xvt9qetm9AH4lP/r\njUGpi2VYgpeddQLVQASbOeKLY0O8fPpm40s58/HZdBmS218BP+8uWmEXqEI0\n8062vVUKKB3tAdJPgKRfTH/sy1YFV9kH7J9OImRrqUgSd8L7EgXIiQcN7NEK\nNFfRMPt3/eVmbMEh+Mph1m0ZvwPPLIL8+ptprGOqcltardqYgMUMd8QSM3ks\n5WAu2ZXZixdfnrNu1EcCbr2pcG9wKf1r8ta7qlpRZg7Jtbk3goilbOd0cwyh\nXS9APjHJ4OSf0/yFASZ3HOGClbZ22Bqd6W4wdoVY413pdlE7ctx/I2p4FxQL\nIW9/7MspfwtwknPFaOQX9sPN2rGT43oTRTtvamfgqp5+b23zjH8ryAB/v+Zv\nsVDKsfhHnakhj+94sYwU/rLGiN70HdOSSrcnh6xktP8Mti7nfvRpiRT/5OrR\nHqYfMAl/4zOCPCmuJJRfESPBBfd+Z3UMmiUGBktz6sPSfkdY8tOHYKV3vSdz\nwAX+lkH0G+DB1G86itRtSPdeMUugBXQrZGVBMq/Tb9ORwosLyEO9HX8uJIqE\n5AtXUL6y80/Cyd5OIz2kptgU/3qIQBCJ+GCxLnCR6erDZERzRAxnNNTEAix5\n/bj7\r\n=EVOg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD55wyBdNxaidSJ2/QBmtk20imPQhkLNucwXUe1IrIpQIhAMJ+2YIvn9VdP/qQlAvUDFZ6h6YoyHfzODuay3l6bfOg"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200103175554_1578074878345_0.9649529013261382"},"_hasShrinkwrap":false},"2.0.0-ipcrm-531.20200103201659":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-531.20200103201659","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6fe4fa390dbb984dfa08304ff770f049275e5a59","_id":"@atomist/automation-client@2.0.0-ipcrm-531.20200103201659","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-iIuoNfhgJzCs62h1sZmFp1cZEmuDPlkM8NC+VwGflmxUdS/W63xnyeaH/jpuKuB2pPiMlIkESSyq0ALGigw24g==","shasum":"6eeab4ebc391bb0fcc3666606f59a6d9130a8f03","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-531.20200103201659.tgz","fileCount":1035,"unpackedSize":4407398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD6IsCRA9TVsSAnZWagAAFxUQAJDJD9SxEuXN/AVPe4yf\ngQERtGhirwfG7c0c0cd5EpIWoup8/E3pRubJnjIvKSxyGr0kQinLuRVYjX/c\nmPbAOZH0n9iMCvPPa3BzvX7tEcxP+XYp++qitu8m5DuQSnnJz4L3TWYBQbY8\nbZG/gzUExV0epxyurVJQHVXvsq/Ka+XGNEBIsdbzqBV4Qbg8/5I/SWOyRKAa\n5myHdM64dmeIb4Qn+bldZ0BT0PBbmeV7mlctwxOzSmt5CMZ/gk2zFocaIzwr\nyrz1jRShbcQysChRJLgYsTrAhG/bGQkpP5oTUBi4Mr3rVe7RX6YUY/SfVhBb\nh1YfbYQlTLGXxcUpnXFnLFZaUDGexanGPBwhtCltopQacDgyrFjiP39ovQad\nwdju8Az6SOGqiwVulx4wU0CVa87VAjPXGiw0iutgdQ6csNlDaCjetnoXI+rA\n6lKSH8ASQzEtNn41wGs6/a3YOpyeCqVEBqOp84pzUhEpbu05BlMbI3STqR2u\n9zKsUfIH2zg13+TkZY43peg+H/iRgY3GdqtyL4rLIBroqlUm/lbmHDs0eIgK\na21WNT95AqhdcC5d0kAaikM0CCaGWATVa6uh4+XlTAmq9X/zSAKlaHjkUgPO\nxo1Bj1aL1PWWZQADI9w0RF14BYwhI5oU5Q0rhoH8Viqy/AZjqNd0Nbbm27/E\n2+sU\r\n=iRta\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBWycJzONi8nNXs9egsH4jq6uMC9SYtWt7wEWsf4izlAiEAjp/Yq8lENGwpzAIZc3w8GjBXTgPQ9t3QGb+UUTV9IjU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-531.20200103201659_1578082860157_0.24849334630103437"},"_hasShrinkwrap":false},"2.0.0-ipcrm-531.20200103202725":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-531.20200103202725","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cf3d4ca33335c8d506555a32da561f95953b6258","_id":"@atomist/automation-client@2.0.0-ipcrm-531.20200103202725","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Uq+ROV5sutrDxXMKo9AXKgXogTx9zIqObVmI9uMvQfjWq1va3BArWXoSEJ9OTTlJ+jlbAtAqwoLBU//yZfbPnw==","shasum":"1d3026f9011b74d705ebf5cd2b1c882ea4396b2e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-531.20200103202725.tgz","fileCount":1035,"unpackedSize":4407398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD6SCCRA9TVsSAnZWagAAjmgP+gIVOLFL5Lbbp8LVGaEA\n8TSD4aVJm6tnWqr3HD8SVUYReqaHwfLmvbt6H26q++T8F0xGaLXI5BRfTbp3\nrYnK5vqNPPETigDBMjGQteJtQuT6gK+MJ6f1KXnYffIfJgNiBmbqrSV9VP1T\nLfpP+rc0ml0m8RoerA+CW4HaieQRT4OCo1tOQASkcQFhJoJi87NzM7/xa478\ncykez/u4Poybd0oUJdwZHpJfOdoiYQuevuQYF2K6+auew4JdRsw1aO9n3tZ0\nN7SOFTc67xeM+S9qh0SYWDvmjUUgOB+kkMQA91E30yv1/s4KjwJMhxRRUq2m\nUIcOWl8xLiGKKe251jO97GSyS9geSD617uVP/8lwqmZTlz+TQNdvZCn0NpPN\niuVcCaUDVD11qQownI82+RDu8+Nk4AidkGzE8moxVYUZViVqHpLbQTCEVfFv\n69ym+mtK5zbdlMZDuE2+qhkbaYdElJPsF7ZvfHQQgC7p65o0HIWMwy57A7Di\ng9xva2xXzTyUFmK+3VbRVomczkkVGSuZvZP8yAfaKtptqRvLVTYBAaOvA1Bi\ntl/qWQ/Fdx7oPXdGHCiAbj1aW+NiDXBpgs1yTbdZ+A8FOqXlwuVaBRH7gmhV\n+qXqY8bGkCNql/s5bfTLvv8ShHuNsRFEekZRUbdoMPA1amr6hKVIxWYAKJFY\ncuNT\r\n=4wpS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFx1c+ILA+UVGL7te0ifI593pcJjTzynygaLk6uYvOvUAiA7rc6Cz8tycRz93cpuIR6UAKmzSoJIcbcD0fAq5Y8WPQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-531.20200103202725_1578083458467_0.4787432836067884"},"_hasShrinkwrap":false},"2.0.0-ipcrm-531.20200103210228":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-531.20200103210228","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5ffd7fd2fdd57699b2e9a3c00fcc81c158cb7efc","_id":"@atomist/automation-client@2.0.0-ipcrm-531.20200103210228","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-ov0kXdyHQ221oBbvH/+57e4TujpxTq8n4go8dXw0cwQ9g8iXtNzGHwnq+TJpOJIKMA9oKhZ+5TyfqxW8tQHlGw==","shasum":"bb7034b819a8c74ad9df647c5489994249a4d8e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-531.20200103210228.tgz","fileCount":1035,"unpackedSize":4407396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeD6y8CRA9TVsSAnZWagAA4xYP/3kXwzLhCN+TpErfkcH5\nIlmzAuvthYbdDlnC35NHwAAzFHKDCsZdhKsIGCTV7zurk55NyKuDn5KcGscE\nMbjliljfJW1WJUI+ctQqP2rVpDyrrAliof+SRxCghmIwW+b1NuWZTOiyiC4g\nhXun2XxKX3EiZGMgPcohg3u9Jkm7FYDe78xPDBdQee7Sva1QmAjaQsntsj+V\ntoD3SvSpYpFGesoqQd1XI7DAITQRzb/06FJFiC7kMIs8mCNkm4W0TkqKSGaM\n3vwSzugD1nZbY1gv2cTmEqZceI4iw0BWks0QGNzsDSmGhFoAU+z+CtTexfO+\nUgZX9wuV3071TX8E/8lNAZ24+nxA1Vdiw8hLCOM2QQ4SHn+sLwEv2hKReyFK\nw6w0WuW+f5GgSpbOjff0JLm9nQM4Wg7bbCq6nYML2asY5AHOKHeoC5obOm4i\nNOBNd8gcm/99OU6rxGLBb+169UkLxWSyJSOwFxVWYoqGwMS3U3H7iRtkpKNE\n1a46+nXO4DM7Z6sl7lTg+2JK9KSJtnF/86nw3kZ6/CRPO7f67HZ1ta6tMqCS\nTUmn/2PLOys7aCsyxy9pHkRC0hWK2odQo1bAKrt4KHyYFqR0x9/22nkDRZmZ\nZgzIRh8qAlpMImP6AmxhjBrMFE4wxkl0lBLdL027wmBjwTZYSMXXGyMf0L/x\nWEY+\r\n=MiBG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVkt5DLFXGB2MxOFIWF8OYIz+oCJN4klqM8s+PN+LGiQIgOD2K2VH9nHn2Sdm78oiwHREblellLv3kTK6tWW+sqJI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-531.20200103210228_1578085563515_0.4714434317669005"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200107082101":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200107082101","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"da30b3aa29771484bf186809803b0e99e6a46d9d","_id":"@atomist/automation-client@2.0.0-remove-index.20200107082101","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-BXZUra9f/bqVG4RuY1BMYUozw3wfpPTevUjGs+Bbk/sKd4/a0lKt2kQTfpe5u4o9xHIj2WbP81p422JYrlfoJw==","shasum":"771466fd08d1c2423c39f87afb0b59757c9b8dd1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200107082101.tgz","fileCount":1035,"unpackedSize":4347243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFEA4CRA9TVsSAnZWagAA7jwP/igWuGWyEPrJZLNgAhOg\nvsICs5CXomVfLBveVFo/PLlk5A0+OWroBOSkimmAGgHCTHrmyJNgh1qS2p4R\nwZ35k6H/9nWTWIYMWvXmyHY5mI6p1c8q92zJHpX5UQR73Y6Ab+RRer31Y7wu\nBiTvxhJvEtqZZBLeiU/E+M8W3cW/nVmYKdaRqqDoCmN2cX4ARhCvPv0Kb6cj\nRUH4bHX5bZHro/XBY5JWM28sZd7RdWs/GCOXlUJYAwrlSNDFdmO8hzXecSvX\nakVRc//bu1ZRS8hhbRkQoXykaHj8UuNguNQgLQtLb/ZhFFdldUBdMsWyJyRJ\nKwMaW9Z5uOqYij5DEJCLAqL3qOtMLne3dXrM2YcTG4XhpAxBB4xy8+G9Uxet\naA0p1nWzANIViLhM+e5sJ/sGBKEr0cODaRSOrxZGsc5cWrjbGC1WbtbnBhcE\n/EtPZvNvtTHtNVblEoxo6poTYH9xIidEw3ueHoqNHFff20Fgm3dDUdFxF3BP\n5ZJfbTAxks+421Bfx41/qthn3T9cNVpBWdyA0UeBu/QjhORma5mz0qz0UFpv\n3fVxJa973gepbU7w/rSVNju6PUuTPaApsVhdq3QRQdAdVrQ1JCdIihWXMiFL\nZiBN4G91mKEhSw3Utq+jkHuOuu2gLN2f3ahRTkTr1oB9e0Y9h4JkkfYpi1hM\nuN62\r\n=YDp/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTX8K4x+Ztyaj0bCAI/a+OmQre75884MuNVZkBujQdHAIgaqFZhr0vCNF4kSnIbhVFk5RP4ojp7NBdnh/hxZ+hMok="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200107082101_1578385463593_0.02096072679519767"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200107085211":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200107085211","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"833ad0eaa75d2a22e9bd160c098e3c7917bada80","_id":"@atomist/automation-client@2.0.0-remove-index.20200107085211","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-8t9WeHFQcdlEAMtRJlEoodgfD/IOE/fD/oqUClEfUjg3p0wjCXyTutzFxdkr5d37Js8MS53LNp+GbY5oO3LB6A==","shasum":"b6d7e2e934ee502c30f7ba9dd2ce2c546826f9ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200107085211.tgz","fileCount":1035,"unpackedSize":4348659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFEeZCRA9TVsSAnZWagAAgLIP/ReV4l/8E3Du+UtQY4Ez\nY7vARTCFsMbGjOOtYrwbKnAshzsSM2qSDRD8YSbe6PUEeXEywroBrbRVnO/M\n1/1R1t5l29qYBhDd4Ash/FCsHM5HRNqXwNj44hSuer7PFzmvqN5U3FHJJ2zk\nB46WbnDaL9p84fjjqADXWDSD/8S1LmOOZ/b3YiIN4K55LNJ73P53Ci8pV3TF\nO/NdzYwR04lzT82at2JfSV8lZZizPFE8C8/l/KaiMfd7Zhyfx4DO6WN0kBSC\n1XXN4cQbHPRENrhr8S46B+RDUEKFAD//fciJ1g0cRnFtgcG7s6D+pkYlywfG\nkgyfRh/xCC8y+gpmirTQowrgAsDsY0qC9jISnIfiV3c9sk42CSimMfG933LO\naQVACbyz+MPi2yJA+VGVbLMwZAgKzAXT+RfzaEUHmfKZyrqHcdFgiWcmxrtX\nZOfEOEtCidFshxpOyhYFVCZnwJHehjDpjMLZNjsLvTom0PYtHOgW2jDtTGqS\nmVaMogQfAfjYVRekJ2KgLrPG7SB5yg/hiy4fNC1XRMQpQwjIgejS9hwDyLPq\n5T3fOdHkz/G9fuKaIabpsMeK4YP5Mjo527+RsyRs6VuvgPWigcZ3OUNaYFVK\nW2vRNgDkv26z8H/1q4QgYkWSUPqZhnVGnQkxlhw9KJnQLJgRmJSz8mVvsx94\nMljp\r\n=b4Cm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDnL9jM3rFFTwpncLsDuCozHJk/gBLTV1LrcBkQh8RI7AiAfBTimVZv6h5M1fHsvmmPp9EcT1yVWOJiMrgDiym3WKw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200107085211_1578387352728_0.9862048964221497"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200107112456":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200107112456","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"837dd53e4c055e49946ab73e8e4aaa95dc7573da","_id":"@atomist/automation-client@2.0.0-remove-index.20200107112456","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-BIGHqBCE6F2HQ4p3FKlJhiTskxZu57kTpEVCrp/i6+WSShrK4WpHkD4Ri8QuT532rTtgLn8k4uVoLYGW4qxxqQ==","shasum":"b07fab3c94205fecbf9c12b2264ce46bf5335f4b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200107112456.tgz","fileCount":1035,"unpackedSize":4348290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFGtXCRA9TVsSAnZWagAAb+QP/2EFdKZAeURCLcHHXM+t\nrXoNxEJ82lx4tzRKOc0/kz0fH9zqpbTdHnAf7JNX7ZVHOv2d80Abfg+fHbhh\nrNrb0Fdr3hjYL0PjjBmRh+mfsvbfjv0Oa6M/1xUwL345J47hiyB+Xg6M+iIR\nlS4zI96voPNjvl/MXA9gpgQQ10thhWlIujhh0naNDUHkyz+jLWZPvFVRI6Fl\nXRvLsNBha1zvE7lGDSGuPdS14nG37Fw53mAkjDl/EOA5b7WoFY1WG1AGRIEY\n+RwDaqwCEZ2JW7fb90xtnlKWXs2wHPgsXkbHGkOnumRGPJt+8KJqznBOfXMW\no705emAWdNdoKzy++MH8Ni92AaaIa34O1ZrPaauDRfQsDZ5mpmEGUE7AmiZu\n186DxfQZFmMMe4dOQqii8jOwC+h4GmAzBfOEjESxhRcg3zA5vXJ0682iwOL3\nMbrk6O/K5Z0YaMSK4qqcWwhxwTdJQfHTO8iZ5ZOUechdYcGJXiOsDNKR/kbc\nY9+S6p9VkIM6WdDH2zOfrujxg2N/0mXtebWhqVrnKltVIdjtFB/PeAGvbFUO\n0m6nhtVWkPTQSQ3axsl2sqVgtQa7w+lLkgX1AYYYE40sJEk1QEDFzkuN3ZNK\nJUxuvbKr8shF+5LO3f3qKesIibXZJLRt4vyDsFLt2maKQT8SwaffBBmxawZH\nnZxf\r\n=ducE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfL3frja+AmtN74r63Bc34Dk82DbVC+y6VGDA3FTyibAIgcgzme4e2XXGO1GqojFtCccGY8e/ZEpinJGxuqemCaUI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200107112456_1578396502688_0.42591586291857375"},"_hasShrinkwrap":false},"2.0.0-ipcrm-531.20200107151204":{"name":"@atomist/automation-client","version":"2.0.0-ipcrm-531.20200107151204","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"23eeb1834a4aafa50af8a14d46d99eae99d7984a","_id":"@atomist/automation-client@2.0.0-ipcrm-531.20200107151204","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-BN0+btvQSEsHJcXH1BwYdRtBTc3CMBGI3hJiEMMG5/WnSre2F//oL5QzXchh3s6mZ0HUvSfp82n2sgbQbgt5XA==","shasum":"e1fc9768487b3cfe5cd9e6253e6040d68c720825","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-ipcrm-531.20200107151204.tgz","fileCount":1035,"unpackedSize":4407096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFKC/CRA9TVsSAnZWagAAeRIP/2oGnethxBOtF8lq3zsp\nJYrLrvWqPB615eQrOhrHVK4ntNb1BRgdyj04mZmmq6cb8fl+SoFIcGFS8mes\nLZbaMAknB1bF88XmpM75FnODXBkKOkr4fVI2KRrEydbFGnwq3XMU4RMWU071\ny9FRTLUPxXYrJ+gnAjyefEPmCkJ1OFdcasTCU7WGfvJj9/EDW/rsl0xkKLqr\n22c4RMRWPymNLTCi8wd3+S4bF0qcYeZzUSBB8866jveDJQPwB138mbDZqHym\nOVhVzEMbERwJ7F9kf9bErJWTTDzexxxpr9H0qXyWozLqq4/WtpRJ3hc8Tg1I\n1evWAwpbB4YUx+RbntcuEk7cIYBXGtQ9ebuFecFH7rxuHJmq4iKRgOeylOCy\nEUPGoJI9RxkB1nY7ugwat1zAJd48b174Izh3+zVRxNktcKOFGpoS1Bfm3g5Y\nn8mUm2Qnya2WE8AuDqCXSezzNpFaMriNCmbhuDv0OR08TFDmhqg/gxKqtir/\nt2NjpbMQ9ge84XyA3ozOI88onIisi1+JgW80vgcn8Jt/A7EwPkO12m16vEk8\nBLTGSSQJBu5AdSZJhXKdnwKmwx+j/eKZwAbzlGzKs2k7QYPuVES2+DvAPX+7\nuyH3yaHAFjN/HzgnAOrQXRB8jvtbCPSre6LUiydAZ5jmhtIJo4zXFR4jRTVf\nezFd\r\n=YOi7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYcFUNE3hRuON2bCIK6uX/DBaj0+ec0P/82ckFFoGUYAiEAie6HkqcZLY71GcB3bH3qGAGSyS/dTrcfB3Beth6ASyM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-ipcrm-531.20200107151204_1578410174322_0.14015154475392522"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200107155146":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200107155146","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ceaecfca93d3271a2e43eb7b479a06f14a8171cc","_id":"@atomist/automation-client@2.0.0-remove-index.20200107155146","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-cEIWHtYgMFJJ8eIsOj0OOgbUkxVzVlCFggDILIAv4Ykv1obC2pf63tg15rHLxRK3bU5zDwTUEDsiK8WGL4dK1A==","shasum":"a4deeb73c9b38bd16d070cfbfec28617b12b7094","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200107155146.tgz","fileCount":1035,"unpackedSize":4348399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFKn7CRA9TVsSAnZWagAAZ10P/0YpXwVcCBZF6I7kcHM3\nwuAp7TlcgdYlUMhz4yBcufw9dTFgoZFZvZARTXDtz+DG1UakU0XvLiPHvoew\nNFAdcsIl+/1iWy5CP0bahLwN79NOWl1IX3UWasuemQRI6o2cdm6S3A14zl+f\nUgR285oO00wv/X6J+gXejzPtT70Nk62ny4A7gjTUHI7tENEQDBDFL6y8mLpB\nQGTR7t+5NDqFTafN6+/0NdPhWU01ZP9hGC8wxuAWOf7lRSshq4baElcQTxKn\nBLdHbPRLwYMuJy1fKWWYqbZgI95LxS/m1Q4YN0SXv0t3+Z/a+M+dZ33ii29U\n1p6g1KupxrV42GmDCq6VQX1BX5OKG2wPv0kwKPsZOWjJLt8vP7KHcnrTkgwc\nbvpQgOyxuzq/8Tq4LwEcY/u7Nju9TmMSUYoydgvZ7Z6GXIR5zPPi1eJDNt1n\nC4IHgogWEzE4HAjLV9kTCQ+A7duH7Yd5nl5wnnxldQUSe3dWX/xELgOC6lq6\nMyQE/APT63scoYLG0E/HOE/vNJwKsAQ9z35YJw0QAzlEPGc6JAfswEo//TkC\neFMNXTpu/v6d1pRegdCaENzbSec2KLH/aXcpY0zwNsscH4rVAICQHOtwQLI2\nTCVcQUmT+KuDZRgGg2xOk3GVhK6kT3jW+DFKfUsbaW/ox8JcrXfU2Aui4cLT\nsBxl\r\n=hYcB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBo00QZNHC3EWup8hUgqGiOocsNx7YdFNp7enqdDPLDvAiAvVMIW6RCDnBmvpa8kBKVG6yiJniLhxCaNljwmwpGojQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200107155146_1578412538398_0.8139741998807517"},"_hasShrinkwrap":false},"2.0.0-master.20200107161309":{"name":"@atomist/automation-client","version":"2.0.0-master.20200107161309","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d0761458daaa961bd38ee69eb05138cfaac8c57e","_id":"@atomist/automation-client@2.0.0-master.20200107161309","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-mPmliilDE+nZV9LJsIqtzTbEA6bnLL1BCH7LvEVnhcb3dJcSOqj6DGODvt6LiSomjjbpN2sXdROUAtT5ZcwSeg==","shasum":"9fa66ce3c74688bfcf5fca060e33d9e1d3da9732","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200107161309.tgz","fileCount":1035,"unpackedSize":4407206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFeduCRA9TVsSAnZWagAA4DMP/jmjF1rrkPVZh2cq2ZjX\nSYwM20HVt1uHoRFMrxwncp+Fb+DYXFydL+fNHnSjeXcMJqKEr7pqAtET1VE3\n3psEStRpyJaWncqxUFM1Wc+lRhxs+uIdQPa7C3z7hzGi80uqnPeLzM2P3Emn\nDA9HjVCI1qSzAjAsI6WNLvB1cp0nQHw055Vep9WgO/5U0m1+4basr7AJrzUg\niCV/VGhh/WCfUSrapjvBNK2GUvsqH51zoB9snjdYHdJheZCd6B307QHJShKN\nnimGhffD30ebouGUt0C0WBDgQ5bGxBj02GxtQ2gGiGaMcle6nlhymQZTd8+I\nxrOUdClCEf9+3i+e5Ph//nA7hbb6sTH/vb1d7i008R+JqkWJBEb2L7FMBB4N\ndWFEe1ncusdYynmhFkVNgcFc7k2N8R2DicwUYNfIKutbsDVjBjfWhYkgNMbl\nHiRfKoP9jSdRvdU/BcEL0h6P4fj4+fqTWVUQxVGZ+ikiBobYN5r8pw/yA1Kj\nJZ0lZQmOljAGG5lOxPddjNbPx11gGqFMtEfJZ6zmQ7XNnG0gTUnDPH1JJu6+\n48JMNRlDNM9GnFWx1lT99Kx5SruTmuDoAZioUXmjw37/CMylgdRiRWkn7jTN\nAmhAUAkr+EL5N3LmUM1GPKkeVN586TK9wVNWyMozsFx9a9dRda/3ZYpcOecI\nH+1I\r\n=qEZR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8m3lEW7VCoQiRpaT9locMF2Z+3dRBmOH2GI6miQNpDAiAhWhJPlSZhintwTQvxbA37A+wh5Y0v/J87u6/r8J+9Zw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200107161309_1578493806118_0.42207462528874173"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200114190358":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200114190358","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"05af46cf47fd05ad6ff1142ecc733ad7536296a2","_id":"@atomist/automation-client@2.0.0-remove-index.20200114190358","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-W2auTVQXxCW9fo7fenlJPBBkosWnK/csNdpiu5hMhdSrzkhhbFyuVfKBVfz2E+IJDCViIwcef7DMm5co0ZnfkA==","shasum":"5e47460f52a889f9098c27143b3caa3d61ab4ba9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200114190358.tgz","fileCount":1035,"unpackedSize":4348484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHhGFCRA9TVsSAnZWagAADEkP/A4y/RXc5bItVYQkKhEl\nZDy0dVI/Ho3rNhH+imFo6Sxo0h2yPwpjvLNsidchUe18Pphxdw7nDdtmDVDv\nOstMEyNO1Y6MNBmu0MFqBXhKALwGYa4aThXY3wZKp0/K/QWpLDs1XGiWfje8\nkW7C4KD2cNeuJTWB+4GbOSTY52rGJJOkoLkwf6V3EaXpeCxZ7cIKrKValN5U\ns97kTvUQ0Dyy1D8mPXQVf8Eq2MTkbdvVw3i+h2dd6s/zu/fspBKU8W7VSJmK\nH7ZDP6EB9HONeOyyLy28BV0B+D/pf25ep/2URvu27HkBe+FnESKsK4FRvX8S\nAKQ39cceqCihl7tjeUR6PffT22gYzDWBWjon3I4b7ZI0zjTR2J2v2yCtRzf/\nhWNzrb+IL9/D/KZTbK0JlbmDLBf8WEc1L/gVGu4bcYHmDR+372E6YBX3lUwZ\ncKYhyXxThu53lLCGU4xNNStKGyz+A3ICpfgsrIjHiRscF2rCRzAc5Pfl3R7D\nFwXVczFud0rqlzEmtGAWedPYIkYrEovRVVDtLQGJ6xQr0BEU5hgMh3nJdWO3\notCd6uKvKUxdoGOU+R409sXynrMzALKen/wTKYsH8FRo9htw/0YmT4WE0iaa\nmHgXeRvl6QVYzfcnN7TvCdyDkhHWFvPs6g4qo+KUcuABQ9/vo6zZ/B4xrH8g\nuPhA\r\n=ovet\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEl18gUFn7D+SRgd56KRYbMJ4qK3bJLAEhjZI2BK9/ezAiEA/lZlupPWC84dV52tdpYmExkSmwebpqK8dUKYo8yS58k="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200114190358_1579028868960_0.8733432988871375"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200115105959":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200115105959","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fb53622c947560af91ec71f5e6ed263bb859c8f5","_id":"@atomist/automation-client@2.0.0-remove-index.20200115105959","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-FF78doR/4oZLY0ei3Jisz8WqGCnwHjXhh62WvvdE0m3bNfSKG3sHxGVeBP4djN8nIu430y5mYWV3eBEJ1aqyHw==","shasum":"a3b07670daef088ed6fb4832e4cabe08f2a822d7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200115105959.tgz","fileCount":1035,"unpackedSize":4348484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHvGRCRA9TVsSAnZWagAAi+gP/1VfOnZ5Pk/Q5ZqOmFPZ\n7HwFaEkXRNvXC437AjVemZgbyicGGNqYuivnEYPX3g4deaXnQBvPwPAxIj4u\nZHQlmX0uzg92/Gfla/LHd1EO1qSz1WYumFD3Lfh7GXvOr0s68mK6/0u26P/V\n05BhNv9e6MXTADhZr8I5+sZ5AXKfm/sdsVmGqiDSNMljEDd+pjySR2q8lByC\nmvbb1lwIgf2nblVUeubf5qnQpN9/UdTKJHZ9gzjU+KrEoVHiF6YeIONkHnWC\nlKcDtMmGfMcLvyZsr60QnD4z+WsQQgitWvdwuhOPb4Xa6yWySBgHyIOiGEc4\nSEMaQH3cmMnazn7mJfmdgFdPAmdpexAG1MTnWr026uXB+JMxNLh5qOleTC68\n5NByyPTTWt4yxJVSc6Lt11H7W3JZfR8S9FydlU+eR63ByrriHGbWzdW9kisX\nAP5m03Fs3rIXkjWNLm1ID2u37Y33At8vieS+Ba2zpd8jJtMjBJtxs+viayDD\nuKRe+wyc1Za5YETihRiV5lbCXLsdmq0BC8E/vWHaZ8tBP0q0apJlTZF+yWNh\n9KsbGGtkhewvxJpaRYr4HW6Z/WN0sNSqQOO9/34fMS/VmGDzrCgKNhynrw4u\noQcGgHVYv0opJY4PvpJOzUu2Dcp+esuqBoDnD4KSKy/em5m30H0HUd978X8x\nWSlD\r\n=FSVO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGpef9Xn0GRkA2GrDGUen993fBzSKrnQUjcfOQSvQI0oAiBwWqmwJoenUpn8Gc8FMyt6wyqaT2NMe8l45K21hbs3mg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200115105959_1579086225069_0.56246704834809"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200115190758":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200115190758","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1d70eecd0b2d802ae9f8048f7913e8025f6a88a4","_id":"@atomist/automation-client@2.0.0-remove-index.20200115190758","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-vqMpbuwQP6hf60Rdo/c2iMNeJpudfUFQzCCzNs0UVNqwSnbXdYbokhrawjnBnTJE+ep9NMjcWHQwM86cqmmN6g==","shasum":"57e1e79b7ed1f449416700c6b08fa4f79b9dae01","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200115190758.tgz","fileCount":1035,"unpackedSize":4348893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH2PvCRA9TVsSAnZWagAAyw4P/3N8xKCWirPRpVg1vAMv\nPIv9YE5gPSW7o4bXuvFYF1HL+pbmztPyU++238mJit3vD8RZmBT+TmenvBfD\nDid19rN/Tck5NP75twps6rBExmcFS7eszKWoE6iaalLxCIQWQBEtGH8xjyQu\nINoeDN/Hr2/TOKZyV6RVeKC79ziF4RVbcv+8Z2z/I4FVa679PhVvq/0oLkZP\n2lt7hhobhoYPY/Itg1SjLL0SJYh7eNiBef8yM0KhiCld6J0h7OhxTNQTfKWf\nk2+X7ELECye04tY24EiMyGxkKO9c3f7pyn9xVEOGsT2mIx3YeFK4tIzicKw9\nJjuiDrx9OeVVXSxU7OAJ1Hv91H1Jp2+jgwfXRZI8hVLNsS3+9LImNx2Anzx5\ne4bKU65MVfnjbVV4jTEyYPa/YyknHto+RL2STZ7aP5mx63F6yfSFg021ouof\nUUAL/EUlpjuf/HXXI5YpQKUIoynGrkdWvHRRU37sjzGNmRoUnumOMV85YMml\nA+n6yWOU5ySH7jYF/Qjk+fT+SoGyFoAjguYRsBYPyhU/dBNPL6zJzyBY6g1Z\nanoeL/mNk4XlFRxBlDKaH2ZgSh1whLFavWH45h89kJXeLO6Etzvog87dPkUw\nMAHbcioyQPwJ2dx+n7SLED4zIpdyWveaKhpK2k2UUgxxVvOoJYRPVB5WN37K\nEosa\r\n=qtAM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQjxU4S0V4LSywLWZ1beB9l74Sa9O0xQT3wUy/H5TVHwIhAIUbzSqL1ZJ/gbJPsbjeSW7YMukeVgxvWrilmCi+ht21"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200115190758_1579115503047_0.8752926471948788"},"_hasShrinkwrap":false},"2.0.0-remove-index.20200117153458":{"name":"@atomist/automation-client","version":"2.0.0-remove-index.20200117153458","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d853c76ca7585dc9295b892941ea85b5d3e9cdf6","_id":"@atomist/automation-client@2.0.0-remove-index.20200117153458","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UiFbqAL+aUnzZ3yOQnTJUlg3/7ECCHj+Houte0y6dlZi2FOAEZ5mduIHYfKIA2VK+O+KtgPJtIF11vEWraQSig==","shasum":"e201b790f62ad3d631f52fe9f06cff6141243413","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-index.20200117153458.tgz","fileCount":1035,"unpackedSize":4349039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIdUCCRA9TVsSAnZWagAAOA0P/jbyc4e7C8C9PnJx+oss\nnz7sQz7gQRhXHCMLUFcdH84OKXQJ5oBFR8WUwFeOS7OM1blF3uHutfVXtz4y\nYAm1WiQRwAmUCwOnWW2U5kH2l48OVKdqgIQbus9C6B4nT7x0KD4krDVSGHnl\nr+gZwY2Lob8/3TGqlvH8kDpVzJigKAqkv5eDHoxoP0APElqu6Tet1Z+M40tx\noYIO1oVDHdkpMS8j7FN2aBDkyDEb9WkVg854qpXKhxJwtVQJqFyTmy+faWbA\n4ARF49nChiiK/V3eEAoHVvllqZnv3GrnoZlkCWa4Cwv8V5CLkJMY+fSaTW3V\nYGKlCl85ap9H9ODwQHssO2vIJM9Sp79/fBvYU5dvEqxv2kc3MfjreggDBJpN\nqyuexl7FPlriJx4BfSYRaRYdmMm8PLmi53/YM0g3DlVqk/xuvCbYWA0BBIST\n9Pdtb7bhxobQrv/9wTrCG0K+B6XPyNsa2UJwbz/Qyczkyuieo14yHyAhEZ26\nobv7kpYiBMs4exvplCN816LCy4KRa8SBTykXd61h22Z19RsFWCCaf9QpZvjU\nQNdGB8/lfTCWia6YL8o7TNFjPEYYeaVM5WdZf11Qanv1VateL1TPuHGXxeu+\nABqCEvY84ZKRCTIfxxvWDf1awzvOxHbRjg8Ep176tUc1NiYd7MYr/TT23uWt\ndE/b\r\n=nS+Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQO68QnLrqqlQV69sqMTbjWSJhj+9pdzyQZq8oVyPJfQIgM/qdw8RFaxF3I2wt8AkvlOi3qM5t4nHOGViszSnxTh8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-index.20200117153458_1579275521193_0.02432935315131335"},"_hasShrinkwrap":false},"2.0.0-master.20200131200849":{"name":"@atomist/automation-client","version":"2.0.0-master.20200131200849","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d2047a3205b3aa317e4dee477f5e11ee617bf7a7","_id":"@atomist/automation-client@2.0.0-master.20200131200849","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-lVQKfpCMA4QsAVr29zK5TYXJa2Gg7Fn2GOBcu31UzrKW26Je/ktRtASeQ5V8JcgTPZa2njcmtu2HTmElT2FZXQ==","shasum":"933d11b8f572960c3a3b82a51bfb860222bdebe2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200131200849.tgz","fileCount":1030,"unpackedSize":4375104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNIoZCRA9TVsSAnZWagAAEe4P/R3EMJCYC+COJvbVu+8C\nTzaNGTAMQDFtUjL4Ni3PcIUbX37zTgYLLScRNzdWwIh4uQ5fqYpxn/PjCJ45\nd1JpgfDapETG0SmUMfpFQ6loP39L/JmYNkEbAY5DVWzlVJt7yYRcGiphH/y0\nTekJ7uJU0C7PCfe0uZr+7P5yb+tZNe03XP0P/T1rCFsAY3o8M5C31LgY42CE\nQERcQnEaK6GP8h9W0jPxBJWqy0TtlTEoD9iC9/2zMskicoS5gw88lovZaVtF\n9SAo0MUm5eRZtQYbZpJD0PSY2wk6sRDHanvAHQPKcEvQSJ+zJ2BlgRwYB62Z\nZnTeQvDovVCaxremu85MmVa5pi69DQVf3b1Qc+BvYa9x9rou4Oue6oC86fRj\na1zD8mS90/4ZR1aOjaB6rYKv2h+CXbQJT0qWQ5d5GkhwOdmmahAEHJDwGyGZ\nByMSyjNilYaHGJ3wNdhyIZM7d0DH5/FeclYmgjeAyMAU7VxB+cw4+waNTKCG\n0M3g6sCEg6Qp9sN6nnJjLv8mSdxmE3AOOMTQA2GVi0jWXKZp2lYm0rtkIBxc\nwyewR7xMPrCxy2oueDcMbBWfd0+o+MT75pWNbUH7ATFR7xtkn+J6HDa5DGhr\nuuwsCStpMJPJgHdj+dXO008ExDpn1L5qp+BWECleL6seRuSf0Qt2TvRMdj0E\nYO5J\r\n=+5WY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmXw9YG1l+ZJgf5rq3LXk7FG85guy0JFla/PyySWbL1gIhAPSebXZc7F/GHN24hg9+l1ThEc+0HcJPWgllBvwX4aCw"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200131200849_1580501528890_0.6588413194900999"},"_hasShrinkwrap":false},"2.0.0-master.20200131202342":{"name":"@atomist/automation-client","version":"2.0.0-master.20200131202342","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9e91a71cc00201c3f84658ceedb2b7f3db113273","_id":"@atomist/automation-client@2.0.0-master.20200131202342","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-IZeikl0h3n0KHXRYY1TDJam82NM0GbHjL8dLuexnqSjAvKAkFXWdX6L5vUM46CIYLsYtzg0/cF5dJsiZ1wYfGQ==","shasum":"8e6f8fb66d2294085105dcfe99a75a6890cb9aa5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200131202342.tgz","fileCount":1030,"unpackedSize":4375065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNI2yCRA9TVsSAnZWagAABgAP/3KuXth952ZlI4b63wAq\nXbggcI5d6OGcKHaLFODTdEsOdJtwIDaM2brTF5DwFxIcqYqY97GLcKr9o+81\nrv7TfOxsM6DRt0BR4510Z0rK/DQ1uRIi1P2S8oiafe/UvPofsm6jfNc3PDWa\nsIQE1Q/CNvknOUalqBJVP09Uhd6Ov9dOddDscETwDT7XWzwuxWW3RorTHC0K\nMzLFcV1FmSyycaCYT86R/LB5kMNDIHjSMsEH9paF2gdAfQfP3+XjpEEdbwLi\nWjVcfNfNOLCPAcwy3scd3btps0PoyIxlyoM4kqvfR57PJIdDSX0QcwTAfNaS\nfXIetCda9lL5vyWsNr+Dt2fX566VTrtfSDuEFOn5RiqTA5GeiZ7Vq3aBfrT9\n9kQ/ErBluLdvUcA2XliOz5ByT4twhz4InZ1vnZdChRgmu8HI49FPMmvu4/1H\ngNcHHaOI/3zv2lkPSrBjeP9es8L/USmbQF/bPKV6fhGf133du8CoG2A11SDt\nov793ZyIqEIPYvUwVU1NQOAR0JAlFh6EF1PcgML2xADaXxhmAeuRS0LaXWzN\nc0wTMmBv6eUHdNec8hjWt/t1kR13tsX+Jc2rSd1EPMI7mTDimTfCidIJ/+97\n1mEX9buPQTn33UUdmU+/qw4ul8u5tp/Z9LnndMoLtiLh1HFr6u3uByfa3L8h\nSeMf\r\n=QIVn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkexN9JXw257yM/bVjbbGPdSqm0ls3dLbJqCOKcrgH2AIhAJTHyiKOzU7ruGMKUiJzt0BNz6ywG2ObphYh52jMb1Ua"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200131202342_1580502449633_0.015715820508334977"},"_hasShrinkwrap":false},"2.0.0-async-await.20200201095427":{"name":"@atomist/automation-client","version":"2.0.0-async-await.20200201095427","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9955de99c4930767211cbf419e293f6c9d961a5b","_id":"@atomist/automation-client@2.0.0-async-await.20200201095427","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-EUh3SOGNq8MTaANLtzxQhHHp54b+e1NbFcUj60BJMgJCJOC6+1uXNoS46dpP0+FjRLB0tFyDj3cLdUTBau3wGg==","shasum":"65139afd4130b53ebd1f03a65491fc73f3c65ea2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-async-await.20200201095427.tgz","fileCount":1030,"unpackedSize":4375915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNUuPCRA9TVsSAnZWagAAmrQP/ibtDnPa9YOp3M4d9RIh\nd6W8KQelfGFP5oS/OzdhA1IZDYiQOwefbBvGwoE0WKV4jEfCDf7HiZ+NXJHL\nCefkx7dMFYRZjidERXp4EJulXW/cHMrS9Lrj1m7H2zBYOR/UVv3aZ9Ud0+oS\nB+qpg7ClQOru/0sbFoj9uqsthSVo/FwDImNHbENZCKWwKDc0NvzH/4zAQIJD\nM0VBjIWFYFc9LRouFGjOI0RIMdSfB4XFx02vUyKCT0dNibeqJa4QO+S4S/PE\nAFOEn1Zj6PjcMs094EpWVTJVTiqt+RBKuHnnSgXzXHRNHc+vMSOOPSRvsvW+\n3KmP8qunCCpYiri2ROI1B9uwIEssjldUzhsGr0+4514pBedy4209u8kZZ6L8\nSLfHed1eCFZTYLtrIPSxVvKSlpTIR7ypDTcfZk+Jbt421CDFh/koOly/yZ/V\n4K5fpdCdMWlMwv3nI8lxyv3D69rrt+3bFfq1ocZQEQ9vJKH2a25n1z6KZ2hP\n9J5SC7zAFfxejn32hmCidcoLjy5h0Tz+UCN4pwzFOx3n2fRE3sn37KpR/KKk\nQXmgDF+9dkTZeIfJ5fvPGrPNLKRJE7wAVwRGGfL9Gdvd5G3L7KMwBhOP6Rs4\nI9vucT6koLvYTto7wZKtobSNTic46ghiALhU+XKb8Ld4j7r82NBVEJA78gGX\n0phT\r\n=EEeZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC74X16zuiFlColMHlTFteZotKEVMg5kAKo+zFolCt21wIhAK5q9p8EP5Nag6yo/3goa1S1rId+XyPo6fj7mvtau7PQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-async-await.20200201095427_1580551054581_0.9136708694742832"},"_hasShrinkwrap":false},"2.0.0-master.20200205110916":{"name":"@atomist/automation-client","version":"2.0.0-master.20200205110916","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8a7a5d5de01d1be070c1281cb8d0c7c99072a3f2","_id":"@atomist/automation-client@2.0.0-master.20200205110916","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-T59apP+SKct0WcDd9YW2GkNCXNeJLAWxtOUvVm+VfXXLEamsYatHsu8BE76HChFz7qWmT2e7h/EFP7tIGWEIjA==","shasum":"25d016bdedcbde30d60cc25c5456cf70714648d8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200205110916.tgz","fileCount":1030,"unpackedSize":4375755,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOqM3CRA9TVsSAnZWagAAlmAP/1LfICwzhmLsHhogTP0s\n7ArGCfRRt6nPkdj2A5K+TWiQnXKbjDqeuHj31A9XLtsIO+37aCtkONLFFk+J\nhBkEAAjTp8+ZWBBMhcAp/r/LK6zYsrE0gQOnrItt9dZRaBcxDfsUDnpiJmtt\nreUQXMX5P0SfHwsM0/fL/LZ0Fe+vuDGBKsIwB5iGY1M7xGbi79/SfLdG1P/4\nChZugb3A0kFHKqAP6K4faIH9prTsGbx+Tc8yXVN7RDF3mTWOdpVmvOOS3dCc\nJ7DzlNghu2b/8E7QWi7VcYE/nYYcxTQeNSd12e8XwhNHd5Qxwk41z0E3cuMW\nqOscEs2N2aO00BnHnWYcMXBZ+G5sjnX6or46+3SJXsMBv5zhm/guLuUvSyad\ngSTYRG/jCPWKfu3jIx0AeTpAiO2oBhktOtxkTsFw+3BsOfLir8g7noHPCdyS\nt+n4t7qblJrtMGYjnMsVGxCftHLqw5PRIZTzUU7mHAOxmlBnEHeFB8/fS9ZI\ngG7v9QWPFdL5ijMgx1tHOrC+Q/iH7LEmMfzyriAUXUousIe0PFAup50usLj9\nuJq5wS3ld9EfFrBNyMWj+bc/a73EUiFMds5Xv3hMnBpHXs5SuyvO2r+NDcGh\ntaEJAvl5q2Oj1ogcuIRU+FHjfHDSAsovCvvcp14TooVf68ptze7HoN/zHU47\n8gwN\r\n=tmQF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGklLMRnSEfZXk3py4algmbs5kgiwx2vofNGt7iYiIpAiEAlaPKH8FMT/q+wqXVLmASqbwMEzWmaldCiHa3I3k9he4="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200205110916_1580901175423_0.44838503840309496"},"_hasShrinkwrap":false},"2.0.0-master.20200205123830":{"name":"@atomist/automation-client","version":"2.0.0-master.20200205123830","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0c6a1d1e0cca2eb784a22561e1737df22d5514ad","_id":"@atomist/automation-client@2.0.0-master.20200205123830","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-5tXwbhg/MnBzbMiWepBJQYTtTK2eFNImdlqYggZZ4zGMe2xBWzTC5M7yPUOHj65Z/YbNU1CQM3nBGI58SKK5pg==","shasum":"d6595279bef1bc9d40b00b0d5831108e6c840c31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200205123830.tgz","fileCount":1030,"unpackedSize":4376376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOrgYCRA9TVsSAnZWagAA7p0P/3iinolB7UH+0FTMcMdg\nGSUEgvvifVJXOTd5AchoO31Q00Wj8dwOo+Qvo7EkpYX85usrPxSh/vzR19ZX\nqvUdeUntgPqob+v8xBs2jMtbZno4EWkloCqH1ep9PFnb0quM8gBwZ3b10tk0\n0OTUEc4H+k10x9XuvtzYUlmruolj2k5le5cjnlWtq/+4xON3998Cam9He2Cl\neomKE2sRrGfsdESDtixG634n2t3EPdURkcCSqvBtbpnA55V+1XbeDv0LpJoc\nwUJDOkVcl8HmDlRoNGtjmHeZs5nqCOeFNxBQfiGzAWxRIqZQg6sPH/jmAO/O\nbS1yngTPrYM4NUcQ81uu5YeRCbcGmmQKyRBZmMXYacYOatOppQd57zlTsx6a\nl03jySwtsOwAeL6zUF/E0/LoAuXgYqhlv5hc+JwKxsEfH3eK2uht/Rml2yNk\nmVmNT9Cbq0DonPsRjlTKgbtk768RU2+CQ9T7eE0tEXQzrApLB73ccKDvk9/K\np19GELr6lm70YVki/+sWy6aGvp+GbIZoF69f4BQ25ItZFz9IrJcZN3WsWYtp\nTePz/jzfFysi5bMmag0rcgxHURemwMjglxzOFdcNy7yoGFMc+rZo7rvREDnZ\neyc8+QK62oJ3/Awg/XPcs+A6Gl2BsH/35HmsexBTHWGbSF3qPf4FuanmOSNb\nDFPL\r\n=Pn+D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWrrXg20qtKpfvZycAkEOGCEpjLYjfbrf5t/fHROAnMgIhAPNXtUpJRlgUL6KNi75coh7/j5gLdmIVVi+f3r/kcV3m"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200205123830_1580906519825_0.8968513646297529"},"_hasShrinkwrap":false},"2.0.0-master.20200205130055":{"name":"@atomist/automation-client","version":"2.0.0-master.20200205130055","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"42cd71c546ed3919b259d16e61e71e7f3d56f793","_id":"@atomist/automation-client@2.0.0-master.20200205130055","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-T3GoK9vnxxhramGqTbEnAqTdBC/8802XqNBf+LBDShDm3QVhZLFnpeNGV8TNvJ8hyhY0VwGYEkud0Vz+QCeqWQ==","shasum":"5fdcce15d7206086358044028372e6a3427e176c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200205130055.tgz","fileCount":1030,"unpackedSize":4376372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOr1aCRA9TVsSAnZWagAAuswP/1ZeJ6l5IbzFMS67Dgq2\nkfhi8Q6D5nt4sJczSULsGnfbCHY41Aky3U4s320gnCgfzqIFg5GtBPRMul5y\nl3nym8PW3/1VIbLwRqwuzId+VSwO6/G4eB0x3ectn2WMIKAAZaZ4xgXWCGx+\n7t/VNtPclVcKvvoEVUCJHM+xV/oRjGaHkOzQ/surje27ZG3aBL/JV69/LZc1\nHNBRjAT2DGflexJDBvWIPBmmJJRV9h6VN0PuQPzvmxN1BsAfz+As6XtKhGfM\n8u1YrwFTqon2iL03TI1hgxcpE+DU79TzrsZcptFgDoMxDx1BNHh9lRZiR2Gh\nN7XO1RWNC0lztvJoetNj70heg4iCiBTyiJpIrZiyzJkarGpl/WX1vAEIiRjK\nLRplzi6p7y1U9GcHAXgLWhgdewgKWAP5iVTR7IJ8iMoKe1msjV3pyDaM49KY\nLElE8tEm6BvQDLZAiL5DA/aoeO/LXMGL4MWwYUyhuZkR/zsQBr3yFvGZqa9c\n/4V0Aj0Kh4dhE8wNHal5lW7YiN5aqx1bTfBXplv0UZ3gUCCFFJiXvL+Dtlqz\nJ95oEcM9Fzv76ja1+D48QsfFW4Qz6Bw8swQeuOAog0rgF4xHcOvuIjB8M4qB\nuarHEmR0UqaFAvnf/gd+gx4kVC7MwzlC+4t10/7LvNfsUXBFDPqv42LNjf6o\ntyhb\r\n=ka2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChKJ+SLMl5lfBEx5MKbVvK7zIKHZbWoBWyT5MpuEijAwIgcDELmOcLKGrQ+FHTW78lBxX6jMy5QIwiHWzrT1Ihh1I="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200205130055_1580907866097_0.06816757998092071"},"_hasShrinkwrap":false},"2.0.0-master.20200210222816":{"name":"@atomist/automation-client","version":"2.0.0-master.20200210222816","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5b43b968067206df081791d3cca6456eeebeeadf","_id":"@atomist/automation-client@2.0.0-master.20200210222816","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rBf2ehcDxHRXJHncAa8RbTYr4baDgz2Zg3fLMjyLoJWe+c2P4gBv5nkk4PxoAPHYMqGkMCsD8S8LJoPzlqApvA==","shasum":"cb17b0ca5b2b85cb3ec7c87fc99fd131d4a18be5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200210222816.tgz","fileCount":1030,"unpackedSize":4375954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQdnvCRA9TVsSAnZWagAAppQQAJsu9zLLCGy5aJ7LHpa6\nc5iNfBiG5w419hruIx4tiprfhIcBHRqwiUdwZhvVosDlAfWDEuz3A1GR1zpe\nblZV6RgwfCXmd9llKMazrk+ImO+54gXcsTqdhW92ay4PicQEEPmGNvWqTmlX\nwSKE99Svd/lmySWO2XvlyqtPhxZHZFXJ/yEuyY5RxoS1YE4DldFbsyrNv4Go\nUpwwQGNCjinhJ+A/XnQN1IngfdR9O/bun2amHyHNmoAcAIjSRG5sfEyydIep\nP4un4OcEeKlSSOwnfl0236cBjEn6n9yiPmYqEnU8ZALkSNKIqq+bTB0e9gdR\nG8HacGBV3ki07c4AyjL8Zk3KFI9eWob+wFpQ59EfUgTQixApbu48ILKsKREf\nnQREeHWyJEfG1I4dpdUYpnW3Rehotu2ePKeDP81p6vKu02L8Yr87Qjpyk2WF\ny2I/sFfd4EAQV/sYvoJqXAzt4dFGwmpPCem6n5ue2tuCgMeim9fGgJ2wfCmj\nI8HgYMEt9B7Qu2jhuw6xYerg6jj5V0c8j0U+vuSs9fpfm7XTE1Vix9Lttvwx\nU+no2k69yyb617KLffXO7IaD67e//ahcOcvp2XaVe8stJi7uu15bERYbItrj\nLPopb5Ml7bNTsbFbI9hAKHYVUD9aCIVZN1ZDfGmMpgv7OO9cLbwou4sWldT7\nQA72\r\n=DfQO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrPgnJlW/ukgkCr9GI4uanNc+mW5wyJkOWn7rbHsVRAwIhAPz7v9s5xYxRuZRTtI5u3wQv3t82RIdbBy3YZdG40OZN"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200210222816_1581373934435_0.7147607547093069"},"_hasShrinkwrap":false},"1.8.1-1.8.1-fixes.20200210224823":{"name":"@atomist/automation-client","version":"1.8.1-1.8.1-fixes.20200210224823","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9cb2f9e65baf623b9cf7970f132cc5b613f263f0","_id":"@atomist/automation-client@1.8.1-1.8.1-fixes.20200210224823","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-qDysm7RSp0KN+CBfq1oMZ0OoYvmogCi7pVNyoJVYuuTL3Z0OKo0p90v6P4We9DRslAD62l3babbQ9YNJVqSTfw==","shasum":"30e7c797fbe8365882805f335e10e9b187513205","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.1-1.8.1-fixes.20200210224823.tgz","fileCount":1040,"unpackedSize":4377855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQd6kCRA9TVsSAnZWagAA4SoP/AwINs2KDAgWbep+zChg\nfpS///fZB4iCyCJeXglVzHyDAGsMa/X1eesmG33tCLDor+RchPqpJN7TZTrq\nGdAwycNIJTloC5s4n3wJSZJ+2fwfsjVm1WEhgtbd9X78fRuwAXnN4iiVzcYB\nX1Zvbpd4FXZDz8K9QMOUNYs/AqyoeaoYWgqLPwX8cryYKMw7B1eyEpRdbSVD\nbez0bMp2ov/aTVRXSNA1TyhBN3vpFwzi2gS+vsYeMvHZb1be3g/6hpyB2+i5\nELlh6vmVnOmGgRJHEEe90Zb0wa7yhlLah/3vMm3T6mM0+dy78XKHsq+A3oes\nn8VjBzoFZvowNoXIQH/khbBjcU+wcdvGTkJCE4wIRP7a9O3VohovQJgi0V3d\npwnnJ46/HUtmF2PCkYGzpYXhPNiJFwlBitu2jbKr6SPAZedhTAeE99V05eav\nHv63uOtHoALSby/ezHW0DboED6Qip/EG5zteAZ/te9vBKNZYIDduLj9rzjnu\n8JDKEkcyUos6juKRKIDNcATjMbWPmcWEZokSbhvuLMdcVIFgSzA8I0uhtIXB\nlEU8GGYJCn5AwpAo6lufA/ZnL2JFhxdAqRcEVeigzYIEI4Lb9zrekMCBC8dD\nQzGPW6/KBKapnssEbxSrAqRePGWc0EJ1Dk5MnofjIcH6YTIO7pbFsoQzuIKu\n0PX7\r\n=JDhD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2zcC0KQSqCJnnK9wpn5xxSEjaqBjBciUMB+B0uNgC1AIgPBIAIZVdtpn7O7XvzQOZ81B82wNST+Ic6iI9rUzm1p0="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.1-1.8.1-fixes.20200210224823_1581375140304_0.504063596151376"},"_hasShrinkwrap":false},"2.0.0-master.20200215205055":{"name":"@atomist/automation-client","version":"2.0.0-master.20200215205055","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5e93982c974fe6eaef1c0ae74148030f3a32b6dc","_id":"@atomist/automation-client@2.0.0-master.20200215205055","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-XRFb1XIIatbC1u0QVxzpO4QuEgFR0sdZRi9rqObDlPUD1k8mL+R6NX5rhImG41viBXroP6ipnRhsCtIN4/cvpQ==","shasum":"b06c47fff4e1ef876909c3fc3de86458f76542b1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200215205055.tgz","fileCount":1030,"unpackedSize":4375954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSFp8CRA9TVsSAnZWagAA9PYP/0vz5uxHVLvLg7tMh1P/\npZd+SgbVMTQnyOGi3mMGvpAFmPYDaJDH+0mj5kVquXZN8qMx6dtFHtagR+PL\nwVV0Y+O4tXq5g81Jg/7tUKFt6wqb0ZP8Dkc67O+VC7le2uoJhHqS7IP4XKs/\n1K0ITE5od1TKUwXzKgu8AogBintXJO3sUQNqhdMlZSUHAdE7jYwQbeh0lHpM\nYysCgS57cB8byTwN0xaLj0HB8vRp+oL1h+XEYwfpAHg7XHC+p5ZGvBCBS5Lo\n827lzwRB9aZrJhdRfB5NbS9ZY/IwHKskTeRGIisR/zqwsbEU+MEyexrAMOpR\n797DN9ggWL9EtZTQKEuDYsQx6g/tgDu5MazuwEexz+wCz6FjfZNrH4le/P9C\n7PvWJktmRwNdxLxPtd1LnuGJ3SKEqMvyLtt/AaKBD/LyBXJ1fJDmvmNJDJGL\nEkLxx5PT4+Dhc8yQ0+es92KdeacgBWkS6Y6hB8+XsNaIWpVbXhOHWa+akQp1\nbq2i9VuXPLXd954Sf2iIdSj6YfIi7kTwrt2SMNgCT9Z3C7IHgw8mS94/HSvb\np3/V8ldyrK140cidjpxYSXtQd6JeoSvEd6njhyyouMz6WPNRwYm3ctY+4O8Z\nfoP4sd4d7007HegBLap2Gcyqrx+iXg/w7F9hIUMjQowZb2uV6r6u+ZMJ/2DP\nrKaJ\r\n=HV8S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHe2MKaRRHbMGXnNfJ7clcg8Smace03udwtKO5qeSQVmAiAfdkDu4Qyn9ZsqmSy2vf+U1IDWcdOO7Dcyg7NT9w5L0w=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200215205055_1581800059418_0.3776395523697802"},"_hasShrinkwrap":false},"2.0.0-master.20200223145329":{"name":"@atomist/automation-client","version":"2.0.0-master.20200223145329","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3cdc5a5d8cf1686d30e7c33b82a03c282576b310","_id":"@atomist/automation-client@2.0.0-master.20200223145329","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-sP5q46cMmMeGF8xfrRLJYwC77Z8FV66yaQGz1qEr0vTBpQTuSZJw4g6yZKr3c2buaYAgTYRhDZGAb6gUNAV/JQ==","shasum":"cd4227a4ea4e736d1da485eb3aa907a17ee1118b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200223145329.tgz","fileCount":1030,"unpackedSize":4375953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUpK2CRA9TVsSAnZWagAAHSQP/0fNUHawy7so7Ub6XRI6\nvXwW0LFHKvnhJutHdFi05rAmPoVAnc29u3TAH3hTLBDQV5OXVvKYNfaTexXX\nbpVvWVnjCKGtuaqJ4TWsZylYzCm3tCK9fW6MOTpLo6JpoFaTvO8cNyn/S6YU\nIqFcXELmsQ8Dypq0ehtfzOrX2dDoI6mHSiD3hN/sqXahd5mhrp3dNAlWAUjy\nXE1t6ECw/ZYsEC9tWa2as6HtQ0SnONPcDcEJ1tHSNITCooBBuZXQBQ2ggw4Y\nnxWWNzgNYmek7OpeIQ8uwDrKyN1ozCXyagEE3JGtDxQSTSBT5CEPg5M2FtZi\nzNawOOZvNVkO34A366utVLv7ZMkIiu//MHZK3GG3MIwFY/4yZmyzmnEvDBGc\njJMD4AGl5+LP859CI36ovB1Eb4CzseSvyUgQJbe/SYmMdZAKd/hbqXcvVOWR\nesZ70OETLTld84DeNCwa/p6RZXkoa/EWLT8BoRi1r5MANkkFcsXcXZjYTjQM\ngejzKIvqwAz3H3wN6VgU1/1E3R8Na5lxYpvye8/DoxUnnhAItweh7eyzNtWE\nlS86SS2dRa6Tf5YXuhqu8oaMx5f7T7SgUCWKqkyYtFmT3Xie/xIsJnqyrcH2\nKmFKHeiudzg7/hthn335yY1awvznHf2Tj9DCM90l8BJnMe5t/kFWCRy/mxxB\nN9Y+\r\n=gOoM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmoBX4ll9Ne2QB3PINS7o7mDZ1PjFWfdoH+dM7GQgXiAIgER/FRGtcRBZ+bGGCy9kxMQ5aXZMhGsiTKoRAwlpFxAU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200223145329_1582469814104_0.6453360013814522"},"_hasShrinkwrap":false},"2.0.0-master.20200227092607":{"name":"@atomist/automation-client","version":"2.0.0-master.20200227092607","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c550d53eba557c20e7d13c2b73a58d1f53523af3","_id":"@atomist/automation-client@2.0.0-master.20200227092607","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-GRnyRSSjmncDpn+4K2l8+JMHDQKigUO92k/zDeroLDzNxUV+HkOIyyrbulJjxn8FJPrKla6MKHQT/gvIP8n5XQ==","shasum":"89966c53139118fec268094084069cbe81c8f1ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200227092607.tgz","fileCount":1030,"unpackedSize":4376118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeV4wGCRA9TVsSAnZWagAAqaMQAJRatuIiSCV6Rr6ujeMO\nf+aM/KhhpJUlnDJpQ02o0895MmDOflpIQ1o75oYEZJJ/0jFLhf3azPtbdNTf\nbbjh6GGLbGtbpI4OMQD/YDmJZDrBKp2Y+UdeejRmM/BTwJO3N1Jfcls9ZXXk\nzPVKbAJmltTBZFegmGHNZHzDIsYfVSTcTVxZ+lJCnRQK1gKZIvPKlwBuA+ys\nqKNRZuUGl9fxbt52/AEc60hEopq0gdCja6hCWYz4A269Zo9qEdfoYpW92/CW\nEhCTHMz78WXeitDoqIClHs88caKeVZRO6VcnX8GYyJjUmmQxqxug7bpCmtH7\nUk0C3vXcejBZZhgy3md/Zi1g1riuoZfPgtoJfObIoYParzzibUJE1DowQagb\nygF88oo7SQkZM/FMNQSC1u+RvqaNMdIDfewa+ftj1w/YWKh2iEGcqK9mmxCv\n25UVvpRwundSCmxE5Pz2DS2C+zWwozFhiiQRT55yIDVUTCEpBadMItfjy/Hh\nhM5yvAINh4jMEaaxi9u/VwIyyIryVCbzCo3DVfXD2o25oX02oIJyHSVaJ42J\ngBDyc+eepzgZWOrSsl0B2Q1BWmuoaL7kEVudecq5kfQ39j6GaSERaCoCBozO\nENQ/EXv5w+A4N5Kk6f2t3zk/kBG10VyyqJ9xcqOtBfVY1h8XAkpIZHzy8EWl\n6h3X\r\n=unU4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4clK60KOkSerPkPcHcLYDaLiSryIA3iTS50LU4ojlDwIhALWSMY/RS2ZPmnC+du4DLr9eis9kgcJMMifD8nwE/wuQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200227092607_1582795781576_0.5130830023808606"},"_hasShrinkwrap":false},"2.0.0-master.20200227093410":{"name":"@atomist/automation-client","version":"2.0.0-master.20200227093410","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4e8aacc927fb71ace6af49935a9d221252a49e66","_id":"@atomist/automation-client@2.0.0-master.20200227093410","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-s7uBapWWvWdIaZLmebKFbCPddpFakV0mFT740/IWhx2XfhO00GTUoR8fRF7SkwFmBf3swFt5aZ10k5dpBUiM+Q==","shasum":"89590124b15df8c53279c2b7f6c469d666dc7403","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200227093410.tgz","fileCount":1030,"unpackedSize":4376180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeV43rCRA9TVsSAnZWagAAAe4P/RWsFoHl+u+0jbSZRBft\nsld7AAEW/qyg2wey+MjWrTaZlSakSb2s/Etwlje33Gw36youOehLqibHX0A7\ni3G3adEZIuv7OwxQZrhBmdylQ+9sbzQNlNX9IQcTT0blfSxZvKjNX4wknhxO\nahurxRbhoMAYtH+CEsjZro1qNZ08F4vhavc9W7kRFPzmOzFf5Yd3FFpepGLX\n9lmFTit2tL/aKzlyjdFGM+V42EQ7VADpPOo72xxB/6Du2jDrHAAzqZHDTa8n\no8jc4MDSm7WpjtGdmiGakCSTlF/swL4Oy5LsMRGzX25NjhcWWjC73dUnNqRH\nfbefgc9DYTtT81pMIS4yi6FrPPPv2G86Qc96mu/xi8JIolBiF/RRqycR4ZGS\nVjKIeMj/OsQBsZjZV68JmgcItbvB/qKpMwKUogfTjgtODZZBey7t4knaklqU\nICs60r6HfvdHWqG79gmewyRrFJYZNgZ4fW0rNcbhJa6c+HCzMxqHhMIKpl7G\njQRKs+rXVnnNWoLd57mDg5Oz8H/Nh4eQzJ34JLl5BnvaHq2fFeQ5A8++hDG7\nWzlHwTZx32p2E4Bc5wlnaa14V103EAp+EeL+XDVnw2ycj1ppaH/gjCR19MC+\nPSChhJOJajjQe1gQTWaigoSwpyTyuM4HxE0uZOG5q9200YBSjp8JAvIVwejp\nOSr5\r\n=xczZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVAx/VAsf+HrZFuCB65zS5ppjsWxhEjuM1paftMzOJvAiEAqExG7ESd3vRq9ZTEOeeO+khHtYImnlZoDhoUrT9L2uw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200227093410_1582796267519_0.619429261873524"},"_hasShrinkwrap":false},"1.8.1":{"name":"@atomist/automation-client","version":"1.8.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.1","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"_id":"@atomist/automation-client@1.8.1","_nodeVersion":"13.2.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-QMi6wfToEx/N5B1e6ZJHvDFGg+m0P3M52C6wm2MayJHGBxnUhWnX76PKoCZJHJz0csHisffRnhFExiiOm+OsYQ==","shasum":"016a070aea8d0c8f93029a8107b8dc0f320dc14c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.1.tgz","fileCount":1040,"unpackedSize":4377828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXXYzCRA9TVsSAnZWagAADnQQAJzlSaYXrbk1UJgtW4hm\nyBOaD+Tv92DFOwpMTsSK9lT9ajtqD16T4rypEvhrNxR6uOCQNtQRv4OpWVox\ngFDt5+uKRSa5Rjo2SF+oRgGzEIVuBKc1j/IvTfo4DCjzEtNc9gfIn0zf8sWH\nV4mxmdU8Ct2iuVjx2KbvG5BIwkFxcYAWBuFqDOMK+Jh38EymWYzNMqfCnFMX\nWkCF9ulV1Q3MN/frecOJe9oLPFwrhvFGq0Hzlqc14a7OhC6W12ATZ3YO7DGS\nyaZ9ksvpLFpEunqR3dd2i3SXBQ/GraON0LCUbyRv3DUNXBHAEeToWPGH6TyP\n+fx5D3aaOf/4rJKSBCn/NsamrpeXjb49Q/Tv7XVmE7hNgq8l9M4p8MdAlN+k\ncUhEXJ2yGeYXEoPyU2n+V0XcN0B9ztL0MyXA55T6JoKNinaJF8QWeL2Pz898\n4eJUaEmNYGMOvMRVeon+UDOSJxX9W+MFpJPTTC2aKPraWTgiRdSthFLhiEft\np/uQEhmbFgtRmJMedTnRFVzkPmoF31oPDZMsZ3AU3jNL0YAyDyHRq65GSey0\n8GyJZ0x5qO4o/cv3eXWHnhvZ2znd7VvR2x20WHc9vYcc9JSj67Ha2MqyAtdN\noJcQNjkiLEizbcB2LEb0BBL70WG/AmlxBRakMWYu1ShByF3MnV5T0IffYzdO\noMiA\r\n=0sDY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBupdQWdBZ62FUZ+A+Ep0ogFXesmA7n+SsBYU8lpmD7PAiBJ91cTqOOtlGIT7enjqHeLP7j+R/dYBEr9GmOb7yzaEg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.1_1583183410846_0.40685423279760147"},"_hasShrinkwrap":false},"1.8.2-1.8-fixes.20200302211422":{"name":"@atomist/automation-client","version":"1.8.2-1.8-fixes.20200302211422","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1b9a79885f8ffd61342a337dd0d2ad3f3809aebe","_id":"@atomist/automation-client@1.8.2-1.8-fixes.20200302211422","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-zsE6XECtS362b1X2p3tXHLKugbt0v2N/9YkZ3bN+1aY6pkyX/doch1EP/ep3tQUT1wI6aRTodWEx4kFd9w9l4A==","shasum":"71906aba1993a3b6fdd5a0ab7597759346a24fed","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.2-1.8-fixes.20200302211422.tgz","fileCount":1040,"unpackedSize":4378085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXXgrCRA9TVsSAnZWagAA1uYP/2qYMtCRlKTUxwpjBfq8\nrog+hf+wqhuMjK9H6RC8qjrh2m8J/wBm5E80LCpNv6aRWSurNApexFWkq+CY\nEKQgQpUuVn/VnQ5cdJE9YfaR6B+a/nedPAjJTXOmvx1RIuWzchKLoNEFt3Ge\nSBQIdnDv/j49qstBAupJTdWlOSKzYiSMgR17L+gPD6grxw+0+uE8YHfWkJb7\nqXLo3kW3ibEcS+QH0X3LdtLzU/w2UXhPQ7mxCLcHrFf2i1dT9LT2AMmxAiPK\nMrIAg0Y/eCN3Sk5N6MmT45CewPjsoOWc3IoBSsXQUcZtR1Q4JyAcQME6KRHm\nHvFhVwok8qWFJI0muacHdEog483gduQ4ip4lZOnzH2xaQaIoZz4KWHyxl5u+\no+C14PkWZ1c5ZELsK2x5wiOY8E1nQEZ7sqWbn6rQHvZkWN2NLwLGNGy4Gyxj\nquba+yrxuZRKEDt80WX2mjnbufopmgiudecsQmBEfWboOyeMENvJNjbvwDJh\nGhTkmnVoqFLcFfTNsbGrzBFeXBx48EymuZyl0cwXPz2/AXmHW+4SnZPImEZY\nZnQ7WX7i7HrvoC10pzreFkjH4Yd2lmZ0plHV8ss4pC5Bk37FdfPJuwbJLnYz\nlah/8mdy4AfXcBkGkyLLbOadgTx0MYgUTUOS1yjV0RAcvMxV8RWAVPUvsZfM\nS+YA\r\n=+OUw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9xMYHsFS6fmUltXYSqnx+7vvVQ2GN0W3Tgn6NL8onCAIhAJTaKrL6OCGXYwCNAAaEIP9B9YDKrMMIjZBWyrwAqDop"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.2-1.8-fixes.20200302211422_1583183914759_0.24519713133382526"},"_hasShrinkwrap":false},"1.8.2-1.8-fixes.20200302211521":{"name":"@atomist/automation-client","version":"1.8.2-1.8-fixes.20200302211521","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"^3.1.0","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1b9a79885f8ffd61342a337dd0d2ad3f3809aebe","_id":"@atomist/automation-client@1.8.2-1.8-fixes.20200302211521","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-VxcPmKFDd4xyoflrZrCk5MIXnmoPrAuwv1J/mU50F/vIQU/qgQGCvE1wK6dF3efmrUKRdzocu1JlPIM8qP1aYA==","shasum":"ca4bc1a25d3df54b47e06c4241a4f83ddc67ab60","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.2-1.8-fixes.20200302211521.tgz","fileCount":1040,"unpackedSize":4378085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXXhkCRA9TVsSAnZWagAAUesP/3hGtteTVF3SP6LudEWi\nr3GGrYmFTwM4vfsF/eOs2gu4Aq7K8kZiaHAXR4vsnJ5H1rIWGuorya2mZubN\nwc53w1Lex/Drk/o2Hc9MtVIXdR5A1dF/eQpYdbUKpqpurz1drhdH0A3NW1Ai\nWbQEnu+cOK3OXB+ZkF4NQnkSJ57Q3qjNdVilHKDDZrpnb5C5SsXopmHed372\n1Rwkq3WAj5a1J7j3KcHVNhbWflhUXAW5w3KacoibJVkzqvJSeGqXyBa8Gihg\nOn2c+jpnBnw3sUupQGegu8iapjuQrOMpMo2YVRG6hM4SHTsT9vG+/xP7ou7L\nIta0+JLCwUn2xheOoz27X6wVR/Uv56cqQ8SRBwRzH3pMwm2HxtpzU4Mj0dRW\nQ0XgGtlrCGaTwwHBo/FLOBhPEZw96C+7vu8SXjf9GAwNI4AuYT6+0i1fz25m\nQ6PwyOYS0WwuaPQmQlLPwd/zR7yjYcDuhnZZdUVSFCETsWJ6LDCJr7ThQUNY\nc99Y021ZkVlsmEYcSOgK7+WmE7O+x88FB0LeEp4W4Q7KzTE8n9dPyl0A3bqS\n08lb5v7srDMnQkJEi3ZD4co/OhrK4XeUOMKhLH5t9EzCYOk0+w8Gs6jB9B50\nwk+UQrgEGJFvZF2gvjPyzqSXYSHrHjVSCkh24EpUeV5wuwMboiWe8euhvaLS\nv0YG\r\n=Psmh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfkQLG/n2W18G2bgY8aPw37z2NvvLeJlCMhfczjUToiwIhAJZTgE95GbIJ11K+DNf51igx2DBDRA8nFUmvDGNSKwDT"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.2-1.8-fixes.20200302211521_1583183972252_0.25904513469200197"},"_hasShrinkwrap":false},"1.8.2-1.8-fixes.20200302215501":{"name":"@atomist/automation-client","version":"1.8.2-1.8-fixes.20200302215501","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bb37198ce8c93abd025a94e4080e6f20eea2a7f4","_id":"@atomist/automation-client@1.8.2-1.8-fixes.20200302215501","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-wDpkYTcYrBns36axl7++XJkGjS5UvnB7aQaEdkoHwpHlnbhsE8a2Ffgy2vfJ39Xzll7H70iWjhn5X5PwxQYlcg==","shasum":"5e70e182d5184abf8fd7ab28d2ddf2a7e2db2a47","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.2-1.8-fixes.20200302215501.tgz","fileCount":1040,"unpackedSize":4607490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXYGWCRA9TVsSAnZWagAA3RkP/ijv4/5drIGNhTYTV/nX\nJWfGQmOLSIbCQiOmLRAeoPCfWV3WLALstxTWGlpc5l6K22eo/IUy28tWptWN\nT80XlFbHm7acev5IQCCo2VcLI7R4fdpnLZ1G0HmW4V0zo3BIHKlIBgVuMIwF\n4JtzmOtxxBh4u2ka/PLa6t8CMbRIOlD+p/hyb4elK+UNYMb/0EUe3F3dxPqO\n7zgtBw0/BI59WmoSAO4/D3yQ98G/dDCjk0WlwA+eTwwhqMC5Cl1B7IAGnsG1\n4GTPjLSfAefZ+4PfQRJknHXJ9WT3jkAJqDa7KdnAWvcyTCCQfKKrMbbeihzj\n6MfitkgGt6JD596lx1Mj8hwpomadVplxt08O4pJ8E81/lGFGLMA3HItuN6UD\nIwJhs73Mw8Y5XgmTIwwdo+gTz3F4aDyK4p+EmH5YJuGyLXKxlgNJIgrWZHQQ\nFkAYlPRX2cuwQxSp7JnE1O6OQd0XVTgxYEPbZ8auX0225Jy1TS6UwnrOiXzP\nbPH+2c+HUj1nWgCWvMpOynva//8i5ra/jcXJS38ys2p4nnVvzcL/k9W2WOTl\nZlSS8j0O008zBVVsDsne7DENNqRv13P4mgR9yVDjfr4c5iFqWLEoTN10862q\nYgM7q1SGJgZ9xGfKwtu/5E8EjKwVyPN0R+1FSP+RJA8kTS3chk+NTDg0Iv0W\nSn9M\r\n=3PT7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI5vO7A2atoz4u0hIWEg5pJ1uVzEziq4kYhT1rUOvToQIhAITDAqEVlKVWYHvG9vBJdZkkqlaSz0JDq3R8qsQGBmCc"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.2-1.8-fixes.20200302215501_1583186326112_0.35291622345926443"},"_hasShrinkwrap":false},"1.8.2":{"name":"@atomist/automation-client","version":"1.8.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"_id":"@atomist/automation-client@1.8.2","_nodeVersion":"13.2.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-vgELU6zpDJ8tbioZ5UYix21vyK6FHS5k7ADGWpemQ0fOp/B5sNcX3UnMtwELn624ZjzpJgTuXVEVRg6yK6f+0A==","shasum":"b67cecf55b8360b665a5ab088d2613d4780d6d81","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.2.tgz","fileCount":1040,"unpackedSize":4607465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXYUSCRA9TVsSAnZWagAAhlQP/RShe8FQEnogWHtdQlLj\nAm4dCnkFap8WeEU4nEMSuARX5F1ADtaWXeSDnIi3noU8vYpXmn5TarS2Tweo\nmXhid612k0V45ruZD6OM1LJGoMmuI7qruL8ClriCpmtGrxCeTpC15MF40enP\nY48csLBhoTzDNRImm/hX8JsMUUekUIBrXPsgCq92LsXY9EVeOFCqzcTdwWOb\n9HyRUOfGDNKCVsmn1dEc5lDNXjKh0OcYGvXGbE095CQksE3l0lPQ31YKbrk0\nYEiN7fsOqeyE2e1OpBW9kFLvmhwLQzCnVCiEaXnp0PZA2bfzvD6Y0zvLymQB\nO3xdTvJ0Uv8swPcQt7J7IIY/SmduY9BAlCSZkWMU9o5QQhDeKFyjAotOmpRQ\nOYcm2Wh9vx5EudCEGU+gT53M5p+js7MwO3fj0QZryiMW5HB30XIIFoDqxF3u\n9c1VZUXgCOGgn1YC1Bxe6qMphvXji/DKpMhkz0Ap6Ep7u3pwvL7Uc+/vyp5j\nH+q2vqUSvHzx2WpG23EMx7r6jsGDTOpKnDJu/7UegUHwODqAeIJJ6PrJsEaP\nW4T4u7/7ie5g2P+3M4HVHwphGA4rDJkJdOfWNNsMeFyVa9qu5GaJXt6sc0fY\nA49OoiosDG4DfpgRQ6ozEX+ezfdLbJ8W2EL9gxmhXdjqGUXSQMnQXwTBbEKT\nSwqa\r\n=Rk7w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDls2MF1pdhad7uFQyp8ZVn9ysgQ2TzChlW9OJwp88D+AIhAOLFuTq3WPy6hfSGlvokPqLbJlUHPuxlP4hI5nHYF9a+"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.2_1583187217999_0.21802996529554797"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20200302223143":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20200302223143","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"46edabc6bc2313d8e6428da9b04fbeadf3ad7b5a","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20200302223143","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-224BIPN0V/xdZ8LLFrtizFLSMtssErHI9irYmpq1ktKoCyHOeh1dq7hLCbp118vhV/2P5kW1r5Q8SkM2YAl0XA==","shasum":"5b994f3e2eb9e72f97acbcb2b8bb9a536e7e6b14","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20200302223143.tgz","fileCount":1040,"unpackedSize":4607976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXYomCRA9TVsSAnZWagAAx/MP/iWvOcGQuyWHoabBmhFW\npZvJdPk2MoNMvn2B0mOQwYw4crSuypMgBlRB15ivUWLAVazoUKsYaCKQEP/+\njsTUmJvEzq1w/lJIoBAkka3RcRMF+kQPx16PzV5xCLBwOn3ktqOeReFH2MRg\n5SUkVHEttTU1w2LM3/J8sSgA3Ool/myDIeT6Ttxz+PksKx40GlXGfBoIdsqE\nz5kMkvcI6nInH2kfzWZozutrM/JSEYlSe/GGny3qjoOjJnJwsKsvXCFGkTQj\n0pDuwn+CGzHGhWUp/cGrtbPEjLr1J6QytWh4CEUGFr4ncCr4zJ9meJlHSCNJ\nmpPSDtjdB7iU2oXrOuLWXeIcIr16DqkWJ0+lYkTXU/4F1RmZMM9CPGigoDJM\n3WVU/8vLHaonZKnUwBeAw3El3dfbb3SH/ggPBTgCXT/qzbgKY2QKYhy3KJfI\nZnLyM1uHs5E/jTJ+Q/l+bqEHtF+UzFXoLkngnA3Nrm4LsYBr00nSjYk49OKc\nwbiNi+vFydcslNxhgRNT/PwNxh1Bedt2fbA8g63Ems5XfoJjegr7ANf5W10R\nmAbNTiNEWt3fjsVxuLOnemS9HQsaiLvAHxV2L2i3o7bBYpqpGv87vzwfUZrl\nmjwa0fdeBTqfVjTNQCwZJkYIcuiF6p2MktnMPiTss9BzBQSWGoOt+yDXqq2E\nQ+Ww\r\n=MxFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwbriiRNJMf0DCpIM31TgguXBZ4QcqSo5JyISdCz827AiBgRnL/zBLnSpEdMF3fRjYTeIn9S4mXiDJ+m1Eb5MM16g=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20200302223143_1583188517408_0.861863354638597"},"_hasShrinkwrap":false},"1.9.0-1.9-fixes.20200303003656":{"name":"@atomist/automation-client","version":"1.9.0-1.9-fixes.20200303003656","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0960133415737279a6b5eee411e18d7f23d154e9","_id":"@atomist/automation-client@1.9.0-1.9-fixes.20200303003656","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Hzl6RzVsBYMLVxzIi2wrs01+BYFXCgrB5g83xEw//wO7JJcxHA1mCTMXKEFuawbytte7RIMgR9KcbAOM8CrkIg==","shasum":"9ece1bb72d8ad85e3a393dcbf24a2e57f6bce2ad","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.0-1.9-fixes.20200303003656.tgz","fileCount":1035,"unpackedSize":4644543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXaeACRA9TVsSAnZWagAAtSUP/3xCnW7aLlFiZ/Ef4lsB\nYwGlF8e5x9JZh+4skRNe/GT2sDulumeIPVyh1OOoqoneuXe3NOjNDbTPCkVe\newdJgCfXNrePsi2U3n2iDGWWjHNaaNc5lEtGQBxg0weBqXX8aHX+7XXed1ZV\n1NvF6cDw/uoz7LEDonaBoQN3N6nbUOK/6EG3QbxobUXIlkjuE3DqXSjRXu7u\nMKApJwRzxJwviBufH8Fg7fpwFRPLwBKboSn0sfKWqE4U8tqDAihFw33aJfWn\nc+9TPwFPBAer7n3PWwrnmpgxJazSWDNzuXeA10F+3Uz16dUTGRtZq41fOL+P\nt3ULklRQ10BSZEequHmwHaMlCIh6OmKo7gnYV8Das3Amukgo8KEO2Mj587UE\nVcfGpsAqmaRaYDM1m5JuzZw/931aIK9MsbjJEbS2Dn9xOWon6qH7u+2HKr7C\nCrojak5oQ+kyoN74MVHsu1RNcGTKy3SNdIklL/ZnrlZpsEJ1tgG7ndxEKqqW\nidT8enTedVhHp0SeRAR/pVbhybXYOMS3JdTT9t30ppMAWK4jqNLh3LjMxmO0\nvgr2NAOlL6f/3sV6+ACHBs8jFvnN6YQgjmdBl5/4T47ox5oT3sZNwTGu7jSp\nDKvrJ4c7XeU689w2YQ7KjJhytUUzeLhptesqbgkznsC6kkZBqsDkhgz7T/aG\n9XZV\r\n=BBKC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEdXMuXc9cEvFJP2W9C08UFb2YfXgNEFWoLLr2TxZetgIgBShdxkNINZjQoWUYONRTo2cLBIQmw3wawTQ1qDhKYtg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.0-1.9-fixes.20200303003656_1583196031468_0.5027155013926745"},"_hasShrinkwrap":false},"1.9.0":{"name":"@atomist/automation-client","version":"1.9.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"_id":"@atomist/automation-client@1.9.0","_nodeVersion":"13.2.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-rWwN4ITYxbz3m1Q8y7IU4oP5dED55qKFOPpK8G2MkvQVXp3d7AHwY2xJI2Aymh3hml9KqbnUp3zh0V/yjuda+g==","shasum":"08e4df3427c6bbef7a37e04e97326c7b6040aa90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.0.tgz","fileCount":1035,"unpackedSize":4644518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXl9HCRA9TVsSAnZWagAAu+MP/RalsfIOaE5+1uTeMV+C\ndzVEr0DJ+OQRTN0Cn5gMr4HKUJqmq5AkI54o2stgvRr0J0Fl7KG+mX1Cr/85\n28z/dEKJrs69cIctlXVvTaFsHQI0G0OlPy4qkRDa674szwefbMCw7Q95iENk\nPoJqm5JxfjJa7RHZT2jYOLMJk4+NbcXxuE09OiiK0KjIh0LtFEydhnK/3DFg\nHxbdznMpInap91kKj41tpHjpM8Gh3RK8IfbdJ38sThC1UZN6VVAZp1E1Fi0e\nGWijorsXEMCe2O7PPzIUWqd47PBJemGtvl+f7ApQppL83sPIeYAIaV6m3y4H\nh1AfTWqLFwBm9ysSA8kSOeuw75rE6xoq+9cRB49rPvfinOSWdKTMNDZQA3C0\nXMkmxNdK7aTW1BUxyqc0TSbs2xkMHT4QWWmFiRlAuonxBkSTnK0T1LjFcak4\nqnS38yi1m4xdB8JNGXhSYsTMuYC6T6PWMlmAOooXcskdrVvP8sIxaeTgQv/m\nuBpIt+Ay4uVvN/4j/s/H7k5zoGIickApilAAMbMsacmDd4xd7MEwew0vYoMH\nrXHhxOLeq+petufBL09X+lMpr6uD1N2Hnr42tXLSRykZYTkX8G6s2rt8totC\nVYRvnyYu/q0Ceh1ur/0UQzSHqJWap6V7OVOxmG/qxhgZya64qJuxHWmnHBRR\nvO+9\r\n=qmqc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICp+9vBFUvlPAY8k3tGwEqSCWe1rrnkWoKp8I/t8NNC1AiBJzccvgDKhvdIyM+5/EYw+wjIqKub6rUnn1y+bJIs+5A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.0_1583243078402_0.08250757254634689"},"_hasShrinkwrap":false},"1.9.1-1.9-fixes.20200303135132":{"name":"@atomist/automation-client","version":"1.9.1-1.9-fixes.20200303135132","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b69faa747b3e15e4ad80a589440669adea9ab624","_id":"@atomist/automation-client@1.9.1-1.9-fixes.20200303135132","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-zLuNvjkmdVJCx89qieqpepPFfiZo1/e8DqsRwad68iX7w72jDorIuGZZAITDNBgi4zfWdD5LIJ6OLtKsYMfSfQ==","shasum":"9b648667abae088a6cd2d15a06fb4460a95a6193","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.1-1.9-fixes.20200303135132.tgz","fileCount":1035,"unpackedSize":4644335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXmHPCRA9TVsSAnZWagAAYH0P/3PG2PBvG0OZZFngbFpy\nGAznzvBI/tJB6zgC+t0BHJp5QgFg+BSQkzO7ueWLNFjz6invOJM+7LM0OX5x\nxCm3n6WO6lVOYmjjtDPWnyEHJaXF+zJ6D7gs7Ewtazkh7ZA1S3eBzrqa88UL\nbjruVwp1ABXI4hEmyF3220sh2xYi0Rxf2e7mbKtbWGgGo+Ofc21lQfKpysKx\n2c46m6wvTabhaebEtfdqHQtS53bgjH8d/tOd8b+wZLr5D+VD+8Etig4tEUMF\nPII1UUBUmYNjpPgwR7+alPIB6glKz909bEHlobBfTvu8ZT+jD86gKErs3ocY\n9rRAY9e0tuxDKL5XTdkpsYfvS8MlNI/6HGXEKPdLE2m7EPABegK2WK35oyEO\nZkwlCdhpCk2Qh1YhbLyfJEBCe7L+wmqNXDKuEgt6B8/GdsYtghcsUVdqY7W3\npkY5BstRD1HFjOw4+5/2E5V2cSyxyhTQ25ZfMUBKNmEYU5SQp2ty0X1UfOUV\n+CtLB5qgGUtF3eA4+lAyDCJxiacMypxIacT/jKHO/MT+hEL/ltn3oyq4q+A8\nj+dGs/2a3IxH4W1eUdGeyGtZy2yG1FwYZzMINIpy5K6gijTbf8FPbnv3VRCF\nu6tDpiR0LqchVFH7qRCP53bVX53MylmlFg4F/yl2eHyNdvTayqsDV/OYY/kk\n8Tq+\r\n=1Dtu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+gnXZJ5ZBTSzlfGbfuZ6cujNKkJuhgoQzYh80GhaEVAIhAIA4OHdLFdNPZvrA+bfJl/pKERe8CZq7ZFIVY8TPMigl"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.1-1.9-fixes.20200303135132_1583243726561_0.47340002979030293"},"_hasShrinkwrap":false},"2.0.0-master.20200304193955":{"name":"@atomist/automation-client","version":"2.0.0-master.20200304193955","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dedf4bac5e8b13aef090fb7ebb26283618fc1da7","_id":"@atomist/automation-client@2.0.0-master.20200304193955","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-wfxU7CZR3t9CFKYNaBd3oU0yN6SasCw/Rm/3pgISNN7D8X4Cb/tSbgAM6UIWUiy5laZ58iaMr76J+yv6ohwV1w==","shasum":"0ce6401a8b7351bc4e291decbbf042dc4b208254","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200304193955.tgz","fileCount":1030,"unpackedSize":4375846,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYATwCRA9TVsSAnZWagAAhloP/23ixbAv3UgAk323izyy\n1mkjYPQD/Am6I87qMvgoobrI8iAiq6swOs+Eh6XxseDV6oPBJgbhfLZJCutB\nCpg9XLDCbRIpOGu64R/cgrvYhfxxa//7ZfA970wGtQ5/SugOh/P7zc5TsaN1\nRh93iIlPepwD4cGRX4qpqGIY3ayDkEJ3tTiZCr+muSB9FjkiCim/D6E1Zlyj\ny0c5+DfyYubUm4U3tyhZqHVxX1S3qwMyNZs9Z+6Rd1DRLoefCOogvLoi1Nre\n+IyglIfMmU0N0U4WQdd6zJ0w1m6KvtWyGADa3OXgu70jcqoqUi0toO1ovCEV\nwLsSgthx4JmrtDuWLMAwwYE769n04/3qlBTI0YnqXHIjRbvrtNm0o2B4RugD\n4WijgvdVDuU2vi2fqVHbLSUpiCUxACSPi1Xn5BI+LxtkH7MwryK0rAtrfs1D\nVxpojvgHxk7EkWyGxGPrirF+eESHxcUVO4V0biilQ/S6hwARrWvfaOYvbO+l\n4WhRWXwxYJ0oRR0dDT1M7Nm3vuObMRv8stf+eRxyIEl1LBEI8e1TZ5J4JPHq\nW3WXqOnymiX0GyGsLcJrKkkexbCfYyERngHtvT68DrWJotKka5FLHxKQ9QYX\nk2vYEoEcP5oKOQxFT05gqIATAtWvruZRgN7ynjaZEDcVtFmWNXPzVHdMs/Tc\nVt1q\r\n=c0eb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGonyrVvuG0SzNhUSF4fjqoPmAQgdBbp6znB6nCdCix8AiEAqC3p59jhDCCbZHwAz+cvikDmnj9FN5iGtC0mrNsd6Po="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200304193955_1583351023457_0.03123350103502598"},"_hasShrinkwrap":false},"2.0.0-master.20200304195442":{"name":"@atomist/automation-client","version":"2.0.0-master.20200304195442","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"55f2bb888f4d729093125ac330dd4dd4b93a934a","_id":"@atomist/automation-client@2.0.0-master.20200304195442","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-EEreGlLqwDlSJkl8ZaTCEJPZcpTAAQHnjKe8QwKpzvlhxP2DHnpU22Q1PIyA0LUlrz21TbUjmmI4P4RWq1pzhQ==","shasum":"f62b4de1e47e7303e1a282cdce741ced70246f96","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200304195442.tgz","fileCount":1030,"unpackedSize":4376550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYAhiCRA9TVsSAnZWagAAYT8P/0nMvEecUdyzY3PxfRaB\nmfazqIc7vQJKaLZE+4Xlt4tHbvNDGhS/LqIxEkjn/XNP7irJJmxLPl7wNyZm\nmSnIX4oxdEdYLKXuIjQYngSJPbVD6h4TEUbrINk8F+rTwpKtVWGoKH/uZH7m\nfEZE74JhBgjeXqLlzsFjVa4u6oZtMOC4NWlFSFwqr+1hWNE4OygbMo+6HSt3\nD6l3Uq4z9gbnPRm27MgD3Jis+TxQ5diV3ibkrWucnJC9T/htA95XofISHLOK\n3VIxzyTeSJlHCrcy2zZEBUZPoY1yX2JslSgC8UxObVMDQ+ihq/DRMgVmlA7t\nDTpyUlzcz+7J4sJF9E5Tu7yqg3o148+vgQ6cY5TWehdg9+m+UcM/wIIjVa2i\nSS44QtaILucg4Gy1vNKHRHko9jSn8nTBvZr367V7NY9EaZuOD+GZzuh9egp1\np/2TWRY2ijVVKtiMxw2v/pinAyTvbLrZIMO0o98gmuI++GsHtNmZFlCKEylp\nPZLuUbcXrAba8m5o93ZAHDYecdt7/DopcdZQVmUUZyWnC7MWtBXhg/tVZSqP\nyevPGqYZiAzE/BzIDMEDTcq8C8LhmOS+s/aZ6RRwGcAVUftPIiJC4BJWjGty\nB3t8bp03TXqZhaNaLnwPLlaG5oAwWmbl5N+hkYS/4Bb29p5rFPzbz5iFLlUv\nmU7w\r\n=rPQq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/5ilKv7Z/KKxn5Lb/12+RvVa7TmvKuKRvkkepg8tcGAiBaET3gD7m+pKDH1C4GeT5PkOqaorBFVobZHrYHmq2oSQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200304195442_1583351905820_0.5431762235122215"},"_hasShrinkwrap":false},"2.0.0-master.20200310235858":{"name":"@atomist/automation-client","version":"2.0.0-master.20200310235858","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6ebe883ee7fb1569edcd8b65c011415ec8134ee3","_id":"@atomist/automation-client@2.0.0-master.20200310235858","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-WcPC9K+MYisrv6zu7y3NMy/N5t/8iiRy6+eGKgWQiOKlmkrJLOtYoWxncVTERrDdmP9jSCzS9Wi4fKi+tSCO8w==","shasum":"b0957a6e9e761ba83794b04ec81f0912021125b6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200310235858.tgz","fileCount":1030,"unpackedSize":4376550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaCqBCRA9TVsSAnZWagAApucP/RLmgtGnWIE8iLDPHGd9\nAD+7pTQJeHaxgpLK1gNNCkSNsKUM0i18Z8W+F35E03HquyzXL5pbYGSl7f7D\nA2k8sPmzprVomAss3MmgzRUoHwjV7+aqueoxXwYLx3OaUJu61ATJKfVoePuo\nf7URSutdRlvvEfIhRnyKoLR4wnX2xqQ1eCh9IOB3Tw/5xCP3rjeyNQK682KW\nmASYoM7DTmgMst//RXD3B7EYsn1rYyG/N5xsGSNG2NRkZCQAOHvF/lsNtfHj\nYHqc464dooS82FqU5WcuBJVv70gD9XXtiztE/IlNxwmUk9MK/TMY+iVTSKma\n8+YExIqH+NXPuLpoXHHpWkmLW9jej8j9E6bYc6EP5sqtsWnhtl36/D9xl6t3\n/Y1bZDD5lBma1zKERPSQZHKJwTZKZxhgOaCNLDa2vhVskpukL7dLnoYoeSkB\nsvhaLvGKb+Acdjk7jjRTOcWJQUdD2Qy0cvlanhxuLpyS5uJo0sgza/Z0uqCB\nGuN03dPVmu26nXckD1VmxanEso3DMida6H3umS4XUef8CC0YErFLghZI0Ums\nS0uJb41loy05jPrwaO3dDqdVCPdrN/Px6Ol4sVWEIvYabVdyeBqPgEc67/1J\nozyYTZ7wd6pk92VqK4KcnBZHVuVjNFpUODvkZmViEo3lGTDd7cyNSwajgLwn\n42Xb\r\n=zTwy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJYzSKVY3SDkCIqaC44xi7/dIuExj8F2cpBGTgGUHigQIhAOeTzL9gCmgplffKre++g6jscCKhfAYxiaPBMiz0wseQ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200310235858_1583884929069_0.5647259993624332"},"_hasShrinkwrap":false},"1.9.1-1.9-fixes.20200311123135":{"name":"@atomist/automation-client","version":"1.9.1-1.9-fixes.20200311123135","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ad6069c779790505bc3fbf8c6d9539dde3e1e8bd","_id":"@atomist/automation-client@1.9.1-1.9-fixes.20200311123135","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-eS4qsCnxaW1k/NoOsBrPF8M65essA6izXXQftQyCRDATnhyy02dQwp70hOgGynco35zHgNeihcV31aE4WYGwZg==","shasum":"4fdb6f10f1a0696d8bb4bf4c680ec376616ef176","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.1-1.9-fixes.20200311123135.tgz","fileCount":1035,"unpackedSize":4644335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaNr7CRA9TVsSAnZWagAAYI0P/1rLej49GcKmfarAd5qw\nQKYGgMcY/5WOiL495k0vLku3bR2/rhQbPjeL9a+UMC3Vn8XmyzNTxeaw8ZUP\n+ZQR8/05+TolqDHUwLO9vl2RLmdt4My3ca0ByyLfspOdt05KFFYWvhzXwNIE\nRhhxO7WIhIztYycr9nL1tlOEvBFA7YCPAlToGTgA/kPioX4Xr1zI1YJ2cVXM\n1udnMlaVAf5S5pqSnXxD1fZi24JMVwq978dah2T+p3IVPVU6CfuuyTglXoVT\n6I2xeU2jpIba+HjJWQnZlgks94YX2/PwZxZH8i4oX6wSyj5G5i/NgBXP0+Pt\nP+xqkoL7nR06HWk606makIO4XBKtPftRlZ82HbipEXNKnE9aVK1m8rauXQxt\n48dLjBoxov1VNhWncE2CvbATIXyGyw7ft6G9VSCloEmLVLBdcGR89sCMGRzZ\nF9dlaSidC9ebUBNVJGMz4Fdh5DvrhdTstGgs27u29oK5uN51DTFDlG9szEMw\nPmNGh+hOUlcRMe56nlqQcZVORIybzMi+BPyRbNnoF15GmM3OenFvUggJkBj/\nZ3I1zC+2Rb7AoB8wsjveInix69m5k9rNpJsucZ1RqpTkwKNDBjWrA/tUbHSV\nv3ZbzsOrV9dJMNJZTOS8PXlj8Qk5feGuD1l32CX379PKy8ydGLRaKhAC32JZ\nuwuZ\r\n=kUoc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGM0vRCheLJqSpKglLbLQmzlTABvvr77zVGVYUlycO1OAiAoQagGGHrWj6sctRyLRiFYF3mDxzGKD7nyiC0+nAL7lg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.1-1.9-fixes.20200311123135_1583930106823_0.4455109885741422"},"_hasShrinkwrap":false},"2.0.0-master.20200311165330":{"name":"@atomist/automation-client","version":"2.0.0-master.20200311165330","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"73b021adca45d9e59ea58632b0b31bfd5575df20","_id":"@atomist/automation-client@2.0.0-master.20200311165330","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-d9OQilxJWF8IOglb1QXpmgic5KVoesMgLBDhIoJvJa3B7ShXyA/v+x56t+BdNawF0VS0xgPC4tZXm/eDI7U1QA==","shasum":"31733013bbfdb8d7406f676c170d5f447f6acfd8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200311165330.tgz","fileCount":1030,"unpackedSize":4377406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaRhmCRA9TVsSAnZWagAAZLsP/i09uRfMCQKZunvzMgre\n645Eo2Tk4NF3d33kwaxzgbzESFR7Fb6YeZ+9zilt8UmIS5VPkWOoMOzGJM5q\nAdLzIhcyzuGldRTvFVoCjFrsQc0HodKEBwRjAirRBg6XAa4X6lYucsNoDY9s\nFNVomlhai8iVI0YcBj55tY7uiKx5icRQsb1mlp8pj5FKEsEitRNyeP5vvfR2\nQNSMRlekl7WGJSCjpCUpiw9quTu8VeAAqfHWO/AbHClhvf3UDKHnkAhGO3fD\nYznzt2gbsBl3sXFh1xKQyTAZ49VA48dlL6faWcW7+FN4LuhX9NvRIOJ6DifB\n1JcnWsliSVs/4K3EuZ4CoRGajxSB5vRoWnXtanHpEDErx0eYMpyhOGY9NEqr\n7+wzAQuWCRJbeGYHJL3pS3fI3zusWaSVUWEI1A2YTJEz6qwmvaFmmMypCZYy\nDa9CzHVInA/8wM0rP50hGOWOA/6hhI4D7wxoRpdmPcQfEv9NQtRF3lnqqTg0\nkwgWtzV1OhhLPEY6Du7DHY5Zkz90ooXNdr8AO026WeAlxllxZaxLZsHUUQi5\nFS0mMuRH+DPijkqrEfP0S4I5lo5zFrzdS38ADtk8eZmwhhn4TQJWkER6UcBK\ninzmEkDMtD3t2ZdSmQJ5RjZgxqUqlGV73/7s7ARwH2izYAU6pXUoerUg3II5\noN3t\r\n=D6Ph\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaP9C6kp4BuZF9RycibhQ3LMbLliOXT2GNCcJvuzLaYgIhAPQzFTOKqhwcmLYYGskC0GOqw2m06dXC6GANQOMyfmDh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200311165330_1583945830339_0.8135624294350734"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20200422000419":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20200422000419","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"82088fe9ac345764fd95e868069322a3065f74ed","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20200422000419","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-Xfs4BmxR8qVOfW18tj9YM593axNUxNbFqKXV1gv8OfW2InnwBciiqR4fQwp/4HhcPofTeV7l2ZSS+E6Auwr2jQ==","shasum":"549a437710d1a563152a05ff2593cc4702e816b0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20200422000419.tgz","fileCount":1040,"unpackedSize":4607833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen4rNCRA9TVsSAnZWagAAozYP/3iAVG/traf0Dzc3yoCH\nVNLDxLbW7r5AeGtPdnFOiv4xg1q30I0Ykdj3+tTC0ZvAWwO8pNJAW6RxABkB\nD1DG2LMby1malkoPn5JPnfgojhLaveMdHGI4vZS1n6baInj8cuaRkyIm7nHN\nnkyC0fXtD0qcqT8m1DHY6A/cPLnStVsEHEoO33ZoLibJNCgxb7Lj7prmgftt\nGPon2F4lPZ4Qc8Tyivup08X5wNVG36w+VaYSTewAeUuLGzzX6WOV8youuc+b\nRr2V+M/ZGETCgDg3X4dB6cakwG9sEneUw2XAhv2z6gMwfojLPpo3IJhLq8BD\nBmTbXQCJcH8Zstqi6rRv7hKJEfNMXiGRoa62QTJ8puDc3qs/K7hW4nin97po\nMSO6PC5lryAQl3dcJMaKL8AUXpElxdBQ3F7wfFgPsu2aP0PZRSFgcPNn4fcj\nhqUWkBMgPXhmwGf+oJxpsO1BrlUMF8ajAMVmb3HKJ5I5BWnTd46XI+VB1mmK\nLuK/pwSyv6A30Jf7b0DY0zJvslYcEAVopSpLVtuwqmbC2ZAZkOfW+hytOm64\nx1BZ6WidxGaC6tTYfbxsiIuTuZpmcHOikNXCj9qUFK38NDwN1MFjRxDXUKpr\nhkHYW6ZYFgutkuXsFq8C9dYldCe1+He4ISV405e5/NVM+njK1nNa/qJmVkFh\nvv6Y\r\n=VOgZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFl3g45c5cdslGrz0wOcfnrzMSQo4d+ciq7jrmlvAil6AiA0VxeLdMmyY0Nl6RZFcCg7EpVDWZHiGcL/coAcFCnOLg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20200422000419_1587514060175_0.5826114353653242"},"_hasShrinkwrap":false},"2.0.0-master.20200422001327":{"name":"@atomist/automation-client","version":"2.0.0-master.20200422001327","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c0aafa408ce0aa530ec9dd1af7e731cbddd577ed","_id":"@atomist/automation-client@2.0.0-master.20200422001327","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-CrchC3sDFuttcrfOZoktVe4YpGoo6g3U1383CNMXgl/9Tg/DOMpLOXVluFqCvlacVnn1VSqbn3/NzGa/D2n/zw==","shasum":"ef1c9a524666a380f6a8e0ccadffa6a4a9fe9089","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200422001327.tgz","fileCount":1030,"unpackedSize":4378089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen4zzCRA9TVsSAnZWagAAvrwP/3WQF0FBFAaxp7qPZ0U5\nKI2h4wSlZPmIYTPgQW/glli498TSGoTNFzrNsoymGpyuiBBDLHXrzeLEAYv2\na4pjTj8zNfTJ1mRZsRyWlU01WCGrI7mJ4amci/oPStjmF8pyMXeFiKQwsFQq\nVlvqfoc+v/OiCFVvKJBjMO1Xw17gQQLXt3pKZAhjQe6HRBwZFDX6sBxFD7uk\no+dQtkK9Xh3mU6lSElHZfJqTs59+ztSOkO4sPcw7wZhRy7KAMYlhTiJ2rcLO\nJ3fxQ11Ob4ugwuJx1RXgvc7pR9EVaOUdpkxUVNFc0XHxktv09JcnS5GXVXD5\nOhhW+mmojn6QGyg5YcaH4vcCPugeQQlKXZAzagWdt4hZ1I2emukNKmpechCw\nlwmgxMxTTOxwIgU/pauZrlQe7+/dMIUoHh5SduRjJDhznDFHH9ZDqoMz+3mn\nk3Xw8+VsM9RcuPvIMN/tRmAOXIyXtE7KvTIjNbWVerH3BxN7mvb9Cf50fwX8\n7IAJhd/mLtXpRHOsRUqSIktbnAnwvrI7VhqUOyrtwDrAiiXCtknQHld3MLOS\nnc+ZPSrF0q9gjLoork2f08Ry9TWCbnIcMyHmQkE0Xo1Djar9u6I7Mky2CbDm\nQv+t5CYHbxsjZzeLuMzcz0mg+yohYcHxm6lNhITaxrmVGq5RQYBO509e3Fwv\nGtCs\r\n=E8dN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDejHC9KIj8Y84fGTWTpU3OheK9jDRW4JWfI6UbwmVhQIhAOm0QeKwOEhqI1zqfjaSbZRBDRtsuquKJiboCmknkY4N"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200422001327_1587514611171_0.9170118874063999"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20200423173854":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20200423173854","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4af9c8384311e8a7a3fcbdddbb7e9182af0d846f","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20200423173854","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-NwlQQo0gkYMuq1pRaVB62mMMczCzUwmCqlPrIhFdSZ9h8KxLQknjQ5vs5kXTkEXsI5+H0GIFIG68DG6IiGFv1g==","shasum":"5bd07479a973a5d10951cfc815295011a97bff0e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20200423173854.tgz","fileCount":1040,"unpackedSize":4613320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeodOoCRA9TVsSAnZWagAAyQkP/jS2FydMfeGNoEcOmGyz\ncWjwICTJL2YGPGRN9R6acY7iPZO45xTDt/4CdoS87ZGeLbOuKiocgOw9jQl7\nXFAbq8ZFVCQ+u20GNoEevvgYnv8R6FRir/X9GVzVpG9NViyAOvzu766LI6PV\nJRVQIUefrNNefUxBPbAlUeLtAa+dDDLY7DhtOV0L4V7KTKY/o2Bx7zwRr4Zg\n+80jYgSyYvSURK5uDlB3/yBA3LPGco4+sZ2U6w+tyZZAJxfGTqmiM5oBV83c\nCjy6brgRye4/NrJEn3lLfsd/leqGf4LPWVllAlC13XRDudCsYcIPv1VwAnSV\nGoV88Nnr98DUDy8Bs5/8n7MzlXmOAzS1zVPHteU/cnY/1DVPrw65FTNIO1mu\nJwqJ2hOa7hdpzwbZh/3BihVv4e0abwbmbXR5i+ngF/6tgxKIa2R/U9FwYgVg\n6Nz683OR7nKjHCAeONDvH1h0UKei2q0hmKEPnHLvufmPnWKtXk51MEoaCOfE\nZUqdmpE1ZnVy3EGsRq0NPTicDb0zeXWPYjCzNce/8tY5WBeJfZUOOlpPM/RF\nQVnWouqFsZDMIMQWTJG+Qzh9EThiRB/6ycS2NVU2Md26LpexlBXpOZhKGcYq\nL/U+i+xOBlTfpmj9pG9J/MGbmsD+qnx4nin77OKbYkOx+7bhbxRChqM8ZXz2\njYmV\r\n=JfZJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEhzeah2DLZdRtNbY4UWywz1q+7b6WYU85+GUei0mfigAiEAyFQzW9yLGjSBi84pKj4t3uAbhRt4Iq6gDXE+KOdYOyY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20200423173854_1587663783153_0.48912966045563544"},"_hasShrinkwrap":false},"2.0.0-master.20200423175826":{"name":"@atomist/automation-client","version":"2.0.0-master.20200423175826","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cf5c2f99f01c4d91d3526dfc6dbae27792e765b6","_id":"@atomist/automation-client@2.0.0-master.20200423175826","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-6aHXzhQKYW/0BqRdpwjyMrYmjyJ0OY6WFQ+JyKASCrOdphQj0lXZVCBt1IOm4sTJ+yzccGNqArgzNl6/qpZ82w==","shasum":"b0ce6209294b5fc48bf3dd7cc6cccdc84ef2c41f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200423175826.tgz","fileCount":1030,"unpackedSize":4383853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeodhFCRA9TVsSAnZWagAApc0P/07H32/Ym0oRdXxSjQ/c\nPtAmzU9/aO4+rCsITZT05O807MGCwvlEcRYrCi33x8XW8Pf5/c7APjreagqz\nq73g2+7h4khV/vDKxvzx0kd8ezi/DpFSdGcJ294ibxJ+79Cc9uXKxVnxcxMu\nsKJ3sHcVaRwILyZ5IvV+Gu/fGSFgfeTGXn+ABVqdmL0MNoDK23h+mikQUp/1\nxpJGyNnObIe6MALjg1K4UKhw4ouptlUjxKgC3taUcRECT51rJc8HpHyzvXNx\nQvyXTJSqDYQE7FEYgFvW5mlNvZJXOt0h0pYJOp4VYRuUkggwA/Q2WK6YDY/8\nsSC8RDkBwCr6Hn1wNJxEU2BZtKY+AAQ78sBxUu0tVRMUBW1Xb8rIe5dCd+aL\nnjx0riUytmb8qyLUhY1K4knM7ovENx4s21VQaaa/fTdrIaXVgni2oby5da3r\noNkQWCuB0SjzoA47y5LXFm8CqmmqEud9C29qSo5MeN0ieXtqBXYS5JPL5mdp\nR2OeLd3CgODPKTDlBBuU4K7+T5HOBfjHh1gKWvyXsZOvDcV4GT8zquSfb9C6\n584oemHWA68hFDhQYruuT8FDgqBSIotzTsC2SxaU0Fd77owQXG0seHfd7mQ4\n98KEmttIil+KEHb8cdOou2KwpHF1FBxtBeApKhNaJQE2TyPRPHG8HZCCCjoZ\n+5yo\r\n=+5wH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDu5pRG7Hj/xoPUojTgNVabGcJjrOcjnq2h1uprIMU3PAiEAjK+9XzjnN+Cvv8hvMuMcvtPTH4D05GMcNuT3gHxAFik="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200423175826_1587664964898_0.4975282424679386"},"_hasShrinkwrap":false},"2.0.0-master.20200429105721":{"name":"@atomist/automation-client","version":"2.0.0-master.20200429105721","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ab85afb3ede1c737bab59ad931e1fa6e410e8efb","_id":"@atomist/automation-client@2.0.0-master.20200429105721","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-zL+X/eKS2YAEj3ZfEb/Ed9MDqdTJuqvPK3WIAI21GPVAB9qzE5WDlHnLPgtKViUELQ8fwTRWSeAr08sWzyNnGw==","shasum":"e3e2340f9dcfbc9f5590ff72462313a064bd2884","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200429105721.tgz","fileCount":1030,"unpackedSize":4383732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqV5mCRA9TVsSAnZWagAAUX0P/RDiLFgixa5slxVsAVPD\n0+vx0vhmNIr8pcKG2cf00RN1R8gjEYOOAmnsfD8QeK4+NPx8ficKbVefH+qZ\nriHIEwjGTWvh7A1zGEr6RR5aeON8gC/GqAYIeaP3Eqyw6Msz3mWHX84teNqa\n7H/k1wbjGDpJl9jTTkl+aDX4cG98O46Q5EuFVBWJ4JvUoYv9Ehx+HL6DqyRC\nSmo/J9VdQqataL3mMvNDroUBRIbAxo5WQUzl17ZiEChASH9qlvzZZtrsWUlq\nXT9BNb/Y5/bbKYoxYH85L3iKPLrSKBF+T8+VZ+8GQ26vV7EPisXQ8AbDkR0O\n7Ju4VC8bhYFTYkX4fD4H3Ko8NUGY5nlDK6twVmBQPp79fc6q30kzNy/HvWuj\nK151y4N5hVq/8DTqSupDzamDg/s2tKmUBD7eHwaIekkDSlphJ5pMsdWBKjt6\njP9DnnNcYusjQk/K9Kw+nXY+TF3F1PbHeljchwBySQXkgYLQHC4QnuZ2QzC1\nt5IvZWpU+WnFGFOj/KV4D2w5lQXNJMMpm1u3r+5iye6VcvggXCeDi39E5mGy\nxr4H7bKgD6GRNnRplkgc2aGXgI++0PpHFCLolh93qPGV+x+OrWvETJNIR6y+\ngMjjyrmJd70KltZioEBisy9ik03ql1/eNmBh2ZIM5iuySRmka+l5Rrmubjqv\nhTVQ\r\n=L5TQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrtdKA7Z+chC0TH204CUQ84S/wNtLrwgWts5hU28gTLQIgCbshfqcYn84ncohoX2cmCNHo+hzUlmrcHeOT1sl2bAw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200429105721_1588158053894_0.2982971234001486"},"_hasShrinkwrap":false},"2.0.0-master.20200429110358":{"name":"@atomist/automation-client","version":"2.0.0-master.20200429110358","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"./bin/command.js","atm-git-info":"./bin/git-info.js","atm-gql-gen":"./bin/gql-gen.js","atm-start":"./bin/start.js","atm-start-dev":"./bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2d52aafa409a538090bd348093f747b24a12a2ad","_id":"@atomist/automation-client@2.0.0-master.20200429110358","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-9HUWSeWtSfI7b/R/94Ka7p3fLvMAbMz7EbSPY2w932R3/HRaKmiHtaH9DEe+EE66lQmL4aUUW1dEI19QvZMMZQ==","shasum":"9d73a464aec100e42d403c12bd1aea1459283027","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200429110358.tgz","fileCount":1030,"unpackedSize":4385573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqWAFCRA9TVsSAnZWagAAjBcP/RhaDmhyj/YJ2rLBMwOe\n1dLhjz0aL5yqTgpncVDsEfL15djuBJspGIGI6iq6zgkS5IWVk6FB7J3rnAkJ\nEQSnszDuscIj8B0BS7LEcMyWeFxpyXh+oRP4nGTUymwSfjrLNuI+tMFVtNnM\n41gBg8eXp0MG61SMZ0snfNaFKM3EJ1u9u0M3yTE+X3+hEso1D/fzTVCTR5ha\nWZEH+7q4G6TgG9xky938nvixUl6mA2f90FpgtGIAkH5b0iizwKAzG2+DMBIj\n/GZwTsW+01ONRfvuZJ6A/LSMXk18IQ4v7S0aQ/Pj2FceszEroYxCME2E1yNQ\nIt52d6mRa9nvtjpJPV7BfI9Oi4YYx9eLWeq3+Chs20ZgSw8tuV77MHclfsov\n1BVdObaParyxG3IzQr5+Q3fIFlZAvrhZIRjCgRidFFH1O/OA4kGcQxnLms3j\nLv35cZUse1qvlshhj6kgnME7KnON2smaQV8RSa6/XU1qXp2WeZNuvlObQF1N\nBQxjlzv08fb3+8iX4CM/IqpAFOMq8JlsMzJmhzxSL/kJsY6tICLU7A+9wBNl\n7gI5NFLfulE8aWykZDEHua0U2+99IhWxJRUGzvxUoaNGjIann0KfKZUT2jxe\nOWUfKiujfmOM/1sv7y46lSWmzxOYPtLYnksp4CqBCQD1682VG+pPJcSi+5Zm\nBEJ4\r\n=BzuR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPrPGcWJiKi+BvBkGBZxQJ34rHzTr27SKxeORHbsMqyAiEAtl3lFY7QNEnnOhK96h1fsinwgiUDkLqrwmeV0WIMWms="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200429110358_1588158468562_0.25395741866343946"},"_hasShrinkwrap":false},"2.0.0-master.20200630123203":{"name":"@atomist/automation-client","version":"2.0.0-master.20200630123203","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3a907e53ad62894d7265ef186c4ed8dbac43ea16","_id":"@atomist/automation-client@2.0.0-master.20200630123203","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-nhrIIua5rF7RzaLLbQixj9hzG8/DVWPhQ36GI37nLJyQB4AYSn2J0oHZkZGR2spXnQz7MVxn5yAtVBUliN6Dlg==","shasum":"1fa5252b5d21df2a2ce6142008ed1612fdcb117f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200630123203.tgz","fileCount":1030,"unpackedSize":4385579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+zGsCRA9TVsSAnZWagAApScP/RjYT0aMtZGqJnZa3H/A\nv83HINQKvqeWCPaX0wYdWWXhZ5doJIrefTZMdv4lv8B6lfy9OjUvBPU7txEP\n4ZuXmtrAjE3JGt/aN3VIs4Jjph7RucjLDqg+UyZBJPlb0bdhY4nd5mgDm6Sm\n7nTQLyVUn2nAMhIGtQ/Ew3UU+BaWwhkfBFLtkW40vvpkXWdSkt+e/UvZIy0Q\nVSNeLrw1Sv1MJXyf6JFpTupboY9juIHSr4iPElveqX2T4YRK9IZHII1+ZxzM\n1y3rDSE0WGfdo+8HnG5hEMX/2k8nZfntspPE3TnDDbvg0y2GZfHE8CnMLFJ4\nB/ePwT661kRwsu+6hEtH0lR/B5VvDsl7oxxNTPYPjxPlaQ+R1wi1TT+fSiue\ndKNJOztEptU+KwRFf+1gpFUZeUCGU0EZfK4GCQO+CUEgmVN0K+1K08SHx/Ym\nzUHxfVKwhCYnLzr/fBNNdSn2mGTFq/HVlio0vsZRpXsTMGvaB5I5JVgu0Win\nQ34WJPHSFnY4X6sQ2cQI22lPjyQu3IIGl2Vv34ttDJU8uX4LwIaKA0+fRnPd\nW3nsh0wtfv2KUXkMt0cq+hG1LUD0qi68tQ2Trf883bBotc+EWL1cx/HlRvmD\noN9TuKAs5BBaD/2VVZgSkRRtSyqsxZLnhjV5nDrq8BYsKzm1A4HNVXw1PkQS\nFJ+3\r\n=EwPm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoBY1Tlblx7YU5TTbBZXayk6MXB1BcsNRpN5AIOxuQqAiAk8G2KV3LO5hz6gqCmr3l1dbH+1btlkqSp6F3Inz9HZQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200630123203_1593520555588_0.6332634751860711"},"_hasShrinkwrap":false},"2.0.0-remove-deprecations.20200630130705":{"name":"@atomist/automation-client","version":"2.0.0-remove-deprecations.20200630130705","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"acc88507c72a9c29bf62ec0f29b4bf45b14f5248","_id":"@atomist/automation-client@2.0.0-remove-deprecations.20200630130705","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-BUGT9PbE5VR2amIzNfaH7UH3LLdSX3hoU+NUKXoTZxvGPFk+ajgtawvBCGb/qWdYE+F81gLyhYQ5U4aJtyg7Jw==","shasum":"638e5071397c58a27890fc6cd851ccf78d35b4b7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-deprecations.20200630130705.tgz","fileCount":1021,"unpackedSize":4323043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+znfCRA9TVsSAnZWagAAc+oP/je0sJLrOyPfFxSuqsqf\nFSOToNSRlZITHnGU6gcRBxBvbJoAy2EaNRa7bXqrT+gChFHRHbojNoAYyOqp\n/Ajcm+AE9hmxUIDoOEdVS3Z+4RUtdSeWhGX+1zC2HXAMWO/BDNsUlFbEOZeR\nSrsOcfWynkLIwpoPYML4jiVG0MmtX4IqNdTEmGVlBtHqMPDj4bW/N9+o1UiT\n2pEfIpztCHMjPhr/LSzb3h8F3fKdSP25ZKELoJOKatocIWuNZLUpiYCiqari\nTM8XbS/IWuxfZBGy+y6XD2wDr8i15vQ1gZyraRj5YpePd2s+PlYyMwXme1y6\n8MP+kw1NJphYvvS+4kKMAoUUn3SREoh8ACc5aZ+0hiADW6cotcNbXFh1SqVA\nUn8xGU35uPKItMVgiw63dy9agij38D5Gm1DxUuNc5JGnEKPRiAu7IAjhr7if\ngIA3qxht7C6PNjKfLVldux5mR+n6hdoaZs42gduwqGqab9Gp1DjbnZChqqMD\nI/T96T0CbOvUt9aXlQcAX7GU4BV5xFFnzAK8LlBDa306KPpMyJ2grp0NoFJC\n9hRNa3nhtsVTBv5hGaVXS6etnL6O/9Z9d8IiwpmDAQT9MevIaNDqczwzI1pu\nNMfbQEfQYAim60KPzhlSqUSNRTK0Y5n7QjfvSNiRpI/KnbwinOiR7mXZzTpK\nobzj\r\n=KlMO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC0irLWUdl5rrLlaFsIdmRxEf9+FgdBCQ8EXLGuQepvwIhAK++bMG1ObbVbvhbE6K88FELdu+/O4E0EyMndK0/jOcH"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-deprecations.20200630130705_1593522655449_0.5311041572305271"},"_hasShrinkwrap":false},"2.0.0-remove-deprecations.20200630135953":{"name":"@atomist/automation-client","version":"2.0.0-remove-deprecations.20200630135953","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cc49b31d4af24f202355705e1c153aa9f5e0a04b","_id":"@atomist/automation-client@2.0.0-remove-deprecations.20200630135953","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-zhNIrGXiFCN5A3A7JKU5rkwukvMP+/B9cdDOiRUV0V+VMCiqNN6YtLZQqatZzNfQ+eE2lHEWeVKNsorANucP4A==","shasum":"87bdfb018bcc48101fcb0355229a147bd704c8b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-deprecations.20200630135953.tgz","fileCount":1021,"unpackedSize":4323854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+0ZECRA9TVsSAnZWagAAxt4QAJX7NAx5k+x61J8qm6WH\nF6yu+hGzhX00juJ9QOxGVFmiVoZejwHCXyt+In78mdNsRSmLW4MEJGuUv9/1\nM8dktDCbA17W199Qw5HN3XH/nZ3mNhBwX3oP7fqYF6rxe5eiNIAthavm9t9N\nO4TVEvCzwKBUmMa4S/iml+H1edSgN8P1LKl2VamoZ/1KKRBdyc8aw/PwsXBy\n1xUHMDIyYHxKMVDXc9QcRZMXLMt8y0ZVwhQk4QR+vkOPJi2A3/eom/XB0ZuV\nftkW86gCpERVcphN7L1SnQ1g0k+KKZCM+kmTnZQR/696T1UOG4Jw/Mi+EO91\nSwQF9EIK+RNvqwMGSK+Ohkt9Dku1T5/vRNaVaSD1m3IGqv5/wNhFcJ+bBwuc\nakK28q4fHEjzMWC7sm9hjTzOYSeLJExQN0U/xYLgjRbhmWXmurdM5oXRg/Iq\nUMS4B2ieWHLiHzAo2flMff/EG5DAf9pWoX1VLcFOLfE4QrL2pIg+6Ci8cJWC\n8pw86mUi7SoML+2IN5YhlKh5YwU+aO0+gk3PSwtsxUtux0y00B5srk1Y0tEV\nzdkxwDt4LMxQwr5MpE19uUBIB8bvkQSjHSffkAsjgYbVZ3HEVBnxRwTBwY7N\nV1anFsoi+6KEMMux+gc9sRhrd3CPcramj9U66s1ql2Jzz2NPoteG/AtotcVZ\nti+e\r\n=mbtb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe1CdFYVwK/4CCw8qUGzOcHJl1jKz+TNfkm6Fov3okcgIgOcwQFcFAqAJE1ojF2Kh4bZWTiVoaGKv6dHUiwvua2RE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-deprecations.20200630135953_1593525828023_0.6291920580846941"},"_hasShrinkwrap":false},"2.0.0-remove-deprecations.20200630162723":{"name":"@atomist/automation-client","version":"2.0.0-remove-deprecations.20200630162723","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f153898fbff015bf94037b3ba4d6e2dd1b43263e","_id":"@atomist/automation-client@2.0.0-remove-deprecations.20200630162723","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+oHkmc3jCVXRY7AFXQZt8TB8s/0wpk+RmzanwTuZyAhBRS4I7y9WXTLNQ/VoYPRuMxTBEsrYsj1SbQuCJIRFNw==","shasum":"b55b5de7e30b82232504af0c81d42257493138bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-remove-deprecations.20200630162723.tgz","fileCount":1021,"unpackedSize":4323056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+2jbCRA9TVsSAnZWagAA30wQAJAh6IG6c+5v7QqS3w18\nVItO7s/3dU/+wYI1rSMQzJVbT+ztNYqNx0cWApjNx+AuFsVni7Q4bIv3Xz+Z\nohOmQCvJToEKPIN9uWMwXS7sr11RTjbb9oEsjxuzbQJTzWPtYJnUM281bkCm\nyB2FUk6sMGAYdO8Ln/3BcuodpnKMeCSuOV3CydG+7fZATCkZW1aNIZ/TC9hO\nk3UX4/h9ZpJwmw5YsjfvjJgWgcBANV2OvVqCArEbXdvj2vhgyHXQi8Zr9NSs\nnpxXFHZM56QNEpR6OODcIABI9WzDEO9e8zoDaZvII0bfH5vc6oT3kBhDYfAQ\nzQTRBRVsi5isC5JJI7uBcAiDseUIY/5Z3ym1FdKJEufmjFRiQVaGUagRv2uR\nzYWQskl720qSuiOSGt15mVPr78PYuxINBOziySpjosYCmXZd5FKjhA4raD3l\nXnheFYtIZMXcrgIF3w13pUoUI8Wmd6clQ+B9UlDINnXr5K6om4akse6PMyRh\nEnMUMv38+M13FV9xNP8nzjUinayESHR5w/rR6buz2Vtdt08++BMWlsp/ZDcJ\nWIDvdLbI0oJMt9Zp0+xfTzQazKfIEHgTJNMjr463GHGOxN8nJpd60g/Ah7Q6\nJ7pqHw6EEzAk+35mb9R9ybff+R10xp2IuplE3tvuigXx+D9aPaoi973BcSjD\nR0n+\r\n=3lJA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoxhYn6SmkwvItqKwQ8xDBMupXY0eFd80KFGFhQDE/WAiBnCLD/5Ofr8UfUpZS71BsiyZkrZrXyE5lWY1BXPLxZkQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-remove-deprecations.20200630162723_1593534682510_0.10565197806136761"},"_hasShrinkwrap":false},"2.0.0-master.20200701135449":{"name":"@atomist/automation-client","version":"2.0.0-master.20200701135449","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.144","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.1.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^2.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6be6e8a592b64db0da93a6e7b2e0eeaf17328559","_id":"@atomist/automation-client@2.0.0-master.20200701135449","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-qe3CtNS1/nhn6F72mZbPegdW0WcG08NXNx/N8u5NMiDC9b1kXbomS4BBAlqr4+SSKRhXA+OkUXoI2VtUEkGIsw==","shasum":"9a5e30b1f876d7e5fb9b9c53a18226344a667e48","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200701135449.tgz","fileCount":1021,"unpackedSize":4323146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/JaTCRA9TVsSAnZWagAAo+UP/3TQC9oJ5030rHMzcDku\nOUrkYe8hueBBVZpeYn2Wzy8m+CpvdPnZaoESDiQkVobudSaiJce7bMPCj7Gk\nZovdHez6ZVIcRjF0keB6lOMm9QQu24YaTgilpqax+s9Fb2XhHX6fcSIPYpmp\nd242A7uQkg2L9g5SJM/DamqEUdjVJ6aKzUqO6Ya9JxH68bMo9lOZ2HqUDoNF\nqZNWljdIfH2gJq1gqvcgKxWxySTBI6sefMOz6QAtMmDgh31nLh966qVW+519\nbZ+pAtwfDTYvjIhALXZNVJPQvQz6OrZpWimmWoYY6bmPENg0DSxvy94PJPCR\niuKwunlephyO9sW+KQrBmfsDj8z6BpBiwLWRPr/9kPY/YbbtTyYPnsAN2jQf\nDLLY9rxqXeVoQjUd0ZXmTbL9p2wBtTOW+xa5QB+8IKvECmqDb1ATJHrFwl8H\nUDLb5QjSRH81w0ArDX4kXmSQ7teVOXjCHyYC7yRtTAHo2lBXdfAUq5fnsjzc\neIJzvSuy2SsFcF6LPR+ram00lZt5wkW7sdbOcJbgcLpJxj1q6p0zoDKK0Z8p\ns5PCDoW+7xWPZnJG+RgQwvkEg3IpYjULqB+FvQOskn1WnDA91Cxu5kAvmgwA\nHoRNfV8OOu5cAt4XMmeCvqZv3dgKTZQIkbAI2joBX8wR2Q7WD7dPnIFdJK4G\n5rWa\r\n=XXza\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSS56Gr+dD9T0Agi0VKisz2EkOwgM/oLNzjHoVy48o8gIhAL71Nu7X2kWt8F2ejBfijNre1tIcw2w834kvVjJPNZNd"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200701135449_1593611923174_0.7809145622868812"},"_hasShrinkwrap":false},"2.0.0-master.20200712143926":{"name":"@atomist/automation-client","version":"2.0.0-master.20200712143926","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b4f89fb0d30a4f3b9809798dab98cd786979c907","_id":"@atomist/automation-client@2.0.0-master.20200712143926","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-B2Nwb/mV0dkAV5/jOp28tU5R8WDfohKD24NqKEH7fObQCPsjswAq9iJKtTlhfTOAxd7JUSfSEp5NfkNYjc8z5Q==","shasum":"447517a193edfec0a64048b985333a0a6d0ffe33","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200712143926.tgz","fileCount":1021,"unpackedSize":4323540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCyFtCRA9TVsSAnZWagAANP8P/jKZ1YC2SSfLB7iCnbyB\noHnHTLLQTtriV4ShwoUmcUa861zXrP+IsG6judWz6vAINMMtkc5rqasUYmDd\n8HvXa9NyHbHOjIJ0ZnJzXaahRe0eLpiqoCPco0pDbhjr+PIAIgRWYQ9nKgnl\n2+IQ4LTCfjwvmvBGx5nRBlYXjfOAdbpNkupJYeRez4GXDzdfIcbg1HpMLewa\nH7skmTmy1qYAC7fAQakpmVQJfxYXx0GA4tnTrc3twwY0Uj2qUgtneYNvFLkV\nNoieOl7v5yGqCOR6qbIuB4OGNJaFKwe6+D5X0SyU165QVdDpaGYBbjGfmJhF\n2l2abQGmLitSniWKSoxrTC74ycmQSnIZvLfeAekH0r0HfwBquQq897ezkTb/\n8M5WuOzQFOfJ2YvTREDjNuxd00rQhwkS6R7YqnwaqJVzcMIdSC/+oDOP09wj\nGCrxIp5piHS6w8T9sl4m0NJ8Z91WMiUimV31EPqCZFY4KiekjG7NigyP72Ys\nZBmmAPh1KRM0ONh1erb67959IaJI0v2GK586ba9ONR5y3d4LxWD1FanYp0iT\nEQHyeo+YHwCSC42JT9SoJ3HSDx0M55qLGA7FyD4SIA4AX4pZFvDYeyn5/+Yu\nTPzde8MEWD89W68j9WdQhiulmIP+yNrHHTMbP3EFBOCOTP40oSjUfrJsRNM3\nnU6w\r\n=iG8O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEIYM8rk3vNCjVeyAeixmfj1kBrps/oJa8CSssMCOoD6AiEAvnzz3ITF1WXCgg8U+Ldk9VOE0VsjdBVKxIhcIqYES5s="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200712143926_1594564973060_0.06336002208446168"},"_hasShrinkwrap":false},"2.0.0-master.20200712144106":{"name":"@atomist/automation-client","version":"2.0.0-master.20200712144106","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"b4f89fb0d30a4f3b9809798dab98cd786979c907","_id":"@atomist/automation-client@2.0.0-master.20200712144106","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-W0pTVdAqW6xwpkAGVNXZ8rPPd0jtSmsJRiEW25jsriYRIn7O/9L9cxNi67rOZPEf3tDTRC/tgg20PmYVFvLUAg==","shasum":"b37949c3cbe11edbcb91e7aff22b535a4ffc26e6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200712144106.tgz","fileCount":1021,"unpackedSize":4323540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCyHrCRA9TVsSAnZWagAA9IsP+gMXoF+QJKd5zEzf+VvK\nBpiF0T8yt3D1Bkg2RyaBHa+4rtoMUlb5k96aSeI0I+OR9Ey6X6O2P8GxE8yO\nQ7SwxP3kslhR9KOSZnDxtcGW48ZUNsqqrNhKHpBFHBKi5gbqo2GBM+O5ajEL\neMdXfCaBhxmDgZNXVavxKHmeNuI4U1t+k91OOtOhcXZzwuDK1PhEA2J57+Qu\nH+q9tfajLFXRoxBOheblhM2+0psKvCf7QXl4HyFXopK2TOuxsG1mj0WU+QAS\nkORXsU1Zp8pmmpS1A33uhbZRW1+ct8YE4fT3fMWgNlFU8ivz0KAkm2sbJC9P\nYPQR7+dQCLF6yaac1EBQXZnH8m1JcVacRrG5k/I+cTq5S4jgr1nC0GEc73v3\nvhDQn0+s3wsYVpBgREkVyMOLnvlncUEUjYIQfI6XKeU+4brrS2eTen728PSj\nq0Q95kJEljm+3kxZxwUl2JPVoRMUnNkdUfPYrqXvgzuUy81lIDXMDG5gK3Tn\nIYMba+fA4xbUxdinUnjiEUvs4Tk8eVt8yxTsWtW+BQ83K80grO3KQkIbGYg4\nl2kEcq2zOxeQxE173w8dCGU9xYj9WRVimbw7WLijZQMJqnFtv/Q0pXXZ2woH\nn1/KtzEXUESHFgjsDmFdNIhpEh0NFdZ9474oWGTPizSbAxkji5AERQKzwTrt\np+er\r\n=0aU1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYzERKTzx5XH/N7lNHrAp1oiGv0HFbJCN2klDXC/nlwAiEA71hQaDLPoKr/qJQWcvEhFxSMIUfW+94YknzZmG2CClc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200712144106_1594565098794_0.9702934865923418"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20200712144210":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20200712144210","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bf4003d487d296af7c1a1dbcc52a4fec88237a1f","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20200712144210","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-A5NgqvfBJaKjozI5rHVEX9/PmZLh4lodwGh7xRf2suZVfDg9OqLxER4qs0LXTw4HR3cN3Hi/NMS8mr1yPZIqHA==","shasum":"0e26b8b9d190c1510a45933f01760bf808108a4e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20200712144210.tgz","fileCount":1040,"unpackedSize":4613453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCyIUCRA9TVsSAnZWagAAYAwQAJHcJt6JCQ9kvT3wh3Vh\n2ALdOWS0/2lAIxC9Zu1ck9u/APSvlD+zUM6NFxOmaueAhg6yu0tR8H8jxNci\nK+hnfvU/sf3T7pZJ4naiNJ9meuKxmZxy6BbsCRTTPXZQiz8wBwVxgQaRThP/\nUYkswx+u9pBahbAolmuG2gY3fxDk56zpK9Ku1MVvQzN/kpMQzmsnfvn70Bfy\nyv1NlOl+JT/1EB4V6TWF19klRSMS+mAYPcMbORYeupf6fblSNLsT2DWDUMF4\nz6Fouhat9fbJCeBrf0JsBH/H/0PVcVUaUPyITSFPfdqok6pJiOUpDbBLaTpy\nCLtC3+IsxlmkLvKqTp7ZZrRp4AhvNR+9oY5sAPzupulNRYHkub4VxEMfKhhb\n4I78VaPM7yAzYyYHWZ0ObfiMllzIiYZrNzoA1p0Fg0zPhUiJSWxyHnI5eAtg\nhYBBznNkWlupAB4VD3huPPbEwTfK7pV7aXPlCrKRFrS7HE0kunyqpNn+imLN\nBy4BkhcSwvu+0h7kgZbLf/7qSQ4vqNx5vtM+RBu0wOucS6lNMH+ELhT9hzng\nwoZSvw22w7O85tVYAIwe05Q5HsJRMAy4SqXprdftCJAq5bamXeHE4KP1vNX2\n06kojwyywifqJeLpSqlNO7A5wbvPn/OJ2tn4kJo9jBMRcAnMXPliDT62KKYM\n1GSL\r\n=146S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9FivZxrVl+5mMlMdljCs+mfhyoBTrbVpHdDA4noDqFAiEA+XoX5tWnOhvE6msFQ7JjyM076T6M097NasgkMtg1Fvo="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20200712144210_1594565139927_0.1494932029095708"},"_hasShrinkwrap":false},"1.9.1-1.9-fixes.20200712144339":{"name":"@atomist/automation-client","version":"1.9.1-1.9-fixes.20200712144339","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6d1456ca63caddbbba81d67eba680704571b74fb","_id":"@atomist/automation-client@1.9.1-1.9-fixes.20200712144339","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-/RVU2DSTTP+71aa07GDInNs/gpkeCfoyNLSyz/NDB+tWG2aGVLNjWy5aRRDDRVg/Zfha5JtYtHGzHJij8McQqA==","shasum":"48252615ed21bd0ea78b471ede5301414aabfefc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.1-1.9-fixes.20200712144339.tgz","fileCount":1035,"unpackedSize":4644335,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCyJRCRA9TVsSAnZWagAAtNQP/iB0c0D1fAEOmjoFYg1J\n9cpRxmHlYFM8P+UwacZK72TWZdZ72L5fy6YdV/HZ8YN4ZzPvl3y9qw69wMIr\nZPrRFRSiwQSiXfRWAvlyABI/QxCITpf8K0dyrXrF6aUFB06wEuTeXL3BV1ms\nlft3to8tkAhsSO4WAvUMtkS9T46H5uf0hNbO/RG23+OJelRKoZJpxzHP+ckc\nmD8cxGuQoCJzCXkv/aC4wgjjndPwnyRCh9qIWPspiME+BBEkHh4kbF1kc/xI\nj9+sLyFhMZXIyVxPHJ5/pTFkPhYccCnPmPxZEQglTIWEOiS1ojFqXEibhK85\n0snMesKrXlAnhJfb+/UdtSkamI3LXTr5b+pKBorJTaF+tXIWD71Rt71b0jdD\nErpbnwQYzKnvACAX0WfWgXCmDp7BKBNuSWwF7geirdw1LuBi2vwG6BoVJ4sh\nz4Pc3+25oEkKP9SF+qSRbjhNwwXcFReQh2gK53KsSaYEdTJkHlYQFgX5gYKd\nvYQ0OUjf2NPO1IMNcy3elXeSVHr1OVYBhFBkdhaFZXwllsXL9tMkD7DNsjKa\nbzfN8lIJzU7iANJxktOO2paRpyCcE2pUKVmDD42nckRjVxYNf98Ssb6lmz8L\nmuCNG0JVND8saJb4VlonUHgmPQMdGg7Xfki1pt5EZxgxRm6qVRAh12ZJXuKt\nLhH/\r\n=kSKW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOXfeXejyRUhWJM1MQQ2QK5Q8vZlfMD5NpdFDk2jkFyAIgILark3aBYDtV1lEJo6uu176J/xx16Jk3z0U/QGxmpVc="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.1-1.9-fixes.20200712144339_1594565201003_0.3162282194892103"},"_hasShrinkwrap":false},"1.8.3":{"name":"@atomist/automation-client","version":"1.8.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.8.3","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-l0igQBMzubXihjyVl7SSY0D5fwFxuRNs5l2DsIuM26w12iepMJiXy1qPv9CkldYrockVArmBWCYOs852cl9zdw==","shasum":"8ec9719f21dff4cb0a33dbe090ff06b2ea111e0d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3.tgz","fileCount":1040,"unpackedSize":4613428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHAOCRA9TVsSAnZWagAAWd0P/A/cYV3lAEYGg6LsxQjf\ndXaIQizyxQR63EwSQ24R2NYWYAFLSDZaAuUV04iGU401JFmpkzfmrxjXBT/G\n7h4SMshUEN6mXKy8J8j1OYCa/aKgFRzQiNGA5G0Pio9csyPdNZ7mF8bKH+35\nua6h/oQrogLQgWcrqFsIsc4v490RRGPZMGd8ckdhOrFOVlQhHdE4E8eDRN4K\ne4/pRUBb4hSjxnVO25La8ItroZCaGGUD0j+xaxtShU7EO9aKordTtVarCMT6\n2Gi9myTYGDhOw0jGAQwLBE5HaQpyRrAaK7FQYZ4yd0vpOZwHim2zWBBoGOO8\n3vFppyQJ4Uea8OjL0VciZUsLdRW67oZRG1sdNyd6bZX4S9dRiAa/ZQxNjxY6\nFMSfagGe4uz6aZCjtFYL2rbSvu1VKDUIXVDymXicP9wW3AzFJ2PKhHvWW4HY\nFYHLhU3mcDvyPXAjDQMDJc4Ie95UU3e7gFP5uHj2B/7WYk603Fh3pDbx5afh\nXx4xwBi+v7mFfHQChlqQdocqo6cYs0Hv1p9c19vDmYugOdkJr3xXyFGq89sG\nb7LUCeIirrzHkX3QcSIfCKpK9DdLkMitOz/tvqvVMWM46wWzNP45oi81hags\nRY9s/nja9BF0SOhpgSnCD2c5XsmHuYa1/PKwW03u1qbD0v9bF7Lx+3CkS4d7\nW5r5\r\n=mPAf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBngb4KCgjojxX+MKPC+hlxCisbL0eAjd3sLlr4YN7+iAiEAkQPZV6IKFUVUvf6je8c4Gxv/AQqxukcdEZ01DwT6E6o="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3_1594650637666_0.9610990645448201"},"_hasShrinkwrap":false},"1.8.4-1.8-fixes.20200713145016":{"name":"@atomist/automation-client","version":"1.8.4-1.8-fixes.20200713145016","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"75a0780bab3d0c02bdccac68a4eb6d8efa178fcf","_id":"@atomist/automation-client@1.8.4-1.8-fixes.20200713145016","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-T7/2Zti1CPTDin3zXTTd4nj1MAviIgcOvM3n4rY8AbYPfSoPLl9HtqP+bGrgDAZmsusInw37irquXJD9UwzmPQ==","shasum":"6b56efde80717951d7c23adec35b8cca4b4176e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.4-1.8-fixes.20200713145016.tgz","fileCount":1040,"unpackedSize":4613742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHWVCRA9TVsSAnZWagAApfIP/jHq2nkoYTe2EJsrXyY3\nH+uP0rCqNLwb1BaFUz6BRcffiqBZYmKFMQXLKJyObttE9cLsS3Lm+TYVCpnx\nbcfo7NgXDKDkn4Sz2w2mUak8GjcI2RmmqTKbg6MIcvpVTEo+Ibg/j7xFlLw/\nvqJ6BwpIzDYC1+vjYhSg/Erk5TKj1ExymzP1QMxxSiBbjd9NF+zG/0SggueG\nxixfUFeXshrfv4n5BikNv1i76R+jSjw2k7FsKsC7sTEWhViW/WmoaPb8J0QZ\nZLRnwGxdeSc4RimCWn+z3rR6bn/CY/iw0VenBqIIkl3YBykFjWBBT1Tw0klT\nUX0QOEwwnZTxgJtoLwJol9R2ltA4uMdQGE91eLxVXwZCJREhsspuuwt5JS0J\nu/7HmeCQPOMNNMuk05Ycf2Z6OkWs1OYNFUwg9Im6WcPn5k2qRRvGHv/9qSiB\nlbh082Ki96+jq7g5EJbwn1mULltRBKs9C5+QZgc4XfM966DKyGjYH95suAVc\nRsNMwnpGaUJsjf4nCN1xS0o1mmraoha3xnHT64DL/6s7XxOK1gbH+oHcjTJu\nVlYkLYuocxtLE8syY86qnh10jf88eAU0hrYR4+FmePm5K5D6AeeIQl+fibBs\ndv3YNLI1qt7FH/irzw0wQ3WWcs0J9yiy3KOx8nvYaPkc4ArxihDWhjwyHWXk\nqp9E\r\n=k5hq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpwYD177Jfa1YS8JMYoikdJvsuZsO+Jmdv7yXXieyV6wIgXpvk4m0ooSFKNyKKaHhhwjhdQDFaUVBKdKb73OaWQIM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.4-1.8-fixes.20200713145016_1594652052619_0.3314272050657119"},"_hasShrinkwrap":false},"1.9.1":{"name":"@atomist/automation-client","version":"1.9.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"_id":"@atomist/automation-client@1.9.1","_nodeVersion":"14.5.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-7/5Ju/Hzo8yBsYOEugh72H3uqdcBW0Elk8TKyWawX9H31tNmJUws0ObcVdAuRChfQnH/MGVGARGwsq4MXzrTDA==","shasum":"46da295ac3dbd07b59b37e2ad29a79f415d03b0f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.1.tgz","fileCount":1035,"unpackedSize":4644310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHY5CRA9TVsSAnZWagAA9QUP/1gVAhOr0TkFR7ovHy0r\nKPX1uUUsGYzR7+WljavCowAzMGL92Lb8G8+bhorOn8H0xP3KwQbFuLI0qyJJ\nglpC5PbaczVydhhb/WyTvJyjNFvMfGK8LEMpECa4vWdWKNZgN9WAXE+1Ty36\nzwyoUvAMH3zDZ595A5nsxXpgiF+3ZDxgTeqkJKMyVpl+TTQ8IX3ydRcM8EHY\n1Up2femMmsEdvA8k7cMSgJuBxE/G5XanYRuCZbUeORiamFvxpaijjcOXkGIQ\nj/5r0d/LSoqvell2klxd8jCdlTnlXpwbOv0XvciQ25fz6T1M7t87axK8MndL\nPL+MVHruHsrMi5OGNxssICVD9XOvaxT6T9e9amqIP3h+2Rugqwz27E40c6vI\nmqct5AUh12mXxq1NIfRY3TBYB1PCEW5OxAVEu1uV91zj0ZkfWTx5YR81qEfK\nlsWRFQ7qm/qb52dUrbcKLLIY+L7DFsPp7zjb+axE/dNxJ4kkT8eceReY9YVY\n20D1QQP/I4LnJiV1NRyztIfrqvJYBUEJrxgy5J8ArLr6jy9XJIqxqfnx0Hd8\n1cN8q2B/2ov5M8Mpye6diLpQfVRZWsue9NCbm65JdWVzirZiHZ7qnj8BDyuH\n7Ul7g9a/YmpEtoo6gtagv+hFrKBaVQCTB/2vB5RhIZWe+8FdFOA/8skrbKNL\niSd4\r\n=hsy5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBWrbMHKi3Cp+mnR78VOS5zHm7u629bPCoXKKUAujz2QIhAIweJYSzvt2xNlxs+KjCOWd7IcXkn5O0+EQ6NDeRb4wt"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.1_1594652216870_0.7613228161166137"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20200713150815":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20200713150815","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"822d129e5159ae72f0a63708ada22e12c63de687","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20200713150815","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-KlYaVKip8i408SdSwLI65T1SbRUN66u720325Vvn/9U2ibLSra1oJ1ffxfIW9o/TQxkUXYuDe3k8OazH2PrMuA==","shasum":"deefe3863d81e51ece69b768fa30806252f77c06","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20200713150815.tgz","fileCount":1035,"unpackedSize":4644213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDHmlCRA9TVsSAnZWagAATtoQAJT8LxpeVR7iE3MKDq20\n0xjW2KNUsp9BQ0moAlynkHx22QkcGyXsBkS/Rb6Xmff4BcDxvyNB14ogsjyw\nVEil3WzDa64srrlOFGCmZXUx+6UvS9iPBJHpeDi8WxM5i7OJ81HshKrlTrpx\n0XwFD0AipDuwsUVR3jy/rF2mLiNvyXDH18blWnih+JOXQRpjZ1YSz1U2AMD0\n7wstaAWXpQUvKHqaa8jyHrRxah+xz6qHDsgYG9N7a+cm6Axx4Kdl7L8DzQAO\n1V5u4aACYaUKqdpsm6MBfrujFeXvNMfkX9cbWMUpM/BzMsKyWlJzfMhTkJz+\nd7odmU+mlOAQhxAXKCRfjZyO5Tl0VEI4ezoWYN6CZcfPXcRLK/oAkTcsANS6\ncizZzK4XcKRhBCxD9PzDWFwXzpQTwRDx988XlNuhtKkPuxyZOTAghb9XB2hz\n+Mb6lwp3rnW8shB0l9WtiDxmLFbpewd0OrQj+HZy8LEyHXMNDOY4MHEwTeFy\nKoGF3ZwPElmCIeZJFGGydPd7vFQcA7Nev8MMnL/QRE3zB8Cw+7dKdslKgle9\n/xw4LAuwEH/hOCHp956qA8THFRQsbUOZeRXfA2bBwshGhrGyi9vMAZ2ACbtc\nYZ4FyO+iTNx2MRK6q8BCLvxE6oLCrpeT6I7B4Noqg1Lsz57veWDsFjUw4m8k\nZpZI\r\n=KJnC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGrdU653T8gexmR1BTYvhUo75ZmYuYz/91sajMKuLSTAIgbx2Mg/SYh0ScfTkyZOeg/WFvTLdQc+1zbQCrof7e4vs="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20200713150815_1594653092623_0.9924825106668804"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20200713181458":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20200713181458","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7dca4cd88885d3fc6508faed66ee7b78cb089ab3","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20200713181458","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Y/C+sH10kms91HdophiZ5jRts9p1EYMAokBLCO5z+ssFJJsxp6FE7Mm0PPIt4yP+DDGdYkpOvPMRX+hD0VSapQ==","shasum":"4686c1bcb84ea9a979639843ede3b5ed6a2e30db","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20200713181458.tgz","fileCount":1035,"unpackedSize":4649395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKVoCRA9TVsSAnZWagAAl20P/0Qp7FRxf1pwT0dt3bJm\nYJ8VzRmK2WFTU6xG4YcTXYgus70CPJ/2/DIThuE6cwfVbg8vowc0TUeXvs5g\n5ZdZhnXj3RpUQzDsOjIaZxyoY6P3U8ru/Plco3ZR6S0l+5+NZBVgmNUawSKO\n+nLGPZfCDYBQn1/j4Jwk4dRa0V5mCECZ4W/fKt9Jeq0RdwiRN14yd+hAoSC1\nO9pTj8efnglurZXueBIuThCLuwa10CcQY9VOcbvW4B7yCPBGPZGv5MKMJm19\n/oN42PkJu8Kwn3vWPoh22nwlw/n1+3x0mXyY0Z8aFrhbFs9DKTpQ4XxArjt0\nDWgqIAzHYOVpfLAMgsMAYhj5XqP0BEjNqwGjKoAvKaNjP6DMwAoFoPBErF69\nql3Q4ex/Dt4+h4VCz86X7W0Qo6SmIqL4L0ptxfm8+vxXVsAsmApqyZLAmJyx\nBkhlhSH9ZgVNcXUgvcP2jTJwe3/6pwBfU7sxrqCJORsJ9+J+RCXnA1yqYopI\n6zNmaHRReRHOHSe2oqEXNGUKB8JcIedPw6MQUfroH2qDZ+IxFaPv9KtKCMPj\n6yfktGEDfoGUyfwyExM7tLwFrXP029LFQKEFfNHvJ1xHtUKDMFPXEW6QFi5n\n9rbE+Em/fvAhaICz2NeZkXOAaSaNz95SFVtMnnrZlfitlftqat057XRPx84V\nMV+Z\r\n=9gLC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxjRmOPjmwJ5C21mABsjJNSo9Xm3IKLxioGnoL2g8qJAiBgtX+LXPdEpdeBs7bSdjuMmuJ8565HyO//8csa+qXq8A=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20200713181458_1594664296072_0.7411955851775978"},"_hasShrinkwrap":false},"1.8.4-1.8-fixes.20200713181845":{"name":"@atomist/automation-client","version":"1.8.4-1.8-fixes.20200713181845","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fbcbc131f4d87362bbfb64cdc33bceb1d1671ca7","_id":"@atomist/automation-client@1.8.4-1.8-fixes.20200713181845","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-I247OxgyDJcnxXF3m89CK0GCVW8x7zQO6uuO5dUjpvn6iJL/fDITMmj89H1N8+iIIq1nVb2cbxkFDI7WJUck0Q==","shasum":"5178d481016d0d1867c111d7c64710cd1cd15fc9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.4-1.8-fixes.20200713181845.tgz","fileCount":1040,"unpackedSize":4613328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKZSCRA9TVsSAnZWagAAfbsQAKSn8PKQh0167sQ04Z6K\nCk9/FkvRUHb/V65sg1Cbk96U0ShOMldVZJ2EUwN140zDGEk3ueK1250O15vD\n9Ga9ID3/C4txsuSwKHj/thVS2Wu1gCQAyuq/fd2LPNGujiYmH2y/7w/1RIOJ\nzVm06+mLcGLeJ2RumJ+HHWzvCwOpXg6JIE9Onis/dZlqYBiptexPSLDHVMn4\nMgLtkLp6/kAv/l4KvbL4oSq2y4ESa9Yn/gXdi3XPN18GPu1HL/+vaN1dELui\n8TMmNbIrAwCpua/t4f35W5inhgBsm1J+aFIyDmqfB1eWAWzJvg14R6UPOflH\nfHTus0MEq0fxVlfU+9gPPWnX3HvVk9GbyUU9Qqx+tNZ3d49dIcEwnFaG8gX3\nOcIynqasxRCAdAG8Aw6LzZiTlntJgp7eGDnEV2ganaOBR83WlzwUS5d5uRxp\n6Qy2g6pUSIZ8J9SOKbfP6e9Eg3dbAv5297VzBtzddyzUerg2cCwD5hyK8TIU\nJADz9HGL3fnmCBQVPKxz5jn2XW0rZWxsbpC9Vbm941msAQ+asfkivrc0HsIb\njUDv0faFmS/1Hw2hW+U+8fuwx9+hhqu8/nhgXF81an8gvcIVgVOREwdXOLZI\niD3rwOMCy617u8XcTKOpTABgRmh+nhAHo5BgtPM5BFdVw1qnbXajnbPSCOCr\nshG6\r\n=qLDk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaBseK/KLI+JxXMNM/+Xfmrv2Fa7WSzUWsNWC5sW7W/AIgeb0jt6pL7HxBJtRimscBvbqiNxBjhY98Su6bd6ra/lU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.4-1.8-fixes.20200713181845_1594664529900_0.9778484941088026"},"_hasShrinkwrap":false},"2.0.0-master.20200713182021":{"name":"@atomist/automation-client","version":"2.0.0-master.20200713182021","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"58b0a9b288ad7cfe58e9318cfad64e53596b3f99","_id":"@atomist/automation-client@2.0.0-master.20200713182021","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-RUI7swkibfVuG/u028FqcNXEQwMJuw2iJ7StxNP9zn/sPkzRNnOqgXqkEwmewY6gg8JgKJmGpLjgg16gX5RqFQ==","shasum":"84a592f9dd36aecfd360c88a0a8cb5acb9ea96cd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-master.20200713182021.tgz","fileCount":1021,"unpackedSize":4323540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDKacCRA9TVsSAnZWagAAE7AP/2JZloD4T7JB+xlrUfvv\nFVISqQnXTkA0Z/U2NoLe9vKnDkrePTjxkyE0SR0VzR7LP4fTvl8soMAQXsLh\n0yQon+/ES7Fy8fkh3VmlxXODaVmEfdB/hxV8aRMYsxHHkqtXY5TYYY7H0PvS\nXXjTrW6ELlZRy8TPMHY52NdTfspxfVSYn2wc9eDIDcq7RTaQCHnZmqwbqOuG\nyR4lBw2IqwdZbGxfWMK6WRI4wE1vZ0neV6Nv/AU+X1HWr8QKuuCooAdU/x4I\nWI6vnx18RL/GMcn4jW1nM7SSirv4BQryvAskbLUOTFrljezjAjA7wBuccx3m\nWySv6UgNkAAEtFQZ7evsM/xRAA5iajU4bVYLTwjGhCcp82kegUOnRJ81WDJl\n+2uBFoofJvuqM47fsHU+QPmB/LPwu0xXcrhjf2ASzE1bNCzY8HycEw84mDVC\nm6pEfUD8qf2rz6lH8kNvXKjbYt5v9R6v1V8bXENTq2/aWQW2qjWeWv95V/9s\n7QFZtWtXWtw5o/thIXCkNEYSssMYw06MPA3RUNS6oKb+LJr59n7W87xPGpqg\nuHOGhbZggLzwDZj5l+KZNSFg+9aK0Ud9bGPfFKxcYtbVAg50IgVV/A4kjfIq\n6nvRGsGlvMv47WkEUDc9eeR+S8wFoy4FBcW3E1xDYfRJyfeBpO8tzb1bxmY1\ngXQ/\r\n=jcVh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXz1N8bL4g/ezPYtK2WBCAhXWCnsEr8aTHAnYpnNDevwIgRRs/LlkVw4mthrUnnebIe+N07NDoiqkbh0V3dB8QwMM="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-master.20200713182021_1594664603768_0.12695622623415104"},"_hasShrinkwrap":false},"2.0.0-main.20200902195500":{"name":"@atomist/automation-client","version":"2.0.0-main.20200902195500","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^8.9.1","tslint":"^6.1.2","typedoc":"^0.17.6"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"39fea11f118c4b8cc118828ea13d5716021882f0","_id":"@atomist/automation-client@2.0.0-main.20200902195500","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-cP0StE+PHA+07sH+f8vmuh3G6z4N1F+iYtVIUu5MiNeT9xYz15e/FFKJrtQ+GiAi1sFGBkLsomXKLym7W0C6NQ==","shasum":"9f07551120a776018066687f338bb4b9b2509d11","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-main.20200902195500.tgz","fileCount":1021,"unpackedSize":4324100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT/mlCRA9TVsSAnZWagAAXC0QAJnbSZcIU8wdcBjGKU4m\nVvYQg0ELZCOK25tNnd+jcEY0QHii6WhZAifbNEQSgc995gluSfnmH5FUnw3j\negI+KbbGZxuXpXq9Bp3v18M20OywbbhkCKCSz4r+OUm/29++JEgP9oGKcl3v\nnssfQ+/DVJZJS5zZJZ2f+OSvkdB4C39sL3kDFt+WWQa/fD9Sc9cHEGcv70HM\n80N9kXLa1GVzMh1VBInGewH+f2gqFL+Hf0ot9ZJm2ZyNHnKfvTqslkTBd/LS\n/egIoanXMM1T/AC1M6NvY936W6rQw+L27bt2Mzq/dN4mZvxZHNTu061BOuPb\nxPZOJsDR03bhT/DJs0Q1bhNNzctEb7L0Lv9KrouAeX/pN6faC+oo4NwSu27d\noigCsvyv4T3EWCiFhAgWd2TeytOYsCw+BfzhXioptM/Azf4ott+SeIB6mwW1\nn5dRu52xmeo54XYZp0OV669TY1UnxtNlWfpuP+rZisYZBUUP4T5XNu4Y39ON\n+Zi4AD/2f65L3Spcimzs3dr0i9rLQzte3GNGcCKyersFRsRiWEn4vNstdgj3\nwTvRVT0rsgnxjIy5xcJtlVCPdxec+of10iiHoFr75sXR/RB1sgv4VhusOBQy\ngpemGDte42gtxNeZCczgbVwOMDkSwT351h5vH3ViX7yJtOMFd5C9+cExQ6Fe\nEb2C\r\n=VlbI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFM/TeoQd3fEf5RDe8LG3DXNju73MowPXn4jrCAk/fjgIhAJVrz7Y8q+zlO9lprETqjNLXQHlIVPkuAvANPyQOPeck"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-main.20200902195500_1599076773207_0.27809576583019835"},"_hasShrinkwrap":false},"2.0.0-main.20200903153220":{"name":"@atomist/automation-client","version":"2.0.0-main.20200903153220","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fc02c4c66aa0f7868a3cc48bd00eae3192889d34","_id":"@atomist/automation-client@2.0.0-main.20200903153220","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-O7bBKO46ibj6OZkteD8vcZxuVaVs0a6FGUtrOHekg07+UN7pQ0/ygDvBj5XLKKxpNT6o1u2uL9dED/x7fIwtdA==","shasum":"92b85d1ba4e39338814d44dc7c31807139e6c491","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-main.20200903153220.tgz","fileCount":1020,"unpackedSize":4285027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQ10CRA9TVsSAnZWagAAwsMP+QD25m58JCV6Vl3W+f4H\nZrz/WRv/hopgkUx74Hh8ui/cBUenp05FNaCsFTioTADFBdCSYRGhYozadroq\nHQpvdUULS9WFrwkAcpYoUPXeAM7MwiQogB2KbVgPpIIExx66/NfZMhHxj4o3\n4DudHTVR2zonuCTmnGOABL3SzGNwuiiM3gJy3VhIn7GnQtKJZvs1Q4FS/WR5\n89f6096zV9+v/sD/hNai/PKYF8irhtoAeggb4tx2j8luydm+JG+7CgRlG3Rh\nmuIvJw9diYVDarI7Eh7kXe3CHwYyQFNTsSJnV/N4Ssr8hyhZEhwvrbYHqv4j\n+PYAAkN1sNgzIAqkhiM8LSlgtnt5PSx+EPyBXfCTOWvJ6ypcreFHiso7MZ2T\nJp/E5padjYHUCLpfm99R577IJ6bsfiR1MZPbw46W6NPozmQNkCVzPcYS0ZFv\naLGWkvVz1S8s2rbTHnhyzqDHMKJC+N3EWiBSo9T5x9Cume23nRQA1fAG9Y3g\nN+EVhHxLVOSyq0IoWyqMBc79QpaYWgXiilHx6ff/DTDpN4zWnO0dy6Q6Tm2u\nuHYmHr5C21tTzgFrESqk86MBKoXlKhZ4vNVy6lCsAhroma0HHxnnZAW61dKz\nDxFyVf05yw70qxIsxBlwc60/2oVAeWBAd4UxVyz399UF/LV5sipw7LnV8nnC\nNFXZ\r\n=o03x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/U/cnFuFUUFLEL6JLIMOC1nXKQTZYw0WKdk8vOSqNmwIhANRyYa2xo7Io64b6cgLNTGgcmCeNFbpbItgfKh57S7+5"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-main.20200903153220_1599147380129_0.9376732758882131"},"_hasShrinkwrap":false},"2.0.0-main.20200903155129":{"name":"@atomist/automation-client","version":"2.0.0-main.20200903155129","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ddc6306283879751988d8e68f58342f3684fa9c2","_id":"@atomist/automation-client@2.0.0-main.20200903155129","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-rm1twWpra+tdSIUx3UuyRBgz9xnGTjUt38DCojWd0NpjapQoV4OXC0pRH4Elzd8CaxMta9P08yeoeMNSMe4EVw==","shasum":"3b53b00254960f7960c8594224f2c7b83d549aec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0-main.20200903155129.tgz","fileCount":1020,"unpackedSize":4285027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfURHgCRA9TVsSAnZWagAAoRkP/AyqUpxv0CYbru+s993y\nBWeR7oM5jk65oZL7vqU3rNi6mWe3Y76h5+xfwtqqaQUzCK6/lnEQhO0RFhkX\nnB72BRPSRLHhJxgusw0wZF6fR+q7w4Zeojl7xNWPg0TWhokPoXXXoDNOU4wY\nTLRjMQOHK3Q9Dmm1TlOQcue2cystw7c9l5O6QHmb6aCFFKmllW1zcc5pHIo0\n5Nz47AZ5z2Eqa/tpdJDQv5RQ3Z1SPSVrwHDcD0rFo4y5VyGOY7J0j4JviU/U\nN3XiFh3JjZTiAugh+QYU4BQane+yrBIjhnpOHHHXZJT954HKfv5cEJeb7RPG\nxYiMAK8VEIRn/gyCoZ+P4TLhqF86p7xeAM7rrHNGwgO0tmRBb1bJFBorv4fR\niFqkOXeUDdlZM9/1iTaB2A0jykEL4rEexYUYL6YpLipqFQIvIksaqi7Gejx8\nysdEVVwwtt8c4iAj21ZN21rIT8/dglXk8FjYADORNRpFzwQExz2h8XCK3TUZ\nxO8U6RrGcBhuLtjHtB4Q2lY+ACvKh7CvbFOg2yc3iGSHgDJfy4xftrFv1ucN\ngH7vQs0a/clNxp4HRwsDDVbpV2KXqYUJmEjEETw6ToygLJEfCizM1zMbJIiu\nkT/CdTwFM+3syc1BwEnfv2cbtmA6TTZfJY7VOKJ/UCSYZ2jG4Rd9qKKIj5z5\nao9t\r\n=Bfdv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHM/5dwrSe6Y2NLJ7QRPRijSI5uMK2kAOA3m6e5vIGmRAiBdA3ie+XbTz0oHdLGORRvOPS1SdxDE8Rw5Ukc4NzpNHA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0-main.20200903155129_1599148511784_0.4227253622571516"},"_hasShrinkwrap":false},"2.0.0":{"name":"@atomist/automation-client","version":"2.0.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ddc6306283879751988d8e68f58342f3684fa9c2","_id":"@atomist/automation-client@2.0.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-r8ynlxpCE1tzQf3zOWhiKElc6lDDpzuIpeVbn8jWLkQZkIX1FZWokyieaOs6lsr13u4MOSsO6VDPM9VZnt8OnA==","shasum":"e82a804055276bf8db2f2d1d7c0d79b66a5c5c74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.0.tgz","fileCount":1020,"unpackedSize":4285007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVXRCRA9TVsSAnZWagAAoBgP/2sdKjs59Ivs520/vnDe\nosw5enQROiQ5a7PEq/V5IZP4mWZKQ7qy+eSPg1Lo+7V1gGt+p+atdnYkr/XS\nThw7heKcpJU5TFp6d+nVNh6Qrd0rhWpcERD9rRdMm7IAqPOaQ4ng3gRgNjqu\nbN3z6yu757xS9/bv5yEtnBt5iwB+S4FctnSInnya6CQK2okMrYH2Vdqr1Tgy\neu66vjNf38OoLS5OLg/UBEVIY4XCeYOWWpXdQyayChDWOQx6CIbN3v+rgqOJ\nnM2J+1dh3dWWFnIu/envGEAI9YGb9JfMj/TqBRqswmFt57jRgTZvmjIK7pTt\nsO+XK2HLmzR862wiQbOtGRTS4m/3elJAO91RoHSrVRDSZUCsjRQTIX0rB3oL\nX3venufD9Eb3pQh2gbNUpHYuxyctQLHCTpRB9BItSo/vRubK89AHeuOVTSII\n/fPMS0cMa0v+Xm3AE+FqTFCZ5LPBSgP39kTEDk3UYMiQV3Kv4fx4yCEOBGXB\nTsqDTOgB7XDr8vff2HOWnvr9FRgIWWc1fkaXNp70J/Ii5FsySufh9Jhi4MuZ\nJ03Hl7l7LgVrNF/K6bO6DSpWxh2NMEEbQbX8qMquhfAFTsiM2tjymoaQxbuT\nrw2HDsyInSqFI5CnGZo9CGqOSMWuAkQLbMxkqrRjEuDs5QIV4Y+ffJyQnKUi\noKmI\r\n=hTMp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9t/u1ulftQEoy74Jx+QDr6iDmwE21fzdS719NKlcHJAiBol0CWim2XVR6nfzMMmm8ddjsVuz9RN6TNRgqBKnr9Xw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.0_1599165904514_0.4287804807600848"},"_hasShrinkwrap":false},"2.0.1-main.20200911191622":{"name":"@atomist/automation-client","version":"2.0.1-main.20200911191622","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1fe9c98081816cb8d9caa2f9150eb08e9837e5ce","_id":"@atomist/automation-client@2.0.1-main.20200911191622","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-U6q2q7+z3zbAubx7kLhPzNarMHfnug8khy7hL2N86ydBin+2McCPYoYT3o58BAMe16bH2w8mSkW+l3XdJqNBZA==","shasum":"8f5e8a202fd18abf1624bb39f19bb003ce710179","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20200911191622.tgz","fileCount":1020,"unpackedSize":4285545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW83fCRA9TVsSAnZWagAAalQP/RWj4wTFnIgi28lyXO0B\nIML67SzN7xczW9r1Rr8rtXjdFQ+YeGmsLYDABp5tBOSSuunaJq6jjZLjQZ/+\nG6dMVCmueD4FSyjZSQx4n3ofZTQZzCvJHZ/mIPPMRFhu7c48joOujTw5WPIj\n0b1hFaGLM2dtcxhpopgOFGlKI1DRwHVyjL5ey+34vV0qizrTGRY0v7W8DDg5\nlzOdMdbKs0Erjz3rsxI9/tUlcM5SdG4wf8cMVpbqPq2r33pHOF4K8Kl7/0W0\nEQJ0/0QQhH7YTUGLtR3WEu8Xmk/9/IvBWVfyaLFfd8hvGBKKxkxaAYj9ENPs\n2LGdsirD4r0VarYHDAG6ON6vVTsdj4EqXv/Grtgm62L0yL2AWCSWnEPKfZfO\n5hSl8f5D7oB54MIHSW7XmHGbtCQ5Sdti7LsQ3NCzEK3rFW9JPCI8YIqL7q8C\n8A8ntbadvph/6Fa6aec/65nIigGO9mjIzsiPUkZHT8eLXL+vuGSlOi+N7G3j\n92MswH+MaCzU94ov4Z6Ec0CkgA7eEy40xKvis7v8uBCpm5b2zOFaef8BFJ1D\n4rEDwEJAr7hvKYUHst/Tzd/hIUHaYmm5Tm7e8tDXqo3/P8sepw+ngrnQgafk\ngZJXQkoSgfJxNv36JEV+Z9/1uBsID6aa5qM6dmTP6em1czQYRREh+ghvHn4F\nOvrN\r\n=95fH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDaDapL3WPHwPyA63LNIsGXZitYVVZeVLEampXlzRRoQIhANOMM4bNBTvIDV0OxHfOWdOj1BOZEH/mgfM9xyCQTkHG"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20200911191622_1599851998396_0.2565265236744798"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes-bugfix.20200911193956":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes-bugfix.20200911193956","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d13602e88f00c8616ed7ca8e0c4dcb6cdabba5f4","_id":"@atomist/automation-client@1.9.2-1.9-fixes-bugfix.20200911193956","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+61t4+PK/dCRNSD//EHNi9umoAsyp0a9taXywiBq7wEqWBN3/s2FA/7uAtQq8dW4yD6KpBs4I8OKohClH/9vZQ==","shasum":"d10f2907673d4632684132b35d2fc3e5b726c591","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes-bugfix.20200911193956.tgz","fileCount":1035,"unpackedSize":4649844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW9NtCRA9TVsSAnZWagAAzxcP/inTFeZMk8nLc8oG1HT2\nsSfpSGGfnCgYx8jd1Q/sU9u8PHw2i74JmwPWc/4biaaAFT92dYgdMOuuDmx+\nsyE+ufXvJ67+ewXgB7YqL8Zq6zGHxN79flLhsS1jySG+6rnn+jH28Rzpzzz9\n2evV9yDz1fFbmck1Ip7WTLILqeYW7eD6kwz5SIl+SAjOkTpwWPKcFQtyVBEH\n1s/iylKBAGlD2j9BB+3Tv8ABK0XrWJGsO0JRUBjPHiNKZ0b4GxLa/5+XNQJT\nQB7ujWNQmukehkMMu9bGGy3kw2I3kdUNWQlwr774MDwWiUt81Lb4ivX8KGdI\nt3kGH+mzUdtPM0JoSuMpDubKgI/Ax691LRxRQmTAl4hhog5lkLyRMB7pEDuI\nvUUvLLwXrmcW5ljIqXqyHtiD5zCWrr4wLbmSywUx5xK3BTsCTWnXt3+kVg7W\nbaEFPzRbr1mg9bVxJaJ101CC/7cSnJrolZwq07lWO6ttgYJNQU/u7/LgNvTE\nKWi0kuWKw5RzXCIQERf2lg8hxwCA6mz9z7T52VRLs30XEcosdrZ0L7vs+IXB\n89DPE6Gi6Nvex/x3YZ74OLlvRO+DWufVO9dJjWAI4g//PIzw03r8Nas2m6dv\nDnpnqcbJXA4YOyokJXZ7QraNfm3uVHL6lPgWnZ5htnKJp5GKfi7F9bz4Z/uJ\n21gZ\r\n=zfv/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEfys3TH/4Xk1seiZtlpVbaKQlPHT8pEIUMM6Yav21y1AiAy5IUWzA1Vb6ZlteiqTA+SOMdsVezKIYJt5nsNaynuLQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes-bugfix.20200911193956_1599853421144_0.6628797722359712"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20200911195813":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20200911195813","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"68a1fb80989478a89516ba94cbc2e08a725c3558","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20200911195813","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-q9jb35S0noRTvLvZt8vRZg4gF8S3pAa26QJ4RBKU8Hz2i9xXxBC35cApwH91sWt9LVJE8dFMSPMoNWXeLslMRA==","shasum":"c978a81a70bf4879198ec5ab9a0e805c061dba6d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20200911195813.tgz","fileCount":1035,"unpackedSize":4649837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW9eyCRA9TVsSAnZWagAA6sEP/1/08G2LD4TrOH/Gcv9D\n8GXdWk/4M/cCoXPsyxpZD5sMJye792FJ5SHv1P7fQBuwDWYXJAtSceS5xoTq\ntYyvddS+KhzqA9DnVbqKwH1TbWUX3l4KEG0USkXVnHRFmF1dQlGG9BgHxb+A\n6lxeOwJRf50zWW4BF3PI/duuIhWPbxGimjLHVc4BQz5pp2iPBfZtj0XOZmCP\nk8Dg+QaEvuaocpmbZzOr6BVhX+kOLNzVJygfjjtVNAssR2lG4yv47hP91P4b\nW4FS26cz7P0D5cGfqAh3slyGfhm38sW92+P8SavvsJ8MKKm4zW4N4amRW2XB\nG3DYoPmH64sfy7mzE/uJAIbhzCmG+BjfXBMWKD6qahFweb9dwBRUQoj3NtDx\nbKOVmN9bsCaUmQO9VxANkk28kz9A4ro/dUU6t+Fn/qEXH51BgpJPeGsk0Gz0\nWR6b2+BF7HGVKDykX5fhVwG9/Sd8OY0FnvxiH6ExkGgRIPcFm1M7afgzuouk\nYf/gdR+LRCNFUYhphn1cyI+oioKV60+N7xnpokfIwA2MfVAwbGfnxVvGxYZ1\nzXtqtd+8mnxk4HSyvw071LW5CGHqVnSga1WTCWV0T8kdBxtpxt3vlIGahQmq\nlpUeUwHkv5Yhf4INi6ygQ7SoJiT6UrBNiQnVKcr5Q1DtRmU/vm555xgKEEfz\nWDyx\r\n=cx5T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHKuxJBCGT/KpiwCXljiW6axNKfEshhh4RLmSKrY4ZfQIgWRJ14XRC0QgHbRMsEteo296QRK3Z70ge+52HBib6H/Q="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20200911195813_1599854514371_0.7995693108700492"},"_hasShrinkwrap":false},"2.0.1-main.20201023121815":{"name":"@atomist/automation-client","version":"2.0.1-main.20201023121815","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"83341e2a906f29272e328473a8ed6c4d6de3b8e2","_id":"@atomist/automation-client@2.0.1-main.20201023121815","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-UL5zbJZoNfXgwmNwv4Wy5B0aHfJJ2taRDdQ6kn9zgu9ocWrTh3fn6Y8p+byx4O7CIIn+D7BNrBdw/HD1hYV4ng==","shasum":"c4a881801cca670ea724b4c2e709152d7b11db43","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20201023121815.tgz","fileCount":1020,"unpackedSize":4285895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfksq+CRA9TVsSAnZWagAABHcP/Ay291tezilYn3BsQ57I\nh2iOcEb1Eb/D9vKdMWhS0P4UYQBvSCqjwbgySCenDE7h/f+id1VDvR36L3Qp\nPSlvliis/dPqlbzU8U66pieYol8d/VW6ykIcMjk6xtGmU4JePS3SUxUaB2zL\nWh8YdxZLhQuwKQY0WocUiEMDuaEFWXF0fGxRAwsDPfEs2BQd8AT4zHnAg1vs\nVQ1Ned9N3aTp3NDn7y3UiX0J9DjraQx0WqFJMQE9HsDap0kqBGsO852QqV9H\nNddli3AJrXcZvX7ju5EpIylS8Fr0gr6IsBIkHmTocjEpov4O16CCQ4aoUpcW\nfOv4UDmp7idIwYo6zBkC0rNLLJjKKNEJqhKf04tC5gWZazgkvuI5p4jZMEkg\nh4ZcVO4C87P4BGMVR/R4hbmJZVvjbj7T1A177eybIT3/N0BUjg/Dj7iu8OWP\nwMWqsxaU9u3ZHbZOt0xiuAqU8FR0tmiJvgtVcRbjgHyuPDYCGOVEAoMtfMMX\nkswN/AKeWcVGztbsQhI63gxldtyXOGWMFOcVO+R5FWOvmvZbn4mWcKrzFzfP\nXZvVHH/8d6IO4OCQ2fLdycxUMyhvQCtiJWktCq8z3y+zvDvwO0L8PtpKak6U\na5kU6O843RnyTtnbeUwpWD2cd6rI0p0fc3JoSFBh9T/ERoIPKGIe1SP//86y\nlT3f\r\n=FjA3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUIfk9pANxBfjcrL7eCcXAs2/5Zkw4yTU5vKXiFOP2NwIhAKEBY6aF3ZMtYtC0/rflWtSnJjWKpuazy5RHAFbEK7sh"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20201023121815_1603455677871_0.18172740335480464"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20201023122700":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20201023122700","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8edda0aedb44b46f400faf56d46bfadf62a4da19","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20201023122700","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-SmV5eQ8mw+fo+dCfs4xFoTF0u/89nue2Dh1LDD4tlUJOsumX735QjMYquTg43UlUXPuZnUb7yVC/adxyc2y6Zw==","shasum":"a285a5a16d6a92b130bef158777c2b6f934a0f0d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20201023122700.tgz","fileCount":1035,"unpackedSize":4650110,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkszJCRA9TVsSAnZWagAAV/gP/12kS+ylRb6U+7w0hpB4\n5bP0k1/U+vFp6lL2FnGP8U7GkFM0WbRd0WZOwZVGdkpqyabD0ovSoEaOby1k\nsa4Vm/TyAIhleLaoS5MhkQv2moacT6kWvpEl3ooxfK8qGGWbi6VyRFVABCce\nIBMd/ImefUZM6QChMt+Tdf7BoA5Qu6z2lI0o11f272H+4/hgsDy76MOXEfD/\naWTBQB/BMZN2rG7PHRQSisjRnSc777zHFNGEefNn1U8Bs6ZqhC4/gPwsbgx/\nx+P65PtzAWOzL09QPJ4FHnUPo6fChYDbHF2gccuFGMEm4Pfq/g50HS7gfEAr\nAw/+CGBWARDle6S4rG1ozg9FtqjYX2LNGwZoM3d3/qxsKmA5pGlAfPdv3l9B\n+AEpt7w76ntJ+AKMAiVnYMf4D5ee5ZoTXhoxsCAPXnD5BLfw+nyjFeyPlT7y\nfZXTeziWMQm5K31dY4Dv35Wp4cZThi9SKQHLTlo8GZmfL2+omJXpV0ZLgeRJ\nEjBXF9oL1ldVCL5F4wMMh0DkOYa7Z6m3u0mEG0T6IQ72SMZeS0Xk8f7A4o5s\n+iRdxFVA8Ovm/CsxacqsikLlcsxL1pTbLCLobuc6xoYbvxwx+z2XDLwcoOIO\nsuQLpa+0cIMpgpTEfRz2Qh6/VK6JTm4Ia0v6t85OIk/J6174pLl4qBHV7IYC\naCg9\r\n=eWj/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3EFmSvXvqfwBWkHTOts/J3cKKbQ6VsWMSxQo/aXeDhgIgLx/nwtV63X7IMjz6xpCY8xljueHcI3ynjv7mwmwD794="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20201023122700_1603456201076_0.5024606348455374"},"_hasShrinkwrap":false},"2.0.1-main.20210108042626":{"name":"@atomist/automation-client","version":"2.0.1-main.20210108042626","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0e21adb728e2f2505efc22579e1275c05c254ff7","_id":"@atomist/automation-client@2.0.1-main.20210108042626","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-pNxowxWvO3p8LtbDrBWY9EXTstbcGTbMn6JpdSZttS9I+aSOeb+L1NCq1ZeYUA7R8rdmrfWpAou49//nYZXDeQ==","shasum":"0c2b9dde66eae182e33bb52a6a3f24a936141466","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210108042626.tgz","fileCount":1020,"unpackedSize":4285892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9+AjCRA9TVsSAnZWagAAoZ0P/0+4EhSVjF8PtGjfMpZz\nYJyn3AHlB/ThV0wg75L8HgdYnZCqu2QticGdMMOdF4pFBQy1QJ4J2gz1j5Y/\n8P9triEL/fO/6gEzs/rvGkBpkjt1JIRrwa7aocq6p1YhR8nRYHmfdQzH5+Ll\nYYj3LepiIW4LbPyvyOX2zc/3DjhATvHLyyMfLyQBDkqZVr+tQCL5h52UEBQ5\nb8jj2WMQTp3OnZFZ07knbUlBQ1IFPEtZWZ1Ttl1JQ7u9C38hHocKtmbJ5PYY\n49jVq7J8jIjVKKfZd9Ho0m6lq4tu/QDwv2+Gaa5j51RE8I+7UnIqH/Uu5HQx\n3TLIwT5gGtMPH+UbkTadFJrh75BgqZwBxyZjx/yXPnEXeU8OzT3u5AkEse8a\n88+lPymLgZAQb5nwVz2r6SlMG/ybWS5S5E9cHQ7YX2Cx+T6++MW2e15rx24x\nZDZTQgY32/S+KxHSvlPi/oEfO7aPsPuQq05b3+erJ3IkNu+c5vlekIVMXTpm\nP/iJyPt7nWWHUunfaM97WQJ5/T0pqFBKzfumJmMwuc+uY3KP/QTeEbfMW2Wx\nZsuSluzHfo5RXCfxj3wzVG1iVac49qtD3DPyWqL6YF034lMlF77GRECJ9D5E\nYNDNjIifh0MfFkk8dwYgHkkPQHUJY2LJjVREfCcD6O6Jgnca3vxHK1YyELim\nPOEL\r\n=30f3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4ycOOINhElz0h1Fq967BiDLBPiFM9Bw+iTjmpDo2HPwIhAJOkCZBEp/Wh2up0aoVFJo/T3VstCBS7m5zsaUYRqPLx"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210108042626_1610080291341_0.7356250481662936"},"_hasShrinkwrap":false},"2.0.1-main.20210201171452":{"name":"@atomist/automation-client","version":"2.0.1-main.20210201171452","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"200d99907c85a58cf037903d7e2cc2a9e02e6cbb","_id":"@atomist/automation-client@2.0.1-main.20210201171452","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-GgLM5ZILdth63K1zjfGm/YucF741/DHClaPUxa0pEtoZRtp9kxZ2bol7WItjaUHebRCBAvnEZBlHy7pl2NKk3g==","shasum":"db355d81710f0dd08979fa48a6ed20ff16cf823b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210201171452.tgz","fileCount":1015,"unpackedSize":4273523,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGDe/CRA9TVsSAnZWagAAyFUP/2Qvm5lYYJ8r9jnyfl+s\ngdEOPXOmdeop5cvCtQAFIxyfvP5qD9Keq04Mne+PQE71QzmBSNhMYx+8zvwQ\nPG9qugode2jW8T8TxdOdYtLu/RS9d+LDNXgkEO+AH+nt7DCZ1OtdsCmcxCQA\nOzAuyIzrrDVhMKAkJPSu4AuAnlCFuA+rGc97X0kRW1h3o2TJrK18BkHCoK0S\n45zGIRcBV7BNKuR3sPFo6vZoxbpPHFxQj157xML4/pQPW0DH/7pz2mT6YaGa\nvIk08RCGif/YXjunZaOeAAsnYI0h41GenPv2GrXsp61JlMfWeP6V8jduYHLF\nGPJPCYZWzZCYZhKR0KLDytvnlizPS6rIKOr+/IWsBIRmhUTewbytXzrUmMfu\nID+By85lIoHTWYsjXniKls22Y1Cl8eUzCVcN/8GsjYdY5MVts5JAmYV8YtXc\nzRErwm7alrzITgsETbfZHWDRQ+pfSK6bjfDpRzcFznSYo+B6xbVeurZBTNt4\n0ZSylCDn5bieO4QkQLqxjwYuiTyqJU7R46QwEWQgD6bzGPdmVJmSaJk7Y4iz\ngMnjCRneqj6SQWInW3SDEWlMROvLjlKDC5dzb4TmlhbKbu++C4Cqj666Cjaz\nJQ8UmnfcnGaUD3p1BDX0XL68HHbWhrAUmexOQ0XAuHLDd4aGvyMwYfJTwsnY\nAn5m\r\n=rd7D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBI+USLzrxULVRyaxABxV47zGax6kujEBxiUcknMqaZwIhAKDxWuuQ+q3bqqySBataIK2trdaHODi/WuHeEO0r8t9q"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210201171452_1612199870904_0.3596973447111098"},"_hasShrinkwrap":false},"2.0.1-expose-http-base.20210209141440":{"name":"@atomist/automation-client","version":"2.0.1-expose-http-base.20210209141440","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6edbbdf2fcbf421739d85cb6274423e82bec7964","_id":"@atomist/automation-client@2.0.1-expose-http-base.20210209141440","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-td6M6jLMWUTIkJOF7HZ8kykC++kgFkdOmQM7lFFoIGgY5q6z3oOFQ+AXbBKga33yL5RI0MDcPhKMSTnaFAea1w==","shasum":"f6e759e88561fc094fc97ddbd1310295c6ccea3f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-expose-http-base.20210209141440.tgz","fileCount":1015,"unpackedSize":4274847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIpnQCRA9TVsSAnZWagAAzq4P/A6vs8jj8tEZ/V3U0KKd\nB3FFKkaOzVhZ3NLfWWtkMeZGl7GME4SDCY7Z8nKFTJFU5cyXKdKU76hACm/p\nQIg6d5y8didJWkTDZQY/63l6eROd1qTqDkDZd0LMUvKjngnFATtHsZYPVn7s\nBBJAXQX37FPg6TrLpM8pivxBk7q/O5m0yZc61G93qDd4/9AksTfDrDsGY5J+\nTvAAq9mA8va2WUb1wl4xehp1rmu79tacBlCrdYyfwHXO8CPkkKVSENWe7TZe\nQ+ad9u4G0jDVmfLT1br+hz4HUxKqoNI9E3GdVkgStMzDUXcDEtDc+QLAQl1W\neHFG0IjsqTGOX5UyWRF1dNvCCSK0E/nXnziasQBD3M1rEBG9c+HkQi6NJZTq\nxnfR2G9bkF/LcyBYP5h2JfnjCa99R8QaO2Zo7YXu+8+3RXETc79kI7czZj46\ndznmeizgGyr4/5DCMojFb0/9MG96Q+SCcnRTxYJgZrg/qFYU08vRrHTIEQ2T\nhhHKzZSkKSTZN1s0U51lzZWa+HyVL8h3NNWFnzD94RK3jmYH6CzdANGRD3go\n84n2cefWMEhxnKdK2xPcee7+aTVec6HKTda8T2EeJr5pJVunSa1VCI9f3Z2k\nLOuWfw+GcLa0nSxDbRxxnh+ZkvhFZw/nwXH6+47Z97IXusUxGn7TFjE/PiQh\nEhFR\r\n=wkTA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9DboOC+rnGTm4r5hqH7M22M5X4G11K73SKAkA1XSJwAiEAtE/QzLyFQKzzu0V1qNKP9zGoO51PKsVH29qxw04lmMM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-expose-http-base.20210209141440_1612880335357_0.2666891787843757"},"_hasShrinkwrap":false},"2.0.1-main.20210209141900":{"name":"@atomist/automation-client","version":"2.0.1-main.20210209141900","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"262d8fdc5366c4fdf88ed7049e6e2d383abc3844","_id":"@atomist/automation-client@2.0.1-main.20210209141900","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-CyLDI+y7IXGVLs2h+X23Rt+UDJfdhPK7CC9f0Cdyv6EwfJu/GRtUyIn4x6Hnv8VivcwpgXyZtVW1zEeMk9CW5g==","shasum":"a3196c372e32d84d91df580fe2bf8c93e0ce7abc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210209141900.tgz","fileCount":1015,"unpackedSize":4274402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIpqBCRA9TVsSAnZWagAAzQwP/0C+3Cr+CSp1Qdkwk66e\n3Jp6NkoCmv48ohWmZpmPPQ1dzWSC66/Qll2S1RQ1hZx5CaTNN7L7kYXwWvWn\np0skEipBP6EF7ZygJjsuXaFV5kXhFUGoIMmWOPWctphYrSZyKp3k89+DCQYT\nJdo6mtXruiDalwLX0vnei7hBrmiLvW8xH2vGUSyf0yFxCndN0NzXe3T4bQj1\nAcMU9G38S+XMMw6KAUtyfwKh0K1obNijCVmUZo0mECS9JuiOH2Q0XwVFUwjx\nYnFoxM5g6LAK4YYfcv4WNJHbmHaqolqjeO/IE/TAdFCPqCGShxEx+go8xELF\n1N3HtmS4U5JjnnukIPVKBAu8GP103NnXLvO56HsVKl9sWpNcKg7Jr4Awa9Xq\nMF0ngBCVLVGtLnPp3m0Y6I3U4kkd+NFVwpELb65r66ZpODWqkBfDke7MsIF/\nFig5i7esX53+wwfScsfkL44hN2MlgvQflrkfg30C9hCBm5kvHIDYXkAojkS0\n0L8zW2TjCvzVuDOgXEloC20KdCLznjuf2fnZIc6tiB4bBcrGj62G+AUL8y/u\nRRy/aT2Muaen5aZvX0/3smxGAqa6lpupIUF4hMHUgzIhD32FGN+cJScVmYPG\nXtrG3QaO6isJz/KorbUZVeqOqJpgbTt07dYS/DA3m9pv1RRpPidnEw67wvWm\nJ76S\r\n=l7u8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8yzZ9EYgKb/G6QDrn27Fqh3lUXz5AsrfaT9+YW72qVAiAS7iS8WdVVi0ujXkAYkK6ZGo398oCnlwtwIZe/VdYfIw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210209141900_1612880512591_0.05877335118159177"},"_hasShrinkwrap":false},"2.0.1-main.20210209161713":{"name":"@atomist/automation-client","version":"2.0.1-main.20210209161713","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.161","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.27.3","apollo-cache-inmemory":"^1.6.5","apollo-client":"^2.6.8","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.26","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.0.2","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.18.1","config":"^3.3.1","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.1.2","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.4","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ce2e5ace7f4e8111d2e6b952414132adeff927e2","_id":"@atomist/automation-client@2.0.1-main.20210209161713","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-RixeaXQwOI3/PshCfC1NP9mqygMTCHlICItqPl+hjQ+rAkpVyfkG2ECIJoJJgjETyQUeydWVVGC118vDeUHy1g==","shasum":"1271ed67b20bcff2ee0bb8aa3d313bc4eafc1b74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210209161713.tgz","fileCount":1015,"unpackedSize":4275828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIrYwCRA9TVsSAnZWagAAT10P/3JMtMqczAvi+IWBt4Ft\nIM75eMKEox2RtQkVO2aKW/mebPT0Vs5HojE7lYSLPA2vpBccIZ86iMuJp9N9\ntrMsUwuzCD555mH/7AgczfLIj/rS9Le7V7MbgTui4e4xMAKeAPMMdhJxR8vQ\nz23OqPVCFZvUZ1nhREP9ecENojlf/CQDrUqjH3A9XVL9t2hhdLJ4kVXLTkI9\nu5+D/w0lRshxFW2YleJUkNz6goS2012ZN35SMi2d7IsqDkyt2gx6+WCiB1Kk\nJSyyiGM/K/MHa+PE6k5g4JbSFezJrCV/cXa8VUNRw7eQI9HKVct4HMwhHHCb\ng+2UvahrYZSxLH9gU5L+J3v8swYs/FIocGK/bNWQaHElS1LBQpKeTbhdX3Xh\nMg7ZEtPVeYdAG3FIqTBmbJwC7jdifZCB3SmHqD9pryYUI/vAtMT2VQysZ2N8\nAZJv+Gqu1GY7B4fXWWU2Ak3TX/0DPUCLKcYbUVs8iapY0IEkqtkkeUTHDnCU\nqZY4VC1BJNaaLSLcNFv5OPCy1j5Gr+SuQOQsTiR8y2QZ7Nb9QqKQUB4jDfZr\nYbpzWoyEjIqgSUagvFiXn84Ab7aIw7uTPbJRyXne6+FruzHuyzFS0lxzxl3i\niB2Z5HHFnIRRShAlWUlF5Su+0h25lWyzVcLEdtzJS2bWHIJDOModHgSMVW/L\nF2lD\r\n=OPII\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFimDpCVq5+tDtH9aZZUptjbOI+6r5dWF/IRsNF10IYvAiBKcdb7Rw1d8VadPLpDcbyAtPTZSlCtdKoYFnX31sjKew=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210209161713_1612887599554_0.679995719903181"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20210209164225":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20210209164225","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e14988a4813193d234f0eb3ca69bac7664d81c99","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20210209164225","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Owq5HX8pvtcqaQ4Gj4jnlU8zAdHy9L9O8fzn2GP3109z7i20XzlZpdiSapphsHdlM9qirIey5MGyKpv2SDsepA==","shasum":"caf0429db7eb7f31dfc8a312a460a2545aba050f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20210209164225.tgz","fileCount":1035,"unpackedSize":4651422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIrweCRA9TVsSAnZWagAArJUP/RhWWrB21g5rGDo9sR2j\nydlB72tt/DbZQD5UQO8NeNt9Dsq6fSR64ZucCKTy79mD5f7+fkLFmxhb09on\nTD7O6RBgqkQF2XGsURgVLrfisWCxTeBKZ2cfdj6oMPi973u79wtZqIdfWH1f\nL8xUBQ6wc+BLNt9qPXcnf3WdL/yXV2fcAz0mmEfVZma3XOwY9eGNKLrX8fG0\nXINvbl4CCO55bpKuwc4WgOR6Wvlt0RheQj70Ac2h/fo3UPoi8KU4tP4+B3cm\nIlKcVi/I84Y1OBVISrGPkhxPJo3u8II567wL8CVFPnbm7/RTNrhscE2riM8w\no99wHdOrG7xcqHEeBKbuMLQ0jGJLeeeIKUEQOwxlShtVlF9Fl6cL0PX803mU\nxGqIkdWOVc4rrDeN89c7byjaQBadrOD7cLB5JfLM+cASGjL/dZrryICPB0wD\nXLt2Rbv0UkQx6A7+Q15/B5qmdtGRtItfIhFhTGrs0wLAI/AG2rnUDCgNMlUw\nNfVlS8QbzWKmW9NDuvvN8p/w3XeZel4zJiG03uv1DOhpwm4i4mycF+q4hYCs\n3PqHUzRK+JiFmqdmU1W4njlFTb6Jb8Wiyew/2fQWvu91qNhZmTJrT56P3JJZ\n9gIQqflhwNHyHWi9U8U+9/YUat7iKonH632xC6PGMNJV3ImXuj/dNi/JYmqS\n7GOj\r\n=AI63\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+/BtGTOX8b+x93ir+ZXbpZlhW2amjv7gG4qa+zJeQ6gIgCFAv/A4ASBeVZ6MajuqHkNp2zK/XNIk0yi4YAqwu+Cs="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20210209164225_1612889117516_0.12202220866240965"},"_hasShrinkwrap":false},"2.0.1-atomist.npm-update-main.20210209182807":{"name":"@atomist/automation-client","version":"2.0.1-atomist.npm-update-main.20210209182807","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5091d1a2ce16f0d42d492d46e098c0e0017f75cf","_id":"@atomist/automation-client@2.0.1-atomist.npm-update-main.20210209182807","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-pmhd2wV+pZzEO4qJ4hMp9taxsZ4w3M5zwndua9TyQmzKuLjDa9jtToQ/AuE3RJeOgDKulr2346CR0dRM3LIJ3A==","shasum":"867012782983949e738860c2ede22a1b9f41c65d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-atomist.npm-update-main.20210209182807.tgz","fileCount":1015,"unpackedSize":4276646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgItT2CRA9TVsSAnZWagAAfRMP/0sDpp/DhC5jR87PvbuD\nSqGlfd6AaQM41CBZ7XMhUGMCd5cCLTBi7wkFQBg2mrCl5CSc2zRPmbEbOeam\n+bQOpMfMwjPt3d65ghI/1wdRVu8ZqCL6zB0u/4yFtk/gZg4vBp/aeTc+QKQ1\nP/n47cnICB8DHfczNWDowGU8WGBiQOqgka6S5kMahFA4BDPLB+lUfQzlTb3k\nIZcsYj8rmbzR1CpX/10+h6mp3F16R7cPK57Jb6nPYjh+qqFqON0l1YiL3b5z\ntJDUEJNYUz9T/LjfcgfkS1MUqM+GGOFit5nND2QZT4SHH62eYKdPpDDdolRx\ndpBKRgnECG0mdrRgYFyghNuZzjThWWew5DGR0MD4BG8N7/hjhCNeFDyCqxoJ\nMWNk87FlRU3DlQhpJojG4aNgmouY6GidWQatHG6M5qK+DU8/MrCLw3WGDKxz\nQRXr+rwxwfNro4BhhgRhc0ktUEzW+oGNOyhfuca0HKf4mqYO8aQltFo+BwuU\n3QlWPwoHeYaU74MtHV6qXeOAtIEu92IrxuOXWxSVZ6MWwyjuGQ2RxJeExwrQ\n2FJU3Ck9n+4Uz18UsfBhpF9q7lrR2Zn6FDmRevIQw3tWu67lmfenlmOrdXKH\nr97tfroSdzkGel0H8OyJtWHf+JR1gL0FI+L0hDpCGUJ+xEh8crqfajF7XNln\nfaVK\r\n=OGdO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvDB87GuMk23ptATdWZJl4XjWv480evANTstX6W7hb6wIgRJmSPujxucFqNV8SssDsirSgf6dHW51OlMFxrL6qL/4="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-atomist.npm-update-main.20210209182807_1612895478272_0.6429833078440188"},"_hasShrinkwrap":false},"2.0.1-main.20210209183659":{"name":"@atomist/automation-client","version":"2.0.1-main.20210209183659","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ff09e450abe7d2b04140cf55df3d012ee2011314","_id":"@atomist/automation-client@2.0.1-main.20210209183659","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-9bYvquvu7EUiSCgYRfIvequxfDgSfPHpY+6bnyJBhSN3feieki7DFQCeta3+vwEdpFe8mURcRmLcyeJpNjhpOg==","shasum":"e7ed8f1b84de5f43af38c88d9d612f1f11edb90c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210209183659.tgz","fileCount":1015,"unpackedSize":4287781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgItcBCRA9TVsSAnZWagAAfFAP/3OK5QJ2BYPs75u/drdE\ndqShKmtg2V7n4xTDGe8M61TQjuA+l7arkv41Qd8DzHkKZapTwnpajelLwNVj\nMzdRjkm7G9Dgooociku/Dz20KXUta59+UEOynhGdUadJvHBcC3n2aVsnnnKx\nAbB1e/sFe4ntGZhDV8dtjWkRiPGlNuQB3DUBtYm5Hk9yPJuInftG5bIv+oxt\nohP3eHVzPFcb/IHIH/JIvc56xw+/f4x4DOTsQVjoGuJlRZQ/Nzr8Rw/3ZJCZ\n9py0dMNyo7yhKdwmAS11+N32sxKFTgPj/5zdK+tnaUlutuiGLNdYvmuFkzXn\neQEf17Yxvu8RLXfcrETHVYOfeAAbO+VRG/fLzdNiWCyl7Tb5Y213vCNRvGGW\nACUxyoN+b+rznter4SvVrumIfn8yE0vpUKOYD2/FRI3rbaelh8HtFk0ofTHv\nLJgRqe8e+Q+/FDfU+kAsdxnvaLM6zcmf6WfoRaVf2k6pLIifL7ZE9cg09VwC\nN0QCV9oNtAR5ufnkLSAwKOjiSoEKir/+Kx08U5u98SwDyIhNG1qDPGHP/BH3\nO1/XDeQLMMSIvW/L0XKi7i/gIbRO3sClubPi0qfI2Ba/6MesIwxxtj3XI5nL\nOTDJxolB0+8pwiwQw6tFyjpUhrL5lZ/IqWwiyQ3aDHbZIJrhittQahGBfbTo\nytp1\r\n=bEqR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7d0M3O5WvMlH8M4Q2y+I7oSBcBI4P8jQuE/XRwDgwuAiBTvRfx6Qr917M+5czcxMgNQ7ExjuozO/Fk53M9CjAGyw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210209183659_1612896001292_0.5682308513316106"},"_hasShrinkwrap":false},"1.9.2-1.9-fixes.20210209204954":{"name":"@atomist/automation-client","version":"1.9.2-1.9-fixes.20210209204954","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"fbd64731ac81294e624b201eff2894543ecdf94b","_id":"@atomist/automation-client@1.9.2-1.9-fixes.20210209204954","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-wx37o5mX6DUKUFrr017M0SFWo1yPg2GnGalwKH5gYJmikj7vZ2zSoPaeXwLpYkswfn3UfcOE/ACOdncfqmqW/g==","shasum":"2c9063dcc7b62c4651bd5f79b18b11005180ed21","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2-1.9-fixes.20210209204954.tgz","fileCount":1034,"unpackedSize":4645117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIvYcCRA9TVsSAnZWagAAhEUP/RqurxgkMYD7QmY8Nw3X\nwwKq/k7p1hIKwTDQBuAbhaxZeq8+gSARTIIg8UGiA2gCaIPtGV1tPu18e9Xn\nYrQhCg4uJ0BZlUdGiac5V5juNw7xazPmKWtcH8UFKpdevhF3Aw4nMbYnmkfL\ndZu9R+JVSy7SRgKIPlAaBrteo5hva3GUqsgcbxqUhynoOVUHHB7lJWjF/zBk\n66GZY7yiAYvwys/GD0m6znzkI/Gfxo+oB6Xzr5LbbcVfaLqqlIbUZbhf8EfD\noAYj/KweRPKcHHDVHvN+/BPJPEqapLDrY5cBt03RWJrONug4Yc5bq+nrAwVl\nZPvbg0MV1HKda7eJXg3AlJA1eDam4AGHCqcxUWIwZgRpXirjpuA9hB8B0AOm\ndiq482VvxaTT6dAi8WMxS6BTfWlqc2588XZO8wyBj1HeNpDhk5X+AA8qin2z\nTDQ9rlUOySJgyR574scMf5M/dy1jCC6ckefjYfywOncgPhxMPokNn3FkVjyg\ncRHKBkL8M2UuGOv2TDvCfahyi2ED/I6VSTMeLDBOfDI1HeyVhDp2hKki5aPI\n8gu/O/jgmziPZ+v8cnRKKxIHF7pC6Ydi0HuzHKitkoDKYG4PkHL7Q63GMlZb\nVwjauZ9hHC8lRaVVZSCyYP2Hw1V6QhQGrlHBBOQCz/DNnPJtzRZyeUqQJdg7\nuVq3\r\n=tz0G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy+E7fEMPg7tiUSiW6stN0dO9Nwdy8+GbAfXbz4oU8ugIgJVMQQpRmWFUzEkoI4J7pe/lVZn/Rf7aiZzel1QORVmQ="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2-1.9-fixes.20210209204954_1612903964176_0.09884766687285484"},"_hasShrinkwrap":false},"2.0.1-atomist.npm-update-main.20210210150405":{"name":"@atomist/automation-client","version":"2.0.1-atomist.npm-update-main.20210210150405","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"2b6cf6bb19a287b4bae0f20a05d4d0a77ccc3ef3","_id":"@atomist/automation-client@2.0.1-atomist.npm-update-main.20210210150405","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-jc74FEad8vDLn9kcMdpAUc51WMPqm1kQqQUGfBJjW9pae4w3afIrV2lBdDkWEWCtM2g+T46zjhNv7te4ljQwzQ==","shasum":"8abc34d29f104e194277414607b4311d9445e4dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-atomist.npm-update-main.20210210150405.tgz","fileCount":1015,"unpackedSize":4287800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI/aiCRA9TVsSAnZWagAAZEMP/jIQ0qUIzgQLggnmtw/v\ns88cUfJ/59TtOJLam3z/HmwFrrZ0YVALJwZRrfwZ53rYxb0ag8verzuG5fVg\neA8k1frf5BRgXzc8okxLnMtqqEtF8EofJrOvYxh8adjhDdV6eqUbcW53GIsc\nDHWykG3HEqRXM86TNONRsMLmKNu4IzMEwq3NKRJu72m087KSSUkBUFNT0GFT\nisxksrkxPCwC8ck112008VqQA12UBU2wIcpApSeEP4o1PDjrkNJg6zk7fvpQ\n+89hASkrz2k2/ogonrDireNHKufGuyQju1HMkzhizSOEJyC515e248ZS9Dma\nSdXubEkT5GQpplKksMVmWoRsy4pEBbL1wh1VNxKzcu1chfxTK7afMYDfZuF8\ntfC4ZOwQCpQi2TbrWYwcoFtZFJWR1RmL7XML74+SPLpZQ6rKv9CmDf0SxV9S\nkw2zJWRosJo88TEF+HWR12sTOwhm0Z8TcZ2JuVwD45ylarb6AxVyaouSjwVU\nfBVRPDsfwwlh1Ouiul27NZuPNg9XGB4YqmVmnKCx0M5hcS2dl3pAz/6+OVpD\nd6IGdKVHn8EhjEhXzW+TfrD1bYWqWNujcpxM+1btg7Pl3CgAYOdc3IfcXezV\nKxjKHtA/jPCOoQJ33y7xZ0pUV7g8FXlEpXSLICvcFqEv6Y3So/GbCGqUxKqQ\nf378\r\n=kxqO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9hsbWuyN+zDBTrRG2rMgkPvLY2/LqXzJHvPtT/DrorAiAxITs7egFdecu6q1QsKdW7Y+MGKNmapZ0J4bK62fKJ1g=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-atomist.npm-update-main.20210210150405_1612969633871_0.4825375176636837"},"_hasShrinkwrap":false},"2.0.1-main.20210210151212":{"name":"@atomist/automation-client","version":"2.0.1-main.20210210151212","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"249bd57345050647292b9270c78fad98fb5cddc2","_id":"@atomist/automation-client@2.0.1-main.20210210151212","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-lTb3vREMom45CO+ho9amF/wei8hSRIGZ3GbvWS+vXJzhyYkX1q7rpv9qngCjTizHopBD8N+OzTm8pHJMM1+D3Q==","shasum":"7613da61a0217c06d5b66167041e715e07bc3e2a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.0.1-main.20210210151212.tgz","fileCount":1015,"unpackedSize":4287781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI/iZCRA9TVsSAnZWagAAer4P/iznnzlfSm/6/VIWndvf\nFeP0lPcdLE0u9FYcfT3tHgh62PSDkD5/Vgtoxf2BK28gBs0G7GXOlXxZ9RTA\n6k7OvVrwkY2WVgz+tZG/qZ5kmtQW3JJj6KpmMsUUxgUFcF0E0hj5utBK15zG\n68NXGy+qiWa8VNFHWnNdIpuOMThQ62Er2ihwmndNIe7ZPgjk3AxdMYDg4/6M\nw8LyyTqSRpudR3vOS36DgkSjW1qs1cmkNwLHqW1Ej9i6TOx82zl+cxUIM01s\nRSe6WrUoPZq9ln/Pe7/e/x9Lkjfsi3EAzh4EeWRIdha505quHmTZE2cXcHSh\n840tTBckhUihET5iFE+oJobnyZM2tuW1rR4ApVwvjT083XXcXCWa4Za9s+9X\ntLh9JXQkmymxFtm44sqQfYNwjGxhQLCipLcZrQiJLmGEscE76y8Wnpd8ASMi\nniy7YHAYKAm+DGQCPsibCInRBy0xPPRtG4UHb9lnrhw0DCWHRtWbGTalR5HM\nSlwn1bxU0troRNSyiUptiRdrYtR9dydxcBi2l7U9vZ6zxoTq6wMWaWVdeC44\nXU2fdRikojYQc6kXB3z8coAQYhK7d68c9lDu3yUZH3TWA1f2IHPIhck4qL1Z\nNuL23OtPIuGc1Rl9i+ZhLyFYXiG/4rSgPWX4/IGoMebJ8rr90CWqnBD6tDm2\nV/uv\r\n=UwrW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCB0df6H5ZTNGFecDEvSWSHuOOLvQOJLUvFmZBdohN/TQIhAJAOfMAmZhNis3mc8ukUgqXcugc85DO8o4tqt3LTsv6p"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.0.1-main.20210210151212_1612970136509_0.05083962607778836"},"_hasShrinkwrap":false},"1.9.2":{"name":"@atomist/automation-client","version":"1.9.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@1.9.2","_nodeVersion":"15.4.0","_npmVersion":"7.0.15","dist":{"integrity":"sha512-t+eSPudxajQ5HI17b+CbFXSLAyzj9T4M1NhR201R5REyZ6BV873m6da3Im+vOAgi5gIw6VO5hroHCvqRKfHEMQ==","shasum":"dd0be13a7bcb8df6772a203c53495fedc367e272","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.2.tgz","fileCount":1034,"unpackedSize":4645082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJAM6CRA9TVsSAnZWagAAPPUP/iKUqy+dSU475biUm1hS\nNqqnvtkbCjj1C62GjFi5nnUmwDUXiR/Gd6Zk8+SAYR+f1nGJwLkLGJwNTAET\n2zNG8707vhzDuGxQieauig4HvlPDvbR9625U4ua13B0Iiu3j/lcjY//pzc5G\n00ODi1Wgo/S/+IKQOSDfPKi8n5VT6F9+/3ffZKP6jTCzqx0dmWF/2fNzwJiO\nlyke6Zq2EpbFC61zs5DId3DAmUakWvFE67NX3+gQcuaKss9PNxmracsnm6yO\nGi+k9iIMT2yVMptUu1aLE0c5ZnCb4HxMXypWoG05pgTXSkBBIdP6JFi3kmlr\nUbWXGJ/xWMWU4yyLl4rrbwtIGUgk4zA6TgnGHlXoAZ3fcpjUVD2MB8c2GhDQ\n/Ue/+2HuZ1hqiCgU6yPtaXxnDnPUCNRhY55StTqfYkn4k7x3KprQOdIk7US0\nEoi06vJ+oyILmMuy0I+Kiq2lXYHQL8nHH9MULOFFhTmWrxUG6TsHPmpm07kW\na2o838eO5sq7jYHxcbGjZ6Nf9rmCzwUd0fkx5bcZDUGhmbmKkvyLsayPQTGe\nvmlFtswUCPqmKrHy8lu0I5EEY6dni4CVWmA8xmRF7M1kt9w61lYZBmNMZ2jc\nIMmwokx9bJYSwarXbeh8x5T7lQcMmECGhGdwbGqwFtXcEKL+uzy+jhVXQFOv\nK8y+\r\n=oAGR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBguANDhio26o+qUICxmd5wShSSyMzt9fWTdXd2tPMCuAiBURLaI4S+p2dlpGlST1PXYJiYKDDnMncEJhcRv/v5SIQ=="}]},"_npmUser":{"name":"ddatomist","email":"david@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.2_1612972858108_0.7050515639559007"},"_hasShrinkwrap":false},"1.9.3-1.9-fixes.20210210160612":{"name":"@atomist/automation-client","version":"1.9.3-1.9-fixes.20210210160612","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ed4a507724a0b5448a2bac4c7be58276809736ce","_id":"@atomist/automation-client@1.9.3-1.9-fixes.20210210160612","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-o+IItJQtWABmUM/AiwEQj2n5eQRc26H3PtExlwXy+J9T30QAQLx6113KDD5YiUAdjpEkoTu9yt9OQiWgeJh3zw==","shasum":"8bcd0c05ef267ca4ace5a8eb53bfda0ab71dbc57","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.3-1.9-fixes.20210210160612.tgz","fileCount":1034,"unpackedSize":4645265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJAUTCRA9TVsSAnZWagAAm0gP/18cE5Ql42xmu6ZtUqMg\nbPCFv2cyTyR1HoBwihRY+6aSye+NtQdoif/n/eEK3JTYcBX5iiMaJ+bvkCcr\nrFIJJ4UmRKP60/Y9QT5ubMgkiX+B5ypsG4GBhvQnua2eoK/YPxkjBM3e2Jis\n9l6H5VzQ8wSmxCdoyNDwAYMD4iOk5EOXgI7Gy9RRvobpkZREAzPMT9kFZuzw\nttu082kUqEdVDro3fmFgQ+S7AT4iOrhmCpzS8LIUOw1GpI2EHS2tiLnKq71R\niW4zcSJXEygg/v3WXvoqCUlCkWa3CuHyCR3UZJVe3RYC/kUzAPzyBH9ocnSL\n37DBsgh47lDNLtOdtQSqkWheAVQ5s6jnnLZJqifFJRRr/+0wRL6qQ7KxzZBT\n2oMOvhAngzJRlcaRGUDyxxjFAS0+d+NziXVAllnAEdvCbMtq3a8K+g+gOtzS\nhDG6QYH4Tj0YoXQQT8RfcqxvOTfH7zWLDam6jUBAP8t22s9X6d/azKjYFpfS\nvmMfYaoYEZ4dFLG524LPu+pajNhgWMSnZkRX8s5XX/GgjIdMdG8UsGmNIDka\nIq8gsmkCBuQg3NjuRK154vUhyv1AHkJwpUh556GjpAyiOxSqOleiKLgarECF\ntsyGiw3jZdKvmcvep4WF6WljzeYBlzn/nESz7Lpf4wbhhNGHwBlaXreEwUGg\nLabA\r\n=r2P6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgYbnReAfi92R75Imy+c+QDH2o9pAEPF/WPlW47nxCKAIhAJU5afMbIM2v6WEp4YZ1MYuxKhLsz/03jwdc/mhYWWl6"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.3-1.9-fixes.20210210160612_1612973330999_0.8465279626031672"},"_hasShrinkwrap":false},"2.1.0-main.20210210161233":{"name":"@atomist/automation-client","version":"2.1.0-main.20210210161233","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"424961b551b18ae31a1d7955257f7fe0f464e5ce","_id":"@atomist/automation-client@2.1.0-main.20210210161233","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-qMIp3Fg1DIHozSp96Mf5BMeFoQIHUHvDpgXo92iF5wms/bcVJVz/cVcP6Y9BdhKPoDsGy2RZPubS374GqoyJPQ==","shasum":"63b83032778802f4b416cdbbca6a3aace114aa66","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.0-main.20210210161233.tgz","fileCount":1015,"unpackedSize":4287929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJAaOCRA9TVsSAnZWagAAAowP/jw/QM9ZqnoJPzgJpBRj\nE5cB3oxsjY28T3X5hTQ4YCgbxqIsLS2YVWAnq8AvbFZDb6BIGB9te3VotF5Z\nEXvJ22y6AqS+QsEESO5+ZSvXB/fNa0/8jI8WYfXKhI7qk2fVlwyE8BnriXF+\nucHiGx7I0cmQ9n1S2wRjvbxKlBZI7ZhT5rQEzo1XXvud7G1zxD2Hjn84ODdD\nlRKG/7pimTrlZ9QJ1No8HT9O5IYR7hD6DDjQYuVOIwP+6PSEDzMNNpGzhYyK\ngTOOJriG4ruzK8yUbeivFzybUKpEVZ+oSxFAInSzmX0lN3eXlIqA1lND3Mqv\nlx9ZbzX/3ve+9eeuji6nuzXAGH+sAJPXtwm+PurrV8k3mT6WNI4tu9P6NF/O\nioGi5fQU9O1Etk9/2Plkf+epCiphNqMmtgevzWN4KLjomeUA9jRrBIFlGCne\nt/nmnr3nxe7Ho9+btmG8yYfA8nKnTjAINJQTKlmM8uXLRQStKzzKDblV3Yqh\nuoYnYL1/jNXxqhseuUTkw6Asy6EuL/EiuR87joU8kEkF+89lBcuClHxklle3\nq8XSOQo7aZQDa6Wq1C30qYkftpx1HF/peUE3EdaEbUFm7912Q9DtLfWy/nM6\nIhcls9m7Bd+6wnALK0qyZOWHisJktjy7rPiwvLwMyVhy4CqL6wD6+yXFs8Yj\nWLW3\r\n=T37M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICz/8gst98fIMki6TI20YdNPZ89i1uWmiLEfdKJwOvw9AiBBWFHZ6ejHTOIy8ZzWVjvrOZdmCjHEUTSUkpIsgl7rvQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.0-main.20210210161233_1612973710063_0.6797980709879408"},"_hasShrinkwrap":false},"2.1.0":{"name":"@atomist/automation-client","version":"2.1.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"9764ced756565dd05d8d0f9006a81461b5ab32cd","_id":"@atomist/automation-client@2.1.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-4YdRwk9a1YeJkJ3Jd5D0D1eVsAqWMhI2IKLFR3w0M4EwdFjnzN2euuO7xby22/6wfvTicvFcLW6f8PfVfVeXLA==","shasum":"a77f96b8bec1b489c959e0972160192d09f28299","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.0.tgz","fileCount":1015,"unpackedSize":4287909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJBpdCRA9TVsSAnZWagAAtDkP/iVThwcUf8q0bgp+7cFl\natzqDMYG2IQFHlv+mT7B2kQ4JA00kFNDRVBlM0hLuHKBZol+HAov7jqgPun/\n7z1q5Y3iSah47HVpxglyXZYP9902DrKyLv05nPpnfyt5EV9O+EN3S84dTy0N\nBj03iuOn99h9upQY4hXrAZt5OqYJCpKYgVMC+WKk4yeanXFnGgAD8y8Gt8tL\nLGU47aHqr1BVMRPdy649VZErjW5Yk+U/TjYgOvWct/LDzFkZ3p2ZjjV9C49h\nbZeJWfjpkRNsOz0m938v/jQRCmHfQ91HIYim3m6i8Jy7QE0PqLoN+54G+bzo\nOBZ9CfTjhHq/jUA+jab7lpqDU1Nwzfkjvgz43IW+ePVkn3Ba5zur8KH2Sl1e\nVKKFEpCIXjzLZw+vDEZFTp5CZCo/BQ3hTTW4miayNxUak23Nod2wMAWgaTFq\nQCT3OFGog6odzPq1tBAq6wmu3ukw3BM1R7KHGT2zXrPO1vf4StUcVKrIFvNC\nbJaIwU5X1l4JUWaL8jB7sCmG9KBUGiOFyi54QYwF0xNWkP8JlrOD+tjp5GWy\nAjc/JhT0uh5AhxulKxbgxvjmIjTvTrGm9ugsizBG7+C/0+DJuJEujiac7VYz\nXc7NjS2Aa6DaNHZUCi3nbo40v0TILNefcCAXbvRoaf7DgJ0nZmuFqPfea328\nARTX\r\n=s1Hu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBN2bk0twvPgN2oRxx/K33TvQAB5+cdhuBEao3T/XKCuAiEAvOUmu0NXsrkIZqAn4GyvLOLKQO31NSGtchUrKKKkmgc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.0_1612978780786_0.9623921732160146"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210211150421":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210211150421","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e6191cd9b91998136f305cad81f08c8853c90e57","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210211150421","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-3tgI3LprNKKDs9diEXVeioMtn5+NuCST2BRBDEkyVmw+vO3IBbmiBaCgRSeH5NoFtGjbLQr45eboRP/2PTGlcA==","shasum":"b6e28da8a1743a1fcdcb751e535e528d8aa96517","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210211150421.tgz","fileCount":1015,"unpackedSize":4288041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJUhnCRA9TVsSAnZWagAAJnMQAKC3eNJBqOlQLYgYJiAq\njSZDG3r+c972BfOe44vjaVfN3o3vgQ8npPoVak3GtfBfzCtwxUjWeLNkvvfe\nEGbyLZY08Bd6LZBk1uEp/T1lvAT5qnaTPyG2l/z6PZ0wmBEYPty0ltncaQ+M\nF/frSCQTGCgjy3M/3hOwjE7iQBT3kzRv+ukNkDHQ/KkV/CUvYfdKJy4cdCtu\njxxgDb0PdYQZj2Bg5NYUUDsDANb2iVlRZxlgle2GgAEtw00c/KySelsOo7ft\nj50aJKQtUpdksmWNsS9ocqvddyfaCYxGdyAQ1VlEH9wzRyGP5hbTK4gb4O3m\nivvwSqPyqyZ2P7xVSY94c62Y8uY0ZdypTiINVchPZhxL1SdjohnsDEBSRRvs\nMMlL0ZbN7W/tdr2hbHJCzviqkaUXmlyG/2ZcgeDOADxenHqyDr3JKRl0F5Wh\nSrcix3lR6gF1frtoGDjzKwhXjlY8MYtTzpHAkrJdXQ8SD6tWiA8imooJuKDI\n0J3AXYgVE68nHY5QV9Qvps5N6AryjFKeF2hOdREigtFg0K2BfsVtnW+Je7jI\ncZjcrG1W/S7mRu0u+l/UC04m2xzsJg2QfSbKsM9JAGUsU7W3ffrmKry1SMeX\nNTc2OdbemYLndYUtf5NjLSKTVejhu356AUUW5KrtXbA18Oqq2gxkeCvfjq+a\n4Wxr\r\n=0ju9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0MB9UiE2lRlQbhQLrKB10S3FIPDT7mXupU8qPPerAEgIgLVq6uG0458KDeT1TP0FvOcGDvvQWncKuTQZ5Qm6xoxc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210211150421_1613056102953_0.7802553968810348"},"_hasShrinkwrap":false},"2.1.1-main.20210211151704":{"name":"@atomist/automation-client","version":"2.1.1-main.20210211151704","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9bdbf65942c47292797d7307a7a2fa13672a7b58","_id":"@atomist/automation-client@2.1.1-main.20210211151704","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Uukq4PqKxCVqAVZtMB2qyFTZO3VMHWMdvjXV/BL2C3FnjLf2YyYTWqT6OLlqlhvkoOIWEL6QX+NZCNknsPi84A==","shasum":"ac4de9d75f9162d994d5d608c5e171728d5470c7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-main.20210211151704.tgz","fileCount":1015,"unpackedSize":4288022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJUtRCRA9TVsSAnZWagAAQxoP/3y82cvV/h2S3ZplsSDh\nAvHXTvljnY9YVPeT0oSqmgSvtwzmJNeDYptBScVHrWsUmyF4zhs6nr+sS4tt\nTaE7i741QuGiLdiZ9f1doN8QLVWsk1QKzp0Kpc9hNGFKXCppO882tXegFX4w\nOlpKlA4Kvu7F0fZfUeERpZsUSvgo1SKaPne3YgytDO+7DvNB4JqcsucApcqJ\n/3rWiLa5cL7CV8CHNx4zFM2XJth2+dRxq7FAPiZ0duAo0SIphDA45NHwS5Dx\nCswDMgTmfULfx7RawCrtat0GrqHZePN3Iu2uH9mvGgFV9Sz9xQ4t8AGs4sM1\nHtpnPebr1S1fLnX83VtNMEAU5SlP9Fl+2lwdl6NFLqaTpggHNycrmFUW0lXv\noxgjtBeSqlLZE/C11ma5tf+ab1mvDmF5nFz4K71enfZse9Dx6BkeWImL/9gw\n6hg7thLqSc934mwlHDjsotNxvDK5zBCy6HNYxN0FzVQapRTo80i9mq7rACbu\n2FBNBcOsXcvirNXGuC3yIuLywn0JlbgaymPaJkExwaQk4I+Zcv6OnD6RcGBD\ntfiEyvzXqD/bWMO9nR3qYB2pw9wRz9w79oYau1Kl/o9GP8LSApE/861zNMfx\n7LC8JsJhdUyB0T1ERxE2ktrvVVvw7Vcg1jlwXxmZlgonjv/SK9DTXd+6e5Qm\nVrpw\r\n=WvT9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzKFiJAbCwJZpew44q15dVYOGELDwNcMQyadfyUiFucAiBH0F1zXACm930yK5VP8O0jciZkslL8RHvWDiy0dK6E/A=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-main.20210211151704_1613056848355_0.7452936146387614"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210212150403":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210212150403","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.0","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3b8ab8fd128c0dc71173ee906c1f38270450130e","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210212150403","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Zvq6iVE84TEQ5gW1gwgJVPuhBtAdn46ShoL6BRNoTZrFeem/dXzS0zqlffZhcL373HzxtBHW5nvVArdQQsZEvw==","shasum":"c79d41f1248a96528da0f718dfc67be55eb1b7c6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210212150403.tgz","fileCount":1015,"unpackedSize":4288040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJpmFCRA9TVsSAnZWagAA4QQP/iopc/nBq6w2NrFhyhq1\nVbtzKt0Q/YY/pEm/lxl+/91zFNg71c3aAtsLvLvb9dkLb9UQ5ljKgzUr/M5x\nM288obNMsGosk5eJWX6U7Rfv3fu/2Ly3/yNbgbO93qG6RxLo7G/UzYK8fnmg\nPI3dqnHFQfb54v1CEaIm/m+2bspYcQLccJ/kkpWOnMc0ZC/K7lda1tUoebz+\nJzl4o2HDeRXaO1e2LRrIwRrYKB1huhbCpsjNNnP8xZn9BlLT4pZz2+i+Kf/m\np0MvRSbcDYgvf1qSGashGqUUP+jIVHlRR/kALDsGOtgGSHY2b3JnsnCJMStM\n9DBrNMUdEfJ4tG6Wcou5RjS4PbJxWv2eA/kxYf0VKh6ydMqqQNwMh7zHIZq1\nIn/zMyt5TL/aDPfs4mixgeGhAtvSnYboh7sCl1az6HevQf9g4cZjs47jxX7e\nWzwLFFnOEWrqbnS7mKAAPCf4nAzSo9gjFLaO1yyO9nY+4UpNVDdiCKPtdOsU\nk1xeoc0Y1jxoasvAAR+AvhkyPOmQdw/rOiQ5jbRCZWTYLQqT5x/IOWdp6sBb\nRDiCTcKtgyWry5TMouHoPP81P+xalngWtkFrH7wHnrkIrMV6fYxub8ZXWFFI\nn+irKccHoUg0tzCftS4n8uII0sssNcdG7pKcN5p0bDIo5XAGF/mRVw1iRdiI\ndclh\r\n=OwLx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICtKtd0+euWLzzgfDX0H8U1W8I3y3fZChJCRysHdVEBRAiEA5EWv2k15alpO/91arli65nVN0T6q9FlHrLMM0B3+cpI="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210212150403_1613142405277_0.05264646575298082"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-audit-main.20210224150358":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-audit-main.20210224150358","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0661baeb4dd6fcbb4a923cd0e84109c897f30759","_id":"@atomist/automation-client@2.1.1-atomist.npm-audit-main.20210224150358","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-govScY8YtJ1fa05Dy/yd5QlLSd7qpnCiHKR1MQVoLFhpyI42BNXMJFpQkDFh1rXB1qoUJcphO5oZwDILMFnymw==","shasum":"65984541cf5082bc08ab8e66760d62260e1eefa7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-audit-main.20210224150358.tgz","fileCount":1015,"unpackedSize":4288041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNmvtCRA9TVsSAnZWagAAJuMP/RymXEdFXJMt3O0hvvIU\neE5JXrpXTN9BkQWxt/wi/+8TAWiGlSORK8JhwTkzc6tr2gukd5paUVG8icVg\nT2/ky9dvNdqq0Lcx4/NKCAapf+hOg2uKXaUSKPRR0o2liVh7ZdQ0077CrGTy\nrzORBVb6YG56GuOwv3ZPOvGNoMYWpsmRkhRTm35p1ZBUo+v+N51DPp0t+8pS\nJzQTpVx243XUkCkwlZMwsnRkvev1HO7B26uslXHcl4F3UGQlcdDADWrqVeC/\nE/OrirmJhHw2ZH9HDmlHZT3SqGymbb26B2C1jO7p7u8wby5+z3/b6lmO5onH\nQMrth0VJ6kGEmWwoKLeSMhi39K8XHNK+UtSJ6SpBFWxuJ1TroRDMowjl/YGW\n5ZxlVIaMvWt0NwRi/zieLfQhZlne6cxcDEF7IFSNLCb9WsrVAeEYK1C4gEp7\nh2Z6v61rfLwwh/lvAGqvoas1t7ljSYGJ52JZeBUuD6QwPrBPx5Mux0SS8v15\nFwj5pvFYnn7M5s1gCI6kfmDus9ZwzMDyUkqQgUqMFqdyl0jdicoU7LmSl4x8\nBW2wZ2xdXviI5dIPLf0kpAvsfEqQwQqIsOvkJKQX7aeYltqPMN5zKSQPLE4P\nO3g+wOVIehKo+t4lvqaZPpU+8x8LnKPIBP9tpqfiiNC3pps1zbya1bmfEyn5\nFEdU\r\n=dyVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHjWMORaVqiCi+UAOxUxYgubdrImJNk0M8iKWKjeohGgIgSrBxRzOqzTiuhpe+d/MXnWrRDbU1uQA3URksV7fiq40="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-audit-main.20210224150358_1614179309324_0.8485845784584094"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-audit-main.20210311130538":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-audit-main.20210311130538","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.30"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8932fdbf7c8447f4cc238a35f5855568d6608eb1","_id":"@atomist/automation-client@2.1.1-atomist.npm-audit-main.20210311130538","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-hvxx2Z5fon1YQYULxQVlNdOSPWX4SFloLkf3jIdtBn/n3K6GJVbQ9WqCno0ET7aKwRS1fFqHBnk+WC4yIwNq6Q==","shasum":"2ae52546b3e36035dfebff6a6b9360a381747818","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-audit-main.20210311130538.tgz","fileCount":1015,"unpackedSize":4288041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSha7CRA9TVsSAnZWagAALWsP/0U9nN5qnBYgoYfdjlmJ\nGIOT2TJqSgMxxfOjV+2nzs2nbN5CFs4AYSeypmpakKDKieVKd79IDmEqvUdG\nQo9TVuHyeHEGTzClbL/t6g2Poyt339N4PJLh1iztvlhjcD0j5vgDzscJ8+bq\nbewezpA4kJ0BRpBwSxo8ZOvDFcDRrGNMLMkXskUXejHX5E1jrzyQ4IEOEGzB\nuQVUTzUYER+gL5XXZggAg5mifxHKKPCsAlvlmtdYj79JkgoI+OVH9+VAlNbS\nsKZ8AS/ZZ5rqvomeqGbTx4eBwdEaN0ClIYdT19iLyTDORJ8DjcBXRrD0X/CY\nBLu5kXgjYlV8KWDhhBEjeJw1ECuWgaZEoQZyvtC8X++1A39hisGVkA13Lgnd\nAnFNybSFRZsGEmThcfalwFUO0wWYXuoYalL7nWUu1DOZzfYV0fu+5w6BXJSV\nUL5DvfVHF/lXyEdAWNckQ4NUA0h5M40QpbpNiQklaDi09wNZz3Ocmzu1WWI5\nBp9s9KuEc1OqqfCAdPTRs2s6VVK3FR3tDnijhMY8k2WHzK7XJ2g/fKnCTqMP\nAEZI85LsBB4ef7m5Oqc9as+MoV2+Wdw5dqSnZ+SCJGnKsbnoV1uilMWCJcOo\nCXtgQXgJj2BH0reLM0a38qnq74u7eJb3gn2msCEwmkJjJd2DF9CPIQHOhI9p\nqROs\r\n=T4PH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzizYjj79FyyjrOAAOLPNkXAEJw0OuDH5rYJKh/zmlEAiEAwzT+zv/rUG6bVVmO/KB0Lhl4sg882cPRaEw48aPYH/w="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-audit-main.20210311130538_1615468219318_0.07780695508912161"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-audit-main.20210312130609":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-audit-main.20210312130609","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.30"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a7e1cce7e674c7097ae9efbc5e66467e3f333861","_id":"@atomist/automation-client@2.1.1-atomist.npm-audit-main.20210312130609","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-n5iI0X4zqFziIzyu1xhgqEPeyXFN8s+fpBcGyqiDtgdu9ApvaTR7ChN0ANCRVI9+seLhZgr09OZCWkGNCSZ2ZA==","shasum":"464625c365ef684e48c8cfd01e2997f3e11813b6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-audit-main.20210312130609.tgz","fileCount":1015,"unpackedSize":4288041,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS2gOCRA9TVsSAnZWagAAgT4QAKR1nmmEWgUBJtEXx8IJ\nMD9KeisFtVy6evTDIz6ZyKu53b+/sDOS+07gsT8/IiyqkuI43IpAcJKQ49QH\njON3+gbWL2p2UbjzIkfepm4jjekq12tXZ/zqVCjr6oRcaHfOTRDWSYxY60fN\nwDQFr1DwMsMueuH1mbWx118nhvZ0+29U2dQaTY2TwE//GT2kKu0D+XLcuB9t\nfwRmY0KBJH1HNI4Ohmq4YiqKKBS3FRIo7N7jw90Vpnk6umbmjV5+liKcYxRT\nHTnx46ciK0WtBndYE0ccP2htlBIHoapjjsY0o4+EhPYj8ZCnmw/QcFNoPAe0\neBJkJaWGIcA0VZe7FRa7BQT1x/wZnL0/A7/LqntOiJ4T5F0HKGVF+01JYh1n\nfg5wuTS7gmTq4yc8KWe3YyI/Dd2xWDAgt7nsIclb4X9OvbDsZ1+uvhKpShr4\no0QbUSEgbcv1lYHvBre/QAh0fKRSsLBF4345AP1jGD9isas0J8eerWDuMmWB\n280iB/gX7ohByzsHGmiYpcaamgfmUNbjXp3b0N1L1tZcLikZMaGDosz8yXc/\nvrvtPiUWaBf+1CrtT3J6m/6ZHZd0lzvhqwaRdDBLQgzi6FiavJSnfOPl4eqa\naLYxzmES8aTs73XX48NT1AtWZV7XVpL6vHEwtBbUfBx4L2lGJdysykYKe+nu\n32em\r\n=oP+r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvEO9Jm9peDn/SA+D1ZT3J0n+BoYhXPTP6E/1jR7iOiQIgG+2KIsi+6zQhD7Q6G4EeTCq5ia6k1nPQkJSjo4bN6i4="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-audit-main.20210312130609_1615554572612_0.8356527175054078"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210314120628":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210314120628","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.31"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"1046a33eefadc147447bb5493c2182b4416005e1","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210314120628","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-QEvbIiVf8QYNW7GT4qT0lyifXHeelSwxQF1vkAzRG+sJCr3s/YGOL3DUZSWXI0D+W1mNGB6eDa/T4og0lDK4zw==","shasum":"d1d7f8edc2367ba6794b250c51813e1958646681","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210314120628.tgz","fileCount":1015,"unpackedSize":4288140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTf0KCRA9TVsSAnZWagAAt3kP/Rs/Sp28Egwggu831OUi\n3cCnHIURRUqV88Jg0u3eL2PpS4zFUUIhKl5akaK+NaQ9P/vS5kHBtfOPskZX\n67vKNQbN2bG/spRYWnr55oLG5Wew+0g48Dw7Dd43rwteeGSI7sTmzA8+bGmK\na+ZYjlgA+gG+WxPTVK4nEarrk5YslpofS/31n5dXfWbuYpwMfh/xbTsiCw5S\n23ybZMpjD9x/hznKwIyyOB5cgGts+QTi2tfs6UlQEkyRZBVZtpY87+7n7P1c\nw94XztBsy6SHhtpnLdahea+AUyN22cU1GjRHbeYYuAOkEftTrBjeI7X2PlfH\nwPwom1MNCOmY5ekechOIuCQggAltQcBo5ewLKHOTgaTBAHZdFeFcCIBntX6P\nIPp2Rq23dqMTjJ2ltdE/G832cFGaItQ0wVc/DDixTLZTgkuFgZvTGZ4/qVmw\nZKR5MFebxGklLFbeMv2IgTFEMXVIlICQeEhttEZ2NukH5MfdKlSqRKwqFfOK\nYZriB5kMaLDD55NFjtw0uf7LQt75CCU+R5bND00tePzW7zWY91WuPWLWQijy\nAJufR9483iSSzUFfoX4gzsRbFJQd2cwgIvBBwl04v7GP1JcDbJGAS2pq70NM\n+uZUrUptbvvfeL1q6dN45rtOdJJ6FQX/SeNhSR091c9LY9glaaSVMcFHqj+N\n2Ko3\r\n=zXhe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3+9zKUrQMF+cEcxKqgE76LPXal56OOerBJEwhMBR4WwIhANPt/pt9sAvvjXwd/Mxy50xwsrHAFyExKkANm4CGYZdm"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210314120628_1615723785826_0.3927720064066682"},"_hasShrinkwrap":false},"2.1.1-main.20210314120800":{"name":"@atomist/automation-client","version":"2.1.1-main.20210314120800","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.9","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.19.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.20","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.1.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.3"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.3","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.31"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"df8b31e6ddfd984f79eeb436d271e4750ef469e5","_id":"@atomist/automation-client@2.1.1-main.20210314120800","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-griq8YX7HA9YZfRC0X72Bngt6REBYWL9fSwZW9p+MI2XgUFYaQRHdaHq2Gza9GbMQU2Q8weUHNSf+90fQ3wehQ==","shasum":"1aaa5aeec2f17e2706a859497f976c67c207a090","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-main.20210314120800.tgz","fileCount":1015,"unpackedSize":4288013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTf1VCRA9TVsSAnZWagAAMoAP/jY/J4ClyzVogGHspxtV\nlqibokqoCUCW31sJ0Wlv8n+fUhcvKQ8H70xSDBvBkzj80DqSzUmmlrpJs+TP\nRRrJDxoqy+awqHSLYyL+y3yxVd3A1gXuGYJ2wx36WMkUEK6JBMT45LesQZev\nkf1pjHPCjcpQmsB0Akdz0xgv/ofGYVMd6sfK9JL+EeeKtIxnric9XBZM5/9U\nEYY6AjAhbGq6hHuhaNdB5PkCMVKd0S53umkcFpOPN/Avwp0wQw8BLY84fq8N\nDUhWdIF0UyOB8H3aEUwkSIqiOc6/0VAY9V6bZ+IwFdAPCneIxZwcucm13TKO\n8x5GFf76P2LBqpZSFwb9CsI84+J3psWQlLgMWToKCuFTbwa1I2ubPoijYqUD\nELUKyfdZF385V5AjOMRudPGZaqmK+O3Ajj1lKRUBkw03Ayd+EHKV56OjJHr3\nwTT/ZoyWFEFrxVXfw/9xWK0YhDU+swdzviYlY2bKVeXX2pA2/9AyhA5/0WhD\nzSGNy4NVd/8Vvu/GCjH7KjiyR3K0kX2ZKGxkXQaHlxN5b0CXQwf0MeKC1m77\nijLq+oT+aHxdGQ3u0FnT8X3Z5mMbf4vMcuTXbOnMBVC02wl7vWYwwIWhjrbT\nX5QkG2/aq++zWMK6k+6+1PdgwFe0LN50kDfLQv/1T3o/OjE5T295Dxjs5cob\nE0O8\r\n=K62X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0osFO1LX/Cr6PnrfPxepIochKbTAYBbieMc+4ACemRAiEAk7Fl/gyMvqBu+MTenFoJYYUzP8YSC98X/popxdjc97k="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-main.20210314120800_1615723860936_0.4573587056957438"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210315120330":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210315120330","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f73d82a3308fe71c9cbd6d9447a25a6c72bfa643","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210315120330","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Q/GOVo7WloyPzQ9U55m/oa93noP3rwLfqeA/LO9qruy0HOZzZSaFlwkn2R3qX439GmcwfoU0btx5LifAl7gEJA==","shasum":"05ac0ddb07d3497aef222b7a6c1db83ba5fd4892","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210315120330.tgz","fileCount":1015,"unpackedSize":4288130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT02wCRA9TVsSAnZWagAAPoAP/jT/r3Ys3QoDmtVJY2YP\nW3nnQdSjUXKjuYv0+z+EjZ5vrkjj8z/UoS6fRSZhGc3XPKgNVjYrwJ9I43Ey\nnY/JaND6H6V1nIJnmtZwx/ef0rI6dFDM3cAJaLszFpVCcsVZukNS59lT43uG\nesiKJ2mprDfjjGxHjV75qKFs6pU1NEyCGCBy8/KpqX6lTfMRkSxSh74LaN3e\nB1ngcKWXdjdMrQkW5qShfR5/sZNlpPmZQWiZieENd4zupcH0AC3X59hNbx/i\nRg9BfUexi5QJuM5mkblkFwNKhbxn/5pMDPNftxsda5fvREYwTpyUDYdj9cVM\ny+AJIsVG2rat4U4EBB7PLJlj2kyR8y6J0fWKnAkyvFMS0F4IXIsT1CyAaITZ\nf4ICrCleCg/DKHqcWixIeIHrYtuYULqR8d62vmSov5OQDGxtTEFIxZtaQLH2\nRUYaDwe8yPb6hA7mlj1sG7wcfgT/PGsZNYXxOQ9JTIxePJcwo9rWCbzHho5W\nHmQIkYrcnqkELkojt0PzwJ6u57wHaAc5oYv8ufxRX6OA2wpNdBzktJ1b/6Ef\nVJfmDwTM1KrpBGvKFSXm9xSIrxoMw2Qh+yzNpaQJjkRsXZ1btX4IY07OV9sF\nR9U+OB7XQGtc+iP2PS9qaG10AQxP5oSudZ2IAZP+qZjzmwY5n/58ZodiWiy/\nbBlZ\r\n=1stD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5e3mGNMeUYAB1a/4davx0dwiSH75CS/TxFPgrQExE4QIgXr2u5U99Y0YB1DL/Hzghh/g42/DLeOH0SnS+vjHbKb4="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210315120330_1615809968285_0.02380527685796885"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210316120312":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210316120312","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"54a62c078935aa604c58673975fae98e28f8f634","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210316120312","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-25WgqIwJjYG2JW4eKIPtIeVNtbIq3NRcPO5E4Iqhf+woRYlHYFP9FtiDlFmRJiX8phpwUijQHvg0N4BZn/fxMw==","shasum":"cfa3637104a333fe9425b1da435e0ded8b8a2cb3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210316120312.tgz","fileCount":1015,"unpackedSize":4288130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUJ8UCRA9TVsSAnZWagAAhwgQAIAuT4AqE/nOfRHyqQSI\nv41XAGvW0NHrZPV6D/bL7XQ3Vd7an8dTAB7QeF1xDIJzaVnDfrOKpnMLO7ld\nnbLSbUTvTg5exzQV2NdLXvYNC7D2zUrSYKZ/Kl2nPEXfuF9GqKWYKqW9A34W\ncp7jl6PfWgRtX2VyQ/PJXaZD0KoZXe0NDH9LYGtH6Elvoc+2PQb3xU5BygNs\nLc89vxjPHdEj48m0A5Oje3QkhZktcX5E+8kLLwVJwXIdN/ni8nG8a06AnBOP\nnRDJhTJB3nNlMEybR8DS6hKsYnu9yB/acOT+S7OI7ppRO4p6tMxsEZTlziL7\nsOGNkv1Zf9TZ3Gp6etSyQDkzl/7jG9qVW1HlOKj3Yojb9Vff3UrSTt9SWcso\n0h2fOmVz/+0lx6eK1nrWMfLIz4UL2FmvhGPq0BAYKUSJeBEYerwgfPxXVblP\n9vIzvSKA4DK5VEnhFc0ApIS7wbgtQG3J1fq2nHfvFSgNUxQVTaPBoeuMf9il\nB8sGtSLm1XBvw7D0o9CUNmMSW4xqEpI4+jK7BjqHJ8EiiWjIyCa+JZgG06Qo\nBAM6UBvBIBMH9OHb9tlp6v7PN/ro68cIc6SCmrFqdfc24rgny9J0D24FD0Ip\nsnKCRKt6vvQdpW3RaLNGVGqviPRIVwSB3dClmv7cM4Q7iaMCtOqpQ9uXTSm1\nWsRq\r\n=sWAb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAsXuQFKWGdqs20yGqd3nY7hT50D5BZ+JzxQYpmMhyXJAiAIfzy0w4xyqOJmxgjBYq+cMUg6QvnmTNLf0g/lsDHrlg=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210316120312_1615896339627_0.04198516071868674"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210317120324":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210317120324","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"386f561517a32226f3fd662eca57524a90362c21","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210317120324","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-U89upRpJ+G/APue2Hs8fWhfSo9Y9qBmjPyIYsKdDBQvpLj0ftj2avT1TPuNYc+UlLcn8EnbMEDSmAfmAm2YKBQ==","shasum":"01229db7cee807db99441a1cccb6905d28f6c5d8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210317120324.tgz","fileCount":1015,"unpackedSize":4288130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUfCwCRA9TVsSAnZWagAAx5MP/iryBC0I2Cbd515OTcs7\n0A+yOrDIuspVYt1i/198Opwvj7Yof3VP/jJDyna4GcEl8aJtkFuySWXrZr5o\n/TXs7FpXB7XZeSPlI+dfqbH4eWgfuyIQ9Efo3Mvzqni1+DgSKHunztP8wBvX\nJfoc7LrHxgnbOLSVlh3LIh6+a2oaFDTfoGib/lM2gl6o8D2uhEXi72ksoum9\nHIK9UmYYiKHICNtTIAfLtpNObxJ7GDx5qW6RSNlGq83+jFC4PeIa3gNqVhnn\nUxziHlCk40/A7Ki+hNSAR7rl3Ud9oNzGrFH6WGhtjrAH1TjJhLlPymR7LC0z\nsmwrb2rhASuu8JFrmpjV2kIkUVue+DUhwchZOo20Gxk+6TzAve1hclbrXXR9\nzftLhCjj5Ufr2iHqzBXeQXMv/Q0Zc2s7mg2lGxWS1J2YiKB5QCNPuHLvV+GF\nNKiSObnrF63P6/vpjmmjQfk/bxQGYF/Y6tvnFKRgPQ2aHh/b9oLn5y37/JXD\nR54KoaUrkJxB7gq37XcWJC794A7yM1urhdlBv/ODPZ0cr2RnWzsTtNnreh1F\n7MZafRikbJylIsC3zyHy7/Ybr1c0MBXMpb6aHpEIdhRrHvHyCXom1nq0HYhZ\noCSg+W7kSnoX0TNqqyaBjptbIUG3JldS5gbSh1pgFwyf83REsZBSPYlCLts2\ngg0L\r\n=oXos\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAnlrBBXx4hb+5gzB1TS/vQKJ8yv5PcGFX6p5rgqlRweAiAFJh/bgbeuBvhGwNaiVp4NrFTgvBfTjPg0oadLD0vl6A=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210317120324_1615982767664_0.100376781297848"},"_hasShrinkwrap":false},"2.1.1-main.20210322120556":{"name":"@atomist/automation-client","version":"2.1.1-main.20210322120556","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.33"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0e8a24a7d1b087d73ee33afcefed5ef7b33adace","_id":"@atomist/automation-client@2.1.1-main.20210322120556","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-1YkA5HhJbXbZ/3/rp8TrBDRP5LHd6UgDyW6dNNaiMgdryQ6JBo2LAXOI73vDa2H1TvLBHnG78myW/i7y76n8bg==","shasum":"7986833dc12df44f3723c8e211f1cbe62216ddce","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-main.20210322120556.tgz","fileCount":1015,"unpackedSize":4289820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWIjfCRA9TVsSAnZWagAAt1sQAJJcnQAT7B/4fhPG+i4Z\nZr6yAaVTMWu8G7JnxMYAkNbC9qGfKhn/nrr64at86kgXPpmX4FS5829l8CFS\nsKsb3GzMRrrIwbCXiM3n37LvrBeHOAaJJHFep4HdK9hG0eY4lut96rbp530B\ndJn9SustUPEiOn6I8GsAHWOCVSSyP5XGT6aDoRLVy/W13dpFWB/849glFRiY\nQNrpgJ6oqjcHEsPcwW3xluLJZeURGcSatQ0O4PbyWmCzPll14HfeWR7tWieK\nZIKtQ89CMMUdb13oMj+ovVPU91Qad4nOrWA1d/jNvlU0snjYTQAPk9tKG5hN\nbS+uprd60wTmIDuMkiALOp38OhhucDU4/FLfFe2IWs7MBENAcmtm5PUCDwGY\nBiJe+NjLv8si1D7iVo+2P8MwAgtS+XOcLEF0aTQiBcYTFrdsJcl8mykAO4zl\n8CITaZtuJwzy8rs+h2QWJPf2CJbfzNpeExgwJCoxfdjTMNWsMQi08BU25BN0\nusPVd1ncvhH5RPe952fQiKIxkaHjOqlz58QmSTx/vktkOr36vkc90a+KDELF\nsv/NV9Srd3C9fBeHF3IJD2vVqErjOLtornj/f3AnEjz0uLxeiRShEcqOwSiN\nnlr+QUIgS1nyVcJlN2q7Iq5DFfyH2/pB00R+Imau7PDsQxvJ9xFVoovGnBET\nimd3\r\n=EVtS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3osYVhRva5NqKG6vGapg7yVQQhe41WMVi1De5EvOmtwIgWCtJ3p4g3shrtYMIlbWgnPRa13EkGIKoqK+lpjtlkHw="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-main.20210322120556_1616414943136_0.7322440775007926"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210325120514":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210325120514","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cda59aae56d29ef2f284438c0f5ee28752646731","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210325120514","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-8SOlUQJX3jibbOAOxZENFV15I/btkrgQYlK8yPuM2UlKHnMneNCu2YYO9KPZTzgnU1WrhoFDDY/BIsGaU/7Tvg==","shasum":"270e3eb2cea1a048717f4590053f7380515d8052","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210325120514.tgz","fileCount":1015,"unpackedSize":4289839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXH0RCRA9TVsSAnZWagAAXO8P/0VvFur/IznfsKl1hqxI\ncjLecV01nI2M7OMO9DIIYTdNOoUGbOvg55CdBNFrsUE9O1rWZNhfw0HNqeo7\nfr8Bjsb4rXwDJB5+5L2ThmSdf9NxfMlDiZdC3ME9WTQhKRn7FThI+V2XvlCu\ne3//y0hVcB5fcxJRuYidsZp8Jcyl8xLf8eA7P5jEd/BKD42PwpmNLC60UyyC\nYl78Sa91WdqVJ5Zurple5Qi5V5EMuseD5p/tS387NTXIIk9OdvihIKzaIlKX\nRdU7M59YKvqG4KI2pYiMlUr3UACGC1x5nVmeyo+8fRxBwoodmVubeGhZv42t\n5LbN6PY+rH7YnscnY4jKM6JqOZWcCycPijeCqgTAu1OMFBosP5AvkpP9sKT/\n8K4Db5QcrGb0OcD0v/FwsYsYff4+MgA+4PCxfWhnZ2SNqbcHK5peHRbPfgp5\nhtWbseVcU1vKNYWi26Z3zMejfnhGMBrhU9pBoKTTmMUafqOuGkmvnV4TvZfx\n5aMLwjq0exA5m6L8Fk2SlI5kC4GBVe/+io9yrCiy20eCMdxYWuHN5eqLJ1/o\nGM81YkKljh7Ei0OVEOhyBMCnYwMl5SZ9JYwMbfi18YqqSqauG8jjPnZAvVyH\nWmNv1Rmmhmu0pxUmoE9TA4n+nGjvKo30V+PfDjCQb7V80fo3wgIpx3ENyYD7\nHp+X\r\n=hMGk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFToGqqI+nDL2yarokJJYyCE/7aygt/GyCalgdO7ZSxIAiEAjUUpvuMwpVvorMFdLVasKHCEG8Ygl0OZXqJ7bmrIzJY="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210325120514_1616674065369_0.5628237205720552"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210326120407":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210326120407","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cbdd7552e0b75ef1871569398f2b3153e23f5551","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210326120407","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-nWIVnt4R0hm0yq0pRYnauIqWPaufd2MsdZLQeExuN6aWwFqTtYab4AO8Ghnj5+Ct7L+EbKP52hvc6hnYJtsyUw==","shasum":"4d0760aebb111b54ecdf5186304652ceaf76798e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210326120407.tgz","fileCount":1015,"unpackedSize":4289839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXc53CRA9TVsSAnZWagAAkUoQAJ/OvzA4R5jC8E6p/Ugw\n8eBYW38L71G+sVuikvlJFLhMO5wsLdzldZr58OEG5Qw1aAnIEFStvZ6bufan\n61hfdwwGc5LU7FEvpEKKVxnkkyQOXmfK2b2HW4N1gDl4AO2K5dhRGxPIrho2\n6gwQdwv4jW5KeCM5V92o5Zgj+KHkYMBgILEqBwgSNef/E4FR+ieYJ7z/zYJh\nFhvE9JAYQmJZK5APscelLL9pu2NJc3iuBe6zpseKckrUjnaQXeMsulAHAjBG\n4BCF4oovtIS2I7K52qLzcKMb8TMaqT4ZXhLAFoasLRk0Bq60xbDOj+oAOEIU\nagODIk3AJqvFziVs2e3LOrsvEUyPjT6OPlDLEdRqwFc6276GiGPEzUKYpVSq\nvxm6wcjEu+H4gngXK8CXXgomafEinykHVTRM3T15brmErRAGjoP5ZuMNL5e/\nEa0e11+uJtLTg35gZYVQt9YUmnOf/DLR9TA0Z14ffIXa9YMTCIHPMJZyUa21\nxiTDqEVKbyJz5AvzWnm83Gf8rmpx1wAtzIn5AoZV4Od0ku2A6J6vqoXeEMwS\n+nQPETKtjw4HBha+ZzZqjDnO+vIWY/28EhoDj7OPOn5PI/JCpmEXU6TGE7Ah\nxuqOcw896p2uBAIalrMoyy6s0eg3WmYGF8uO3Ce3YI0xmdaI7e7+3T0ADns7\nmxqw\r\n=Uyl9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk3C4yT3oousaMiSR1W2VTEUqaIGIU2vGrWOsuuOMcXAiEAtlsjl+v0tWtPQntIe8F1euBjk+s03mvcu9rPvCZ+wsw="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210326120407_1616760438903_0.2897177551782042"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210327120404":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210327120404","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8afa701b52c69e7f76bbee30ddbb3330654f0f42","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210327120404","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-BsCuXG3pwBec8QY76vW6AloyDHKNBsLz8g/zZL/3wvymUsd4Vj3NRCDvGOhdg7vD+rFPBMKETQ20YXLDnhj9uA==","shasum":"f34ff79f9664168b5fb6dbca503430a697033746","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210327120404.tgz","fileCount":1015,"unpackedSize":4289839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXx/JCRA9TVsSAnZWagAAnZ8P/ixLOlBiZK/dv5vbYXBq\nRYHUvj8rLFDeNvlWNp8EBrhLDlpGA1mSG6xWx+jRJnZmRWnmpLv/3vaxkOv1\nctUckx3BiVcV9xJWpbmwchlIWSOb+QUoyeobK73MvY298swQFYfGeHPf6Aof\ntCem/j/GN3SOXXa/NuHANb9PD2rRXCWNmgyUDq03/zWPwY7EV4NhLMLuZbfz\nKr8B1KjOk8qZrPmY9d7O1l8fc0nbUvXbpcEwNZuH56iW6j8hYwXe2FHpkjxl\nlU5QGObKzh+hWPcHhQpO3mz0N+jI2+A/PziVOUcd9CXBEyqSRN1AgkKxl9yy\nYhijfGtyADAHdDS0hfXxBUfVTy62EB7cUB9wxB8IfGykbLlCbEet2nwjQ1K6\nXC5YgYF8MQ2cM2uoGv+n+Vzat1TfeS+GUjrs4eByuz3TsRyselhvAGnsI9Y0\nmgHHHmMf7ZIRWWF4hMQp9y9g3MWQs+f5I9gXcRkqG7S1MyTgRU7X5IA6N0pj\n5TBkvHKrMBBjeiC4ALxkDksHgflkngKF7Rfudwfvj5hqq9AI0p49pj3XYnHt\nm4KmmpnMKybiqNQP6t0z4+hFgvbA1EAYLxV1IjzngvZg5Ozfmgp7zgQaQxih\nWhlQqLk0gvd1Qtq7uf8HhrHMVLcGS6jrE/6ecxwSwDFjJIhLuMOwpe1Au7se\nvECe\r\n=uoti\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrh+7CbWH1PC01vDhxQKFFhx0xWyFihH7vxn+tUBierAIgAhkAIQITLvHR7lciyVYukEexaagFo7lhm0q7J8CpyVU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210327120404_1616846793352_0.3073512241665419"},"_hasShrinkwrap":false},"2.1.1-atomist.npm-update-main.20210329120531":{"name":"@atomist/automation-client","version":"2.1.1-atomist.npm-update-main.20210329120531","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d391a0f26d60bf3d5f30f3bdd10a64189e3b3cf","_id":"@atomist/automation-client@2.1.1-atomist.npm-update-main.20210329120531","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-0tAzg1OQMXjnj8ub6AT37DXQ3h2qu+cwF7kwMt6rvbBr90+OejCeUPh1p87HmcG6dNt8b1p8BO0e7z1Tv8pL+g==","shasum":"c0188c48e434c9aed7a8104c41ba851f3160441c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-atomist.npm-update-main.20210329120531.tgz","fileCount":1015,"unpackedSize":4289839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYcMzCRA9TVsSAnZWagAA8jIP/RxmCvT2PB+JfrrTbAmC\nP44De1e0mPdjU/klQem8NzdAhxJFtq4KEbWnolm6jzcNO5l8MwdxgOUN0Tlv\nx8qfN+K6hOutZJYaPjnfb5k7DVWpzCijndV+kh3baDWCYyHgykFntk7Xejl9\nlQfdS9VL7cFoFkVpIoZWp8uxpGp9mcT1mkWhBHDsPKL8cnU9fQQrYvDSslMr\npQ+Gg50NpwjLikY2j5weq6sc5GUVBOFcv8COvfvjH8tBFhTd562iy+gkLevV\nWokX41a6W+JOlg+3bJALzN4L3wIfmoFCGv0Vm1Pml6ZoUvdMa/ogZ/NCbPo3\nfpcs0lvlP32lZb6Cr/DreqxpD/iWnapuytJ57jVrewE/Axi4243JDw7IbedZ\npLp8fy//61UJ6DH/qUYcElccb2LkROTTaoJisulNthD0b3/8E7s0k7QcnWvI\niQ/Mg6aSG3Xafp2odiIoXUgUiwcF6PoQPFDHBE6XkWQ3Li+wVLqzHMmcNpqN\ncbO0t5BfO6X+DyG7mYBJBT4erkX56C/39k0pdTlCuuFC9MalGMo58lDwPz+a\nk6qh8P0UzX0O6fuNjMkd/XKv6/mX6aPIYhmxPRX+DYiHtLWGmnmWSpVA9BMT\nR7TAeudsACJKgH+mEv35HmqgIIwiWY7GVwWv+tx3gSrYMO85TzDf5cl5bHri\n5/7D\r\n=VG1K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7Meaay7zUuMhg19dSZwoyhtUz6DQGnOAnN5dHSY6wPwIgMn/Ro9NAJBgrYJyByDLu7xkbAaSipgIPr3IxnxlMQuM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-atomist.npm-update-main.20210329120531_1617019698954_0.19464740321485374"},"_hasShrinkwrap":false},"2.1.1-main.20210401113224":{"name":"@atomist/automation-client","version":"2.1.1-main.20210401113224","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.6","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.33"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"dc7f6c7ee636bda6e3e530d723dcca763764b084","_id":"@atomist/automation-client@2.1.1-main.20210401113224","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-J6IfUhGOpaBo+A55T4v/qVtXyfe0QZ0ETfbrlkFMDKJhV/IRlhd6y44BNN9YCJbQrCOrdXmQsAjqDuCYE0bbYg==","shasum":"4f8c1f67c1f5738552e89b2f4dfaec4cd5103ae9","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-main.20210401113224.tgz","fileCount":1015,"unpackedSize":4289807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZa/tCRA9TVsSAnZWagAAZwIP/0Ka2RqO+P6LccbcrYpZ\nEi0t+V+MZoBKHRTQMrMzzxI41y7AQHMsXEO4m/Kj6TM/4R2DHWucSfLkcWgt\nHchW9nH6kIfBiul82OTp+2OTlhSrm49CkahWSHWsV3J1lgw6Ixjkc92hsZOJ\ngU/JDXy+f3Z9GylL4QfC9sbqsk9FAhNgT8lOHP7WeBA+1JE9VLA/cANkLrQA\nv8dFQI+3HiMGzypIvv7l/qrhd5jM2l3F65l3bNWFEx9AJ7hT6awrbTyFqOdm\nRL78fstMjbRWMh1BYsUNI2cf0kCCogFe9hsplEzsVhZ6Uxj2iebcE6cXeaaP\n/BDa5OtsASA8+89yq7AdN+HppoGJ21nuX2XwokwBrIMfOB14lD5CBC9eo0RI\n/2G66O8hM54b+xGXKdJ9ZF7B8P+k1MAQBrdSiY8LEINgGu7tZx4KCmQWDbGm\nr/xVjsBFYM1Y7T1M9EiEt13SRVbNDMG+UvmkH09dgI5UCzPQTWtdFN5YmcC+\n5KfFqnUMUUEJ5UaKmFQYdjb9zBjVjo/nx2NdsIgB4JsPjoBNIpNKUB+eAhVS\nf6RjLHNoErNp2t87K0zBD6Ji8mP/fWpoYYx3q10AjFlpFoww4roj6LDywKF8\nOQpO1YpNksqyduTYhJtW5GllGDuAPoiBR4aWxKFNp1b5BbF1RjZazQ+iOnAE\n48DK\r\n=Vbfh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsLGSceC1SfLZ8zqSdjcJ5pqZF4Ha+mzZHTDf2vKCoFgIhANperANRS9ry+8g7JIYYVdJ+fY6e3S/FIaqU6ZLpVEL2"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-main.20210401113224_1617276908968_0.11564779005760273"},"_hasShrinkwrap":false},"1.9.3-1.9-fixes.20210401113225":{"name":"@atomist/automation-client","version":"1.9.3-1.9-fixes.20210401113225","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.2","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"c35598d0f26340d2c92aeda177688eaa1ee0a587","_id":"@atomist/automation-client@1.9.3-1.9-fixes.20210401113225","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-eOaL7HAA4/ZsN0KtwXvPCeDDw96LKI0B9vXZ6ps2x2bE8tK/llc8mVnC+GaisnCt5djFATS1yykRCqEX3hpE8Q==","shasum":"0ad696f208abdf4f0a701362fa882a5ae6df091d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.9.3-1.9-fixes.20210401113225.tgz","fileCount":1034,"unpackedSize":4645252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZbAbCRA9TVsSAnZWagAAbuoP/1KRlBlK8ioKDEX+R4F2\nt61RlOesNOKzXJ3jX9QxOfNtBhgQBNUP/JG1ya5A5kCYb0cwzf2czbDRb1d6\nF8R4TUrqrOACOibUAH8jzvMDjFK1WLJJsCuZgNRZpmnQsQ6duW7HGP3Prnvt\npeCjQVJX5KBFU8NcKHleDaRrlwEG08ICzP0CpJv93/tNadTP/jW8rhuSOQNi\nuaFzpFB799Ts9FFIQzzK3g9uXNM1GOmUXEhXIcRFJ6n/K2rZBEpg/P4noEnL\nE09/ETJu+SSK+9svalfIJqF3aQ+o9bJVdQhMWy34pHi24r9SDk99i4wWUo9n\nui1P+bf3qV/qMk5kETgdOvc4UWcyDInBoSsOr6ajXFENjxiGOS7LeWTMFa2C\nVCf2S17tAaOLLbZgqabEIGFTLGvgFCh7WIKnlMCiaW4cLqpymLkKehd8bLLB\nxHht9bGNVvf0cAfkNH5axnZku7z1j5SvvF0yUxuS0admdsWYEAhtmKb8CPFs\nKHIpPgTj8k9htbQxKElYkhueI+ZQRiMz+f24IK2H1p3XBaFXsGKN4YUJXR0q\nH1Rjc9QoFHO5R4nUJzuJ0w8W9PcGHsPotq/cw1sbFxGpdK3jjHL/WpFqkC03\nnyQqiHI/5nnBUeMtZ4MfntdjsE0aqpozxFCgGb6iQ/q+HLCTowJll2Czown1\nETci\r\n=TOY1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAovTLb7da5lLkY04XgOQKvDFF7Qs4cRhryMA9j/rSZwIgC+7yvQy1Vh6qjLdq/VyEqeG5u1KFGsSwOmOB9U1W4jY="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.9.3-1.9-fixes.20210401113225_1617276954604_0.4733281317183189"},"_hasShrinkwrap":false},"2.1.1-main.20210402083233":{"name":"@atomist/automation-client","version":"2.1.1-main.20210402083233","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"82d2922178275424abe2bc8930d868d3fa7b720c","_id":"@atomist/automation-client@2.1.1-main.20210402083233","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-RkImYSVN+GBUHHZjvPPY/cv+3/i1zxIZ6Gort2+oZ+OlCPHbHH28B7PtbZ8CHIBjP3tLVBOS734ckITzn6SVvg==","shasum":"de7f25a212d02d3aae5043e66e69cf7355875e23","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1-main.20210402083233.tgz","fileCount":1015,"unpackedSize":4289963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZtdACRA9TVsSAnZWagAAlykP/jKjBF1WtPnB4YoLyocf\naa23cY8lVlpQ6s+/Z2tvPTWvD7Zer3Vtki13ksvWNhYwnjZoJi4brPPN/hoM\nmxDIqsdkKzHG7eqkwf+VJrKawvp5xsBRXTI4MBk+ABwAQjJWZhOvS5OGe5gz\nFKUnXVRjUJ+r6v/A1UM+VKE2eobZkw8ep9Hm1MD0OZgvC6esbs3gNqIb43ud\n6JHIRvsfC/UqcJ4OUGbXn9WQ3vgnDJbND4XySsrSpr8eM1OvvBDnO2fzjNhg\n1YwZc5BznjQr+BZW9Jp0WYmzFrvGBTDOCRfcBbiM3K43PRTjJvyl8N5hSnNW\nBILHbCPdi5V/ei1ftP1azXAhNYed2MZe/aNqQlaCc8fGwN4HNa6BgI16QO/G\n/p5PO0Sr63J6Ut8BJ2m1kSJQlpOXARMzkfGFAjsD9BHvPwKQ6KtTAh4AeZnx\npRdABwlHU+lRAAM8YymxQYQqMOPaxBNgZuqKqn3c8Scd0V85MJqPMVKWgB2R\n2v3UgYrWP9KAWjEpidDpYeD98Ikl3RS2zZrh6bvtwwT19O+7pCGVQaG1j1qu\n1VUN0gKUu00TWB4FNsRKdku56DgtRNHsyyLOlrVDeE4/o4KDmkuPwX3YA+g/\n1wx27xop67zRZSiN5fxMWv/eSYuyhAA/+dwQWP3lZppJ1Z/0+ILz/Ajak7mq\nBFSu\r\n=4SQ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAjlqudmSjYP/HfzujtaQcFNJx118Ll3PPhLkzxU6jXAIhANiqTVvYNWPjx5QaoM+yr5rYzwBWLXYfgXFHXfvPQs55"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1-main.20210402083233_1617352512003_0.9245777804286752"},"_hasShrinkwrap":false},"2.1.1":{"name":"@atomist/automation-client","version":"2.1.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b1ca7a67068f09f5fff301554ea90dc16c25d4a2","_id":"@atomist/automation-client@2.1.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-tv3/lIkqBaNx5cLVqbwW9kxCI/2KC3UXnNeGQXAXdt586LH4IZz9DGTng769FpWfJo2NYBeIIpXwRPd/ZkPESw==","shasum":"d363d7d0b84e6cdcd10d573885c2afdf090c9807","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.1.tgz","fileCount":1015,"unpackedSize":4289943,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZtnKCRA9TVsSAnZWagAAvdoP/iOtRioUbt1QuoSgcxyN\nleeR9H9QPOQ6plwgFTv5t5NvRJn25PngCbEA4lTGHCSmcqoMQ/zrQMVXcR6b\nu3g0g1W5xo/u4UfGyhjpvnV5qKf/S1WuqDCtzKRzBwOsbYtGNxGrFSairMVo\n1Jm1nfF8usPRuuduck6rAKGJCQzGMGwYTtvbEIu1stNkY596i9748rwAzRjx\nM8O2OQ1w9CBfNrulhJxGhpXGP3H2En0f+uhTsP4N6OsOhe60B4XJ3PCsue3K\nUWoQc6VL/XZK74xpTKOanr3lj/cHRzIx8C9RRyXYBERrK203sKYoUUVVzypg\nZO6bGYrs7bd1P/8pEQiHlFisvmif08NKkF64xM6sRVeKXmTqFLH8Z48cyXPY\ncpaJ5NSfnqGSs9/mXYqHiLRSy/6pK9NEpLrvpSsqDWUgXSqHw2+QelpsZAme\nI+oHTotUgi0LiPvkIdykL7gVJDoTodBDbJgj1gsbyb9ijmllEsP4MmgapavP\nUB+kCVVzYzJScoY6L5knDxxQPtowt0DS6swHTxdBi3QK0i476AOqij0u7SCk\nJwrIx6bBTLICGvZ05T503HHEiEYM9JoUeFN8UzCu5ho03Q3DTuTPYAnZQViS\nJQQ0QQNdpPHHxGUpVuYHX7gb/DdBr+KIfaYFjksPgZpUL6hqfKRs+AB2xq3T\nQhz7\r\n=8nTg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHTVv4FSbxuuCQgKucpCSOhYUSwaBVeZ266ZwIJdFOPFAiAJJBmX1PFVbC+Ayn01ptoFctgVGfDo4SrUKCCjDaP78Q=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.1_1617353162099_0.9432830759689992"},"_hasShrinkwrap":false},"2.1.2-atomist.npm-update-main.20210404120333":{"name":"@atomist/automation-client","version":"2.1.2-atomist.npm-update-main.20210404120333","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.35"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"22d368edc434fe72a7fd70d803a2ffe69ad455be","_id":"@atomist/automation-client@2.1.2-atomist.npm-update-main.20210404120333","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-JxVA0MwZ7pEwWO7F4szDlhJpTLfMNbC+7Gr3ju/PweOUp1Xuop9sc0MqTs0DHeHcPh4dlEOtEYeXg0i7zLA93A==","shasum":"bf162451bfe9521ba62e9ed7659b36c492580cce","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-atomist.npm-update-main.20210404120333.tgz","fileCount":1015,"unpackedSize":4290075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaau1CRA9TVsSAnZWagAAJ+0P/R/p+7wRPPkpTNLJQUg1\nTqBsX3yHfNJyujv0JK9QJFrfZquPJ1GJK5Ghwisohrzh01DDfVsynvyOEqSA\nmPeqkX9tv3+a08bBOnnRTPwzkBvR4/uuTXXsdct7Y7UhlDVG/fLDHGUMCWDr\naa7C/T/mmFiLLTKvge2TVNvcoLxVObneTYmFyUkM04i1JQYR7uMGhaV3gUss\nKxq9sGfrC9y0KPJa+VLYI9zju1rdA1Rrr6e6vsV1VlIw9DHUyPmbn/sc3Czg\nSPY+sK3o09fS0+x+DaDLZrwCDWdYRF8QLGo+nuUWSeANMZfwxBrdRHW5PkmO\nkOjsHKNoq1sGIvKUqwydW8tGqDyL9Pw/CfkftYW+8N0p0Qr9hed9GS7oIE/p\nVYjNrmL8fLeMnmeuYgH//DkmF52ssCPN5vdke3FYnRZD0bf6qR+sVBqd6eHo\np/cz+l5zO00aeMNK98eTiSAFczQwLGGoaWyeoIVInXSxTv65YekrRtpqC3qE\nsLY8vWo/ilbiiOwV/Rw33wSsF3oFoeJBZ98ZeKOLA9EHmGvpCs7FRW5oVEqN\niSs6C3bdEPbNBkKkHf2D2jc4lMme+PaOkuMTYCAoSv6AcZ+ttNBlY2z8EyvL\nJQKXNICQZQMT3EczSfcmJ7Z6zGonJ1k/snSRsAikGzZNfcQ56mBRq/eujyL7\nOTb0\r\n=GA9K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqcrfIYZJz++7dTh9REsLRVDv9uCnOw7j47qo1UgpZRAiEA70MpFbWKmndGbdQLkjHc/5kexSVwz2xUSojBP2T2C6A="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-atomist.npm-update-main.20210404120333_1617537972606_0.04685726752040953"},"_hasShrinkwrap":false},"2.1.2-atomist.npm-update-main.20210408120325":{"name":"@atomist/automation-client","version":"2.1.2-atomist.npm-update-main.20210408120325","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.35"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"65cc59fdd92582418f1ce717f986a6bfb48cb13d","_id":"@atomist/automation-client@2.1.2-atomist.npm-update-main.20210408120325","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-IjO2S+DA5IP4+hNcNOrE52j9JYgEhAzU4NQONpJDNyp53AlRe4mZife9/YqforkGDl8OcO96qAcS8woj3yM1Rg==","shasum":"b1a01be26ceea4a2aa11a9fc5ea0a17e9bbaaa4a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-atomist.npm-update-main.20210408120325.tgz","fileCount":1015,"unpackedSize":4290075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbvHLCRA9TVsSAnZWagAAi7cP/Apwx5BZ7LXtVQulSgnm\nmWLhLoLWp274E3oiI38fLXV0QKQH7mGPAFuf0zFR4NkXEk9cjKGTyg/LlrtW\nPyORKKlB5thkvVXqmSyoFsG83ouk8uu9QkxFX4ercBXFnmenZ4mS1ZzqaZuD\n4ss8Voema6jI9YQ1E6dgZnbJBdU4mXmQbHdaqSchkkxjD0phMlVwNYKNr3dz\n/+4GVFYSfG5JRGxHyUQ6qChGz/qviqj0McwEEcET58kbDcTkK6eW09ey+kDs\nrOxunZ2TSv+0NpaSULqsZpzjFgYaTqCceIZG4jl8O59ucTutWn0A983kvwWb\nMlXc2pWwhf9vQwPX51ll1o0h9vqZsJoQbkQQOWlgHfYRkAjpRWcr4WmDZsuq\nQaXUexmqr7OlLjL2VA/jnc9ce6CWeCTg9Satj4/g88Gbj1hxquYxSxtRsUe0\nqDJHJ+VzhvKVxxjwdokgtMOKj18INHRlJrXDmmcH3PVxzOpZ6rk8fksXXBLS\nBA5Id6wnlo33i90lTLrha1A5hGOOaihXVIexTuydhpTUWPmTx2O25ic8HfWm\n0exOah+9NO2s+eN8l8GYz9mRQoGlrGfbDXzWKcSaPPIEv4moEuit+AqgvFpB\nT/wAC3Y6QHx4TwrLzXfxLdMLfVgggoN2pBrxMGps+AUAS1lgXWn6U/1vcXL/\n45j1\r\n=7dr5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkwE1pQ4lChy28B8vq2nSIBLV/urPoANCNlbhooLqEngIgD53F07R3Mwg1O57qfjX9EmecjKUCj9Oe4SVGAN4UTaA="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"ddatomist","email":"david@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-atomist.npm-update-main.20210408120325_1617883595117_0.8750678794018032"},"_hasShrinkwrap":false},"2.1.2-main.20210504155131":{"name":"@atomist/automation-client","version":"2.1.2-main.20210504155131","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b48305487654f9b26adec5ca939e6995edfb4f67","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-main.20210504155131","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-KTyvp9I4tINWsdm8ZiGFBS0ho9Dvxz+404pGd5NTLsuaVDhtSTqu5RSvNrbp1QuLd8g9nKd0EBWeUaeK7qwcHg==","shasum":"2be61582ac8fac10eee0abcfa4f259a68421cf17","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-main.20210504155131.tgz","fileCount":1015,"unpackedSize":4280296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkW+MCRA9TVsSAnZWagAAyuQP/AjlC/JaH2IcfPpcJNXI\nWovzRVEvovLUqIAdNy/T8Oz3sTfLuvW2MtKhvEfzbaymF7ns8P0CDKGOdU6q\nVJrzK9wNLUS/eNFD5XzyzUnBcRAanFIdvo0YFY05wWCLyxcqISFCe1iho8o8\nxeTig1GbqXSZomv4/I7TfLwLG7UtCv/OeVRnNxC3cMrZDANp2fRD+1uZ6ehQ\ntmV/SLjh6886Yu/ii1Y1iz1vmlTUaxkiWPbojP0bFsmuaI7PkpKNUROUYqhq\nnGMDOLZsTfC4l/xyVS5AU8YbU+Y4zt3e/ceWzbed7U7z/ZXIxfOjTBBd2EU/\nfbBRQ1hkhH4ZMt0iuGnDflLG65lzJUHxUj0auJqkFbFr6EfyMIyv4/Mq/VbL\nCG6I4C20vVVZ+ICmwTJ9CdGYMgSBDgF/hyP15hnLUyaEcvhjxt/lKO2Q8yKn\nXjBiUP3L9EY6wGU1Ue2+2aILEQRDj8Qil60lSqjV7Wu0tDP/P3PWiZMXiLp8\nuAERXGbrdMZQg32ydd06cyaH2+C0zaYpa0EZKcq25CNLXAIRGLWuNqZ5Q+Fi\n2X0wxTfjxFL9U+N+u4/aEc7XrsXrrInjIVrxWP4H8M3Ofgij0EjZG86kNh1v\nd0d5AHp7pU7ce/NE/glNQrjTy1LTFTa0Wdm6gnOuf5CG5GAKlt3L94pSkwsK\nuOd3\r\n=wEGs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo4ZUiCvj8vLM5WHf5NQR1Jtt0kaN5tOChklFpF57fEAIhALKhgRAswUoBgxgNH2Ja5tNrvlV+Bp/GvmVn5+YA8rbP"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-main.20210504155131_1620144011771_0.8025367834471497"},"_hasShrinkwrap":false},"2.1.2-main.20210504155812":{"name":"@atomist/automation-client","version":"2.1.2-main.20210504155812","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"c100257e3c2aff5195c4fac46a225ae515f9c7f2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-main.20210504155812","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-I0AReLoK+CpbVWpak/LhTIKvNsybVji+BMIXzIGsgE5CgXM1jgvYFyjOqgMPtYA9hCMT2Apu85MN3IBCmiFsDA==","shasum":"bc735261ba196f5b1ca614403dcce570404d4eeb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-main.20210504155812.tgz","fileCount":1015,"unpackedSize":4292813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkXMJCRA9TVsSAnZWagAAhxkQAIQgQAlWCaMZK0FCjA28\nFelnxS5IOmjV9ADzILAusKy9cwcHI4B6BlQF/uXbQ4ZZeeg+/6+tQHtbTY1f\n2JD4EWu2FuMp/pNnPllTnbVlXbhraNZM64cjez4QiDs71pXiKdjzJ4NkKkF/\nNz2nCakGFl1rNSaFLPEmxTCA1R+yDCwtPpHZAXgvgjw6aF+X4fpkIVoD1DXb\n+LVy5xt1AmK8OvQ9uFjqgQPtX+XsDCmjTTsowkOrUVKHgMOby45FUCqUTb0P\nrg3r5kDf3JLEPoFF5xprLRoi87PrvnvmJJt1HCOiTXgQ/kOKoOiyB44vfWoW\npB6olXkFUnfZS2fGzirkzUmHEkB06iX3bQA4T0yhjL0PcQ5/MM1U0oLkyd2c\noywUx8jd3viFhCGN6OHYeSqtBAtHeu+TBMOaTY7p8U3r6EssDt1i+YQTs682\n94Bm/WtFb57tnU/S9WrsJKlqujYcbYJShTiTpjHye6MiAyCSwj8Cew0/0cXy\nlV8w1vCpJXC5drsPA0w4/0zNMuRhc9Viz/8t8ok1KkaUZZejFDD4uSPvTVtI\nYA8vosR5/VErJzMOQztaVioDlt+b1VZUdDfERmvPRuPYHHOPVr/ZC3/EepDi\nKxRIb42six+McmrOKuSv8TFPXMqXrdXtIqpsQGEjc/l6GAsraGWrH4omLd3Z\nkfcS\r\n=zQ7y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID32YJYz7Zwv3V0du2+CsUUwY1W4snKZeX3fATpYOjPBAiADG7aMuativjTIfhO7lZ5vRl3iykK+KZI13SxaD3waww=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-main.20210504155812_1620144905392_0.019040531394735494"},"_hasShrinkwrap":false},"2.1.2-main.4":{"name":"@atomist/automation-client","version":"2.1.2-main.4","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"184a2815d165caf55ff6f96458622094cece78b2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-main.4","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-jpvyzspPzQR5ItmNO1dB9qfcXPk3fmB0aotpxS+7XqrMT/WBTgBHOlaWoKVBgmyIGqnPDub9fqW+9+XCzqd4GQ==","shasum":"1a5160a896ff8bc495a122f4148d912c32bd423a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-main.4.tgz","fileCount":1015,"unpackedSize":4292807,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkXXaCRA9TVsSAnZWagAAw6UP/jWsr5svUzl+KZUZ2Skg\nk5jynnicQsZ6BPbuqmEqEzV19s3xkIGzGcsSYw33HwxZsTpbyf0p6R2BGWvU\nJZTD3QQZBrIgvqLV2J1Movy3AU9l0u9itxQcLJ8Nb8xtHAcHNhcfo+oCedsf\n1JMPUpMw6/e86rLV25/x8/TDB7YUA/AX84YCw9CACZACNsssw97AVJOWywsh\nyw1s3a5NoPio08QbC07kFf0eBJp4LNOzmzc+tJKdqnfxOGPY/punMasDNI4L\nA2zaNxFwSziTHHeDwISjiZ4oM+X8p1llJa0O+UwJIBxRjAnJnoHH5bRa2coy\n9lHzk0eHXTbFb/hDlzWFN7I3MZ5RI4vr0l/mbzu1P/Ab6FnTKKUP0Oc6mh8c\njRZBcLxy5hKMAD7jCryNgPYV/9QaiPSDmTZ96PZbBCMv2LURtyaTWhgKZr1U\neOvpqDnlxNci7yw6xK1i5K7SsV2itOHkCPZqGnhPToIlQcTE6SROado6jCBN\ngZ1ENU0S2r0gKuGLSODS/KSNNVZDip0Ys6Yzh4EqBGVv92mNYnjeDonoqj53\nM5XJhoXQRarskVyQgMIwYFdXad6APnwVLW4Hxtc2ZchqDWTdY1CjSSFbKqBQ\nsn1+wZPpiVV12U7sMjUWVZTWLpThHCDsdUGXZkCn2X/1guyhYJu0tz+nvZxJ\nlqXw\r\n=YUpC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNIO/Ba7lSg6fPzmzA0clVZl2T/MJjmSwv6MAtYOitHAIhAIJ8sWmWTCcseR7gLiYFMbN6Q4ln/LQ09uAwRoB2DavT"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-main.4_1620145625562_0.38093497109292684"},"_hasShrinkwrap":false},"2.1.2-main.20210504162439":{"name":"@atomist/automation-client","version":"2.1.2-main.20210504162439","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"70187e99f2b07d3168aebac42506dfda6fdbe171","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-main.20210504162439","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-dYiX/ZczCou0RToWZH7JBeZllAe9ZRAWKS1j/fDSzVPsxpbQo8puHVTeOw2myuk/9zszhFXrF02VWWa0R8FdVQ==","shasum":"78fabdc2d11b23cb83d01eb38ef3a39c9d668f4e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-main.20210504162439.tgz","fileCount":1015,"unpackedSize":4292826,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkXtgCRA9TVsSAnZWagAAuB4P/AuTs+0DnADhIIWX/a09\nNYj42NOke7csx/PIoKzYOPGOPpzMheTQ7ceDDE1pd/F6aSYIIqo0IOGF0NVn\nfysCQpx7LNkhIteY4gYfkTjq6XR03vimk+JkAZWKv+W5UJFhMdmF/jCQY0tD\nJ5aja+M8JIzjbdh6G0RIsCeMD76cnKwucVHjV7zsDeFamNFv0PuGKHciD1+J\n3wOskp0FdMzAPTGfz4ntKQmpNFKREPTk3Tb4ukN1AnUp+90V/LbbbKSpaRbe\nZ0NmYk6R9GqZvEp+pTqhd0KwJppeEQyoOMRHZUjCMZSKcHHiuHzcrKdiZDhP\nYe4Cc7twKRaaieTriDVLMEGBXwHyr2JMMkZtV4mTGi1elbaiYOl5N7zt4K1T\n+QHseoOWw0XywsrIWu2b2g5X9jkKM20OneI0b/m0S9OGwYIq0bgR45PPFt2v\nJh3tsIoJzNjjH3nyS2y7Ut8ozFcsnmS3lCqU4V4hs2o4EkuwdRftwC+RXdAG\neBoJ5qOg19Ts33R8fvSQFk6tNoSl4s3fM3zqUhST4B/udq6Hv6aUtkQF1T+V\njrByM1WU8VEF/bczTSj2y+f9hChYXj49Pvx9s5MWIjEP9E/ygHerVVA60lJh\nsqgaLpboXy47vwK3CW6Djy+fl9W7aYtySfNIhwqzaDDHOy8A2lCG9QJaYpLJ\n0ga/\r\n=Qabs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDT/X4oKJuSn6gWPpMXWLc4hcp+XUXElFs+2op8LmoDKAiEA1f6nWUT66bxvE8oT0ayAcqvqLOTD0iSPtrjwJd6dr3M="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-main.20210504162439_1620147040345_0.44897397492761426"},"_hasShrinkwrap":false},"2.1.2-main.0":{"name":"@atomist/automation-client","version":"2.1.2-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"0d3ab0ce031a3ec0481eba94cac6379b6e4d52b7","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-main.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-wJirlK8KlzPmFhKrX0yDI2kAIZbygp4OvWeugRsAkhhfa8KhhaOcYRpP61/OJ5jEcIjcNftrJXbiVEeHtyIn0Q==","shasum":"131a27170ac7ed7f41ad4b9a59de4f6d37c66fea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-main.0.tgz","fileCount":1015,"unpackedSize":4292812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkaZyCRA9TVsSAnZWagAAVv0P/2SGAaczBJRnGvaW5/CQ\nEfteAhs/o5sN4x8K5Z2S6Lvdlkv3GMaq4xA2RzwOCb7gASap4ae44bO8vdQm\nTU+gEeTcvuKQWn/Dmp6GTrqHK7wDw1yxh5HHrNABEUpa8mBnZ0vlsCg5Li37\nCzjMP3vLsk7/hOE3ER31oDG9cnf1N3s7PoLrqLlpaAcLIbVE7vOXu8Oqv+B0\ncSr6qUQqT01cGm9aqqpGS6kJeUSO4Je8h1RZ+wlcfIRRdNhF3ISsstJFfLOh\n+fk1fCBC66/M1kJVcQ7oiMcVGJhP3gOC8CWt+Yh6Ez0P5XZ85By+W0J34nmh\n8rVwCFrhma4jI1YHwxKRPpu+wgNYxdUMFyEHbSRDvBv+m6Kb28jR+u7lKcIk\nz5fAjaRolbEh7C5phqv9xSTwMbUTD6YmmPbQwYRaZBO0AmJHs011IzDD2vh3\nYrTsdYbJeDwsjLR1d8ZJKu7Yihl8ZfJHJktIKKPQBHGtA93qAFLuXxWqI8f/\n14Qabn/xy/OXmZ7Uf56+1GtVb5WXPU1mwEwqJqS2T0evvTUCAGKDkprq1lHu\ngYuUfbsYf1y62juixV0h9wIaeXsZTtXVDAGrHHvmk6o+lbumSzo7DHTOoaXW\nOJYVZ3jv7KgbPJ9LrcHDukz3wyY2PNuxDx6O31LCal82Og6lCbtNulHo23nv\n98Hf\r\n=4+JX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqd0OJe6f6HHzywVXGT6Dw09X4VSc30rPO2uVJ+yF7kAIgLg7zQnHuV7w7mHQXSwI5UwT8f34SA6ip7TgpQiWqv1g="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-main.0_1620158065564_0.8426123251969242"},"_hasShrinkwrap":false},"2.1.2-branch-atomist-npm-update-main.0":{"name":"@atomist/automation-client","version":"2.1.2-branch-atomist-npm-update-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.0","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b2b3baae24b89a62c90104452dd6633ced72369b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-branch-atomist-npm-update-main.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-3Y9BqKTwYA7PhXbdeOomQtOoIDwNaiszhz2sNhSvWCnB1cL1ojnGNe4Wki3usNan+9uQkTx10jPv25PovQXLcA==","shasum":"bc606ca30716bfc631ee74bc1a4aefda5b530a70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-branch-atomist-npm-update-main.0.tgz","fileCount":1015,"unpackedSize":4292839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkooRCRA9TVsSAnZWagAADKAQAIgMHJ+rOGQzY9krC+57\n8EVDZTNz+ECsdGzW1i4Ml7GypsnOPiq5rNIKE4taQ0VyA/SDloc2NEC9kBpo\niwM6x43sN10NY3CZiT9N6tFDeJGlB6objdWxTxQGWfGSdoVvCrysKIFbAVSl\nf7v+/qsUpj9tWmj3AI/ViiGHI5jVLD/wqPjhbpfK0M592T4Xu3eZiWmKL5FF\n06t9I5Gk+fI6myshFy3yo+/Zf+FMF4S3y0VINCI7tZU0aJdFtV3cmITee11G\nRs0NtKEqkAgpct0iGP+2zcwEK0LCYikDiVjduMEzwBRlQHa1jTmXTCzM55Ne\nTgRierZbaR+UqcyERWvIiJYTKKNswWWFRLax/p7v3NanZhOBByNGhGyGl9lO\nQdbRVdDgkb7rzXnbyt5R2WXfIXJD9D+iSkKxSIlm0+Y3ztuL3N/Klnk08X6q\nwMb+dr9ocrKTDENyf7VIlNPES/Y0OWiNxUST9AD5O82HJaheFfoSo1UWlYUK\nZZcIy++92vkAivSDkz9eGedEJwKkm9gsRZhkLKP6laMaNFzcZ8NE5rKdNfE1\nVHTjbIqblHHMV2phbHgiWUE08prjFgZQ/oXnY2zfcrSzNFZfFmCBnGhn9REo\nUYGCAgQp3MTXvck3XDjecCB4/GGZ2lZ38DuHyVewIEn/6gAZbSrc5AjuoJlR\na2uC\r\n=Hwbq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6fhFc3cGcCZnUlF+/0IRMjp0NG1c0ZqN5H6pgWEkC3AIhAJa8U+qYU4vTT5zhCVV+JHBhDi/E+frU1O3yNaaiPPBH"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-branch-atomist-npm-update-main.0_1620216336627_0.7111562773730697"},"_hasShrinkwrap":false},"2.1.2-branch-atomist-npm-update-main.1":{"name":"@atomist/automation-client","version":"2.1.2-branch-atomist-npm-update-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"082e093c6f44de5c5252fb4d397f5278514fcfe7","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-branch-atomist-npm-update-main.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-rM0Mqdmv1K+ngw6gkuzuuHAEWiEVxwVyoMMzpljRXFSU9tILiWzujFUpq6ZCD8G4Q2CBnrKMPDfeMBWKwFw8hg==","shasum":"741cc74316e28fcb64ac6e24f1a334805a09ad1d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-branch-atomist-npm-update-main.1.tgz","fileCount":1015,"unpackedSize":4292839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgk9ugCRA9TVsSAnZWagAAoFIP/i/BapkjKgtI0rJ2ScvG\nWN0vO88HA1zfh8ld8OOKHTCnsN0Gvdn+ZQXdIzdUiahLQZ7srI/4SDUZkC52\nnjzEHvXnN1TDPUltzB61dFaJJ1nEXxw4pMqctknAYjzrzQkjUkonB5p8eujn\nfiQI9l+v1npp3K+VdQEQXxs96vGv44QZGZDTDpsMxs7FP5DH/OqcsfVKPpya\npbpcDUSoV16PIAhAjMIfWpJjMRK0ycHz69K4b5kb/KpcVrX2n+FMxbW2HjdY\nDcF/iFrOUknN/fDEQRN1EvxQEJ/fgX96VRS4Cou67nac2CR21y5w2pK28BH0\nFdypZVLHecAwBHTvR+GRSxKA5n5WUkqzbmnealsGBHBhwpvOZPnZYUkBYH6l\nBJd3YIGIPNJqThbQLCQ8Nghv4OjXf0+D8ZWYXiIa0Mk+V82vc/F0eY4jjTs7\nQklWVo3cL+1KTOfgIP14zE9OCNgsBSnDtBL5MW3lVxgtFIz+gk77xFMjSG9v\niH0XfA2UfpptDMCOiMmn9vfU8j2/kG2CobswKNsBmk4DoIV191X4wsKqJK63\nxe5AmIjzSG2bhsMYmVzIIEwfrp4q6KMIyYo2hzzHtKB1/4/mUd3ygEspm+Nh\nvyxxYmJUkqzoWIdELPxqSXIpzj44dAk5itejMHsFwDB+Jlsfo7/l0Ot91MNf\nVVBo\r\n=Rbyq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkWOyjmKHXmMN9DMtHhtaLE1fSAIjfEIfJDzh1EXNaJgIhALODpoTxfvhKrerYpjrJi+YmsRPrhWppox2OGf0eZr+A"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-branch-atomist-npm-update-main.1_1620302751679_0.6791846847594174"},"_hasShrinkwrap":false},"2.1.2-branch-atomist-npm-update-main.2":{"name":"@atomist/automation-client","version":"2.1.2-branch-atomist-npm-update-main.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"42ca5a94a0e7abb10fae7793782fab3a3994cb2b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-branch-atomist-npm-update-main.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-U/CJMubT3GXRTm+y/0+SeEo9OO8o7+iZiA8qCrHjo/cl67ggGqYuE1T5k4pyFDSAO5FEZrt25NuvbijwyXY1qg==","shasum":"66c42f395df2ecab6da5a6356bcaa385209d72d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-branch-atomist-npm-update-main.2.tgz","fileCount":1015,"unpackedSize":4292839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgln7NCRA9TVsSAnZWagAASREP/RbLcWYy6TDdorvV2zKe\noeEYIH8Z4ilQf5tEib5Izzcw6QKQR4xKzZw1pdrV49He7Zl7UptXCo2jwiBz\nkAweYamOxBJKZT5hNuOU60i7WgovOUS4ORysniB6pJU5XFkWihgqgyymqR2I\nQmjUMluYu1VpZk0loLyR/fDNyTEQ9UxU0KPKWyegpsAAWmmV34HfaThEMvKe\n/1icWjKa0naXqQnC9Zxa+ltouP1giqgKBQqzJ42cH+kkOQrFPSgSYXKBx3HA\nwSDl3VOiWZCLfpVMn39MngAJRuWIxtko9ptT+JofksxZ76oJDOhQ79gTFdOe\n5csQ+7smgJ/xEkpzzSa1ocwdAr9MRUMuE+Mv1Y8jzW7zJUzWtkX1JRft/8U7\nDQam9kBAMjlX9LurLKeFO951nrYGMKA/UF21H4eUrwhZ9y60WqJTJyhBgQlx\nMTk03wxX1DnGFvF0vUkktFLA+x643s+GKaGGJQsVMWbqZt4vrGggcHZgQlse\nGbPtnm9ENEg8LCVprg38SQaSXWTzToo7//si4F99BmAaBd76pzFnd2Mtb/PD\nrHBGpQ8sPgz9WcvSe+f5bot78Zlr8QzKJiPgQZlJuHIWGUBzndOlrlcYn/2K\n8ermhR7a/2GiRCfJIvvOb+8Us3qV/GMVySTlSx5kFsRMOqQLpToMA/dh8ZXj\nOg1K\r\n=9Dv9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6eI7Xe+2t6HlL5jv9UF3pEtPauveVKXU+FKJ/l0EAIwIhAN8D2RcvxDzau5+AQiPPyqdb4Em6uNhwj/9zMvVm6HRn"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-branch-atomist-npm-update-main.2_1620475596891_0.02705021822271214"},"_hasShrinkwrap":false},"2.1.2-branch-atomist-npm-update-main.3":{"name":"@atomist/automation-client","version":"2.1.2-branch-atomist-npm-update-main.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"e57ffaca276180b0e7942a9259f5e8b544fa2df9","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.1.2-branch-atomist-npm-update-main.3","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-ng30ChE/jtUg5566ANq03VWPjqsCZTdr172BTfT3q2D9zD8YY41FaPvWNcEuHqCZaDFPF3viHuvYywBkQl5DpQ==","shasum":"893cbc39eaa93d51dd1f0767c2a94962458ebb66","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.1.2-branch-atomist-npm-update-main.3.tgz","fileCount":1015,"unpackedSize":4292839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgl8JTCRA9TVsSAnZWagAApoIP/3QSN8LSwdD5GMxQbUhf\ngL2a6iubq32Z88a15qY1Q62Kq1IHKUkSWzKDrWR0QDzNgZshGrgf0E+piLkr\n9Q8G+13jXoLTVREpt+lnBYrhU/UjZFH4Ez45NIcnxdYBrUYb72hAPcw9IN4F\ngANjiNIgjBDt9ZNcWBNWQOFjQEsLDOLXrfv6mtb/ms9Lsk1nprAFL5U2Cgf3\nHItDHZ2ljSCCXs4dkUUM/BntS+d1QWhMYk7/99ST1muyh11Ttm1In2Q2b4zi\nfG5MxVeUnbzWxjEoNupLSjQwjRtOg19TNLWmhOWgAQMr5yPlgc4oaQiYe95R\nKrrQ1urIUN4m8N9ku4kjYnOY6dkqa5tDUAXZeZb4peC5zQTCdtenCYLkWSyk\nAClFr6zHHMfv4fTalDODxjGUyaBhvtovnxK/L9M1z0PFHsaAFfKcDEGiNCz9\nTpUnSGRtX6tFv8yVpIrBnlJWEn3Ggl//IegigTbgsdPAhSfwfrb1yR2JFHkG\nVEui4Iyznd0GH6jCG2qnWyzjJlH4Y70CJbngJhehEgszurxygq2/CTqjhpeB\nruWBzLS/M25kBMI5a0cL34PVCbbQhelArqidsn+D5ovdXI6zsUOOjStIP8NE\neXf142TxFBd77A6wHvWBHJfqVK9Cr/riqZ6LnB5G7XzgKJ5ssYrLluQzAH9v\nA8Ob\r\n=zR2A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfAFVSTFbJbfx21xRSWW4o5sYJPzGvPxv7dX9VraMP3AiEA7tNOuBFZL3sV2Xje3+LxsPZI2+CnSFu+mV0cKHiPO80="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.1.2-branch-atomist-npm-update-main.3_1620558418732_0.2723916442235692"},"_hasShrinkwrap":false},"2.2.0-main.0":{"name":"@atomist/automation-client","version":"2.2.0-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.7","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.32.5","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.11.0","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.6","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.3","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.4"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.5","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.34"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"17056a5011320ed5ea71433edcd4b839dd4f3fe2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.0-main.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-FU/SIX9UAEv9r0hhv0YE2MQrezRG0fXVCPalcNblBFfKrop5bY97n8Y0pG+zdjKEaB9TzyZGd1Vf0aNW95q3bA==","shasum":"6a3af571a0c65f0a16421b63181c054467af7c8e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.0-main.0.tgz","fileCount":1015,"unpackedSize":4292812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmN4pCRA9TVsSAnZWagAAV0AP/Akz5DBtm9FpRwlNPo6Z\nvvhmdvxvJt1V9N3Hbb7zwAf5Z2maqoC+KltVzLgP0sceW94o6jQQZ30jj3Bz\nlLLmWTiAVO00nb1xkNdUUGYJZ+vnEyjvP9af+rQ8KJJEeYzVmZyOL24s0zTk\n8oZUEOlAEi+PXBOaImC1SJ+6wCDX7HBs68rtFkPZLpJ6Ts1Unj7DaxhVUW+M\nzxjkTDvnprTgvcPYwWmAicvvUaliKaj6S4WCWgJ8sS0uff17o1dPczpjbTDv\n6rFc5vW+guoyvEx9ePEK8rbm7yz2wzW+JGlavjj5tpyLgsqdO/xOEVM1mrgh\nrCWWmzNxsibE6fNoVKPtRqk1fW44s5j3CnbwpPVRS+JTdY1qmb4YCNh7jCsU\ndRksr7cKFSDkBmczWwfDi//+iflevMv+O4ZoRgIrTeqDRTbTLhZn8S2ju0+y\nMs2iY8FrbE/j5alfvROAgQZH5TkZ+WmfU8kHHvpK2kySBujWVzBD9td5ij2C\nlDUEUmcaFEkxxuIjVdBBtDvMPdmVfYBpW/Y+o/C7wuHn084rn5pL+G4920Lr\nPCzHpgtlhPBlEbqIdRzgkSe7LjiX4KPUH8C9KjAV7q7Y576XhF8nTdjEWDLv\n6f2qQ5LUcJ9e5SL/8YLg9dCjHRLG0xPLJNnPz6LMO4eM6m0rK0RwK1CcoKR5\n343Z\r\n=Wxra\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCesuOpY1mvNkt2onA7CPzFIkRZrU2LAdmxdk6Djn58bQIgdx60yf7hzOSg12+71T5KkSJFaXFhwLaa65kckBYO+HM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.0-main.0_1620631080515_0.9160273945520716"},"_hasShrinkwrap":false},"2.2.0-branch-atomist-npm-update-main.0":{"name":"@atomist/automation-client","version":"2.2.0-branch-atomist-npm-update-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"d98747b31888749419802d6cacf77b5cc6153939","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.0-branch-atomist-npm-update-main.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-Ri+TaHF4tALBIViXlymUSVhqTpkl8P6dvxOXp0ofAvzVMsUy57rVX3S61ysczMyhH8qbULQOHgwGuQ+k5TRt4g==","shasum":"5a6a152da42808d7248ea74b5c9ada346b9a488b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.0-branch-atomist-npm-update-main.0.tgz","fileCount":1015,"unpackedSize":4292839,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmN5lCRA9TVsSAnZWagAAihMP/0fP5BU4Sg/CjwvYQbO4\nGlpZqQyR+l7x0nCkt6LbtxHO+JfuvpyRKrPrtGh/LYNB9+gOwqR52iw0nc0L\neZasWvcJHm8kcg5YGYXly0xorw7gusJe1Wq9158JwSiPX2+mb3yRPhoa7X5J\nS6shBxnjWf4WEpZtaMkdKijD1IUg+Zhz/+U5UgfxgNGPEV7hrdcmLNqr/g0p\nANRoOwfI83/eUQpBUpOFtYloBDCuWp7Euu4DUwW2dXrzC3MhisKUjlAEe0F4\njozh2CKbzqLI3VPQbL+IZhnEV/UlX+TMfqsX3cgbxohS7MPeMWvEnZ/SsHvd\nxZD+5hhz9TlzCAZnmnHppxXyLgoiIawavVjCUEnBdLCllv5sFbQStl3P1ByO\n6P47UshtVst/OxScTGVEVMMPR5G3d4tWnjcdVETs8Hx8XYPu3/wGrT/3gyQj\ncEfGdC24KL14DlW4m5cPoejXQ6eqpE8deOL6HnYxiwtaTjoRZKlmROvA63pd\n6/mv0QEjUHbfETemHjAq4b404frxAqwaz7yAOUXVehXnN7d2IweM1Qeo596U\n3gf9iCoMZdt0BevaB4PYIsbhyeL/L0ZgKrHwvd/8RcVNElAM14ac56wfMrB3\nZX2v56Rq+Rrc2g1hgzs8pLGAxFxavnzHFlU/xeNeXs3Ws/OIALgIelTgQSRu\nEFPG\r\n=rijF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwyN9w1bHE3qXxWAITr94N/7MCuLmCMguOo+Qb4jD+LgIgGZ59C3fGsC7zGFRQbL/5e3nr/HGFdz2fb3YSB/TPbG0="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.0-branch-atomist-npm-update-main.0_1620631140771_0.2709032359361454"},"_hasShrinkwrap":false},"2.2.0-main.1":{"name":"@atomist/automation-client","version":"2.2.0-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"10fd6bc7e75afcf1e054d40fba2209de618f3802","_id":"@atomist/automation-client@2.2.0-main.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-BG3w3Zh+S/yjgtrlY7hANyHvL4NoClgs5r2PL3cnnhIg/mviuBUZKQpWtKMqULnuZqSyrV3PfqrWbceDOP0YfQ==","shasum":"cb0fb76aa485bf9f6fd60e70b1c33ed4a1a4fe27","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.0-main.1.tgz","fileCount":1015,"unpackedSize":4292813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmN+CCRA9TVsSAnZWagAAxb8P/i27eIv7j0PMR1HWUgGO\nEpU61ZztXhuuKpTP3g0peu5yqnhQSEx5X/BwIOP6BPozQqpr/c7WkxsZtyW1\nxA1LiCkQhZxYWvBmypFg+Dav5t36HaQ29FIm296A7a5+QCq2Z3e6jyVQCYVF\nbHRw+yLjZHOoydHRw2klugH84TplAUQsvAxXg5I74FiuxGDXaclHjHHz0xux\n7MAukzniIGj17hA6YJqvHUueHPML9hw7rztJcq3JPnXs6YOCwi6H9+OlvOvt\nAHoDTe+rfjLNuDYY0omXbd0hb7Bq54EkeRfjzHgDqb8+8/RJud0EUVXb66r4\ngrFzEjVnALjVdyZRurTfcKgnIFqN0gc4wQpxdFvyTAsCQIJIA6B33W0Ejj7v\nyZlNtmlRRzUSYfQKW99F73fmCsk7wc6lO+mLYwQZqg/rX+ERfxHVS5Fg3lHr\n7kEnd3H77tprEuloe406grZ1b8sCRCBKJQlzXpgG1JABDJuaGNlORsMW7KU4\nym75vnMjvLiYdJXiUPDnauDd1S4YxuP4lyTrBTTCulYZ2ahgmaRXeEggwEHV\n2oyRALjWsJ8xIS06meTLn/GgMWeRllSJAlQ0qhpnuULcjrXCcfLlodiu9rvS\nhNPIzSCgG2a8hCnFEaxT+H3r/ArcpV3mGRFOVLVY1Wlt7yBXf/tT4OnzEcY9\nufwo\r\n=2RRx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXa57sNhv0F8CTe/uW5qRip89Bor6TdJltUMZM6pL5uQIhAOG7yj0ZjlTiaIZE2TXC9zpKkO/T6j+yznCOSdZ2XgaZ"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.0-main.1_1620631425609_0.6889281093831636"},"_hasShrinkwrap":false},"2.2.0":{"name":"@atomist/automation-client","version":"2.2.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"_id":"@atomist/automation-client@2.2.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-KI6b1Elle8AGjnuE+rmL+RbG7qc/3DbpRA/vy1FDWyC9gcSeVeB5iAiM/xiwwK2wbpKqU1JZa91orfnUj/N8Cg==","shasum":"2fe412b2cd31d87533c78fd1b5c914f17c577b3a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.0.tgz","fileCount":1015,"unpackedSize":4292806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOAQCRA9TVsSAnZWagAAe/cP/2rsQOwtGK0SufYqDQfg\n7t9sIWGqTSMXWYEGzWud3ykMA9WtMfjeGdt7Wntc12qT6irUFurN1zARVghq\nHpUCBf51XaYCole6j7CtC8rPDtusjxhVGC/rLlkGBk0T8wwKtFL7yQW+BFE6\nIdKQRdog2mYV2kw/6C3bZQTcfBukOPVFDs2YWeS/ISgXhpQ/16ILnSHB0d/b\nRcZe1GCLTmur+wvremzi4eVSPjkyEbPTxJ8TsjtDiqNNRX4NOp7Tf94CARD0\nY2xcF9VNCX+Wsf0vvshjLSYhQvob2Pk34JkKJf205/SnC3C7KMtssYbtL9Mv\now8VoSW4FEdqacYz2yxEYtOfS3GinxMaJkbh2LBIxX851VwsU/XRFvRaGXvl\ndRkAZtYLsTMxDuw6TdB5nzjlOKRKFlpGW0RTMQRgUrORKODMGi9A9c42vOww\nw4TbhwyQ02dpUK2FaroJSt3ekNCZiNojJ6OnZxPlJk3bk48H1V6HaVpDV+o4\nuVlyxTOmJQEZ0qPNFODWgj5GXRbm24M7XZqahAisxaxowUoiGr64klq7HtMc\n49naOO/eeIEr6Mg51IQEMACzQo5i5WX3hhzpRqNjJflBA4KRoakEzckopxEh\nKX6y52ynLv0KpvcQNud0fVvFHvHUn1WXTWQ96GASJuIM2152d3/rOjgpkPPv\nPgka\r\n=FdQl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhqE58IOh+RpxY7VD4hL+6q8zsqSf92rnJbNiQzMqA7gIhAIA+WiLPcN8jPrc8AwaDN7iMSVQoUJ6amHPVpo8Y9j8A"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.0_1620631567980_0.5333380808972807"},"_hasShrinkwrap":false},"2.2.1-main.0":{"name":"@atomist/automation-client","version":"2.2.1-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"25c30257cf40213411d610bb90072b606aa3531b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-Z8tFUVZTq3CjJW1j3fF4K7Fr30fhCKyKUn26roWo1JhdpIoYYpMcw3h2L0HU8BHH7DAvzEdYH0cVwnDpZP9yeg==","shasum":"7e2f2958f0abbb275db957d5c2c997db3e1d656c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.0.tgz","fileCount":1015,"unpackedSize":4292813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOEHCRA9TVsSAnZWagAAzUQP+QB5de+uqPzszSZepM7w\nqOhx2eqaUX7JHhH73HGZazHamdhO7ZwCSpRAOphMuYRX9e7ts/g2F43BRTIN\nU740TUHSAyHPdJTinhyrAjN7nGc9vic40rKdpxcDPUO8/PU+P+LDxRgTj+ky\nJSrjpjFk/OLOHwYn8lv8bXtPnz0dKETFG+SYFjJgR4dUMNXoyPA0tEtOu3rs\n8auQabSvdhWRrZ/JEkCzinV/LwQ4NSPN3i8V2rayqmM9iwPMA1jOxpe20S+d\n1ENDQg1D0unKZC7JjYd6DNwScAMhGgxXB8IUNf3XBrXvwS4ti9cpB2JyY4GI\nVkINcN7ePfZrgpPpIJu4zyMdiFWnYorwQmacXle16+a8bQD3AhaxzbZmsVsZ\nHIuhwsaa3cqRl3K/0vx7gfBulC3eDYoliDc9notmjO/FmUzsK9Zperx+zGJM\nhg/5FajOmsdpSoKsZNiy+Xwohz99oY8D+50/fEgs3d7J3/FvrXBo82tkW2OZ\n1oLiZYWjd6eoZI/txEGRSE5FDgrrlf2D494qRNTFO+pyqseln0w37GCGplN9\ndA4u6EfbZDMd9lRGU3QEZZbobdPKCOz6BYvZMwPts6pITD78IWHx+ivKYT58\nfvEhFGthrdtDudNIDiyMnGCF38DuuZSN75y1TXC7Ph5nM7ll95JQCl5wB51A\n+2gn\r\n=nfzx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbfZxtYaBgqQO5hi/nJcdBsuEI5oc9CYK0IcSZE89ZJwIgVoQ0v4uJi0Vex3UHn1jTPff5yt3k5zxSPKhHeAZ/j7k="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.0_1620631814756_0.33373154456470044"},"_hasShrinkwrap":false},"2.2.1-main.1":{"name":"@atomist/automation-client","version":"2.2.1-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"be15dfdb07ce047d72361b3d645409b02bf13e31","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-ztILWP+sW7lJ6W5Df/hy2vLAXK2HL6qSmOOphBHHKNyzw6K1gt2z88FFw8jJdocIJe/kCt89WyDtNTjBd0N+tg==","shasum":"9ffa9ed7069b2cb91e1b76d92df5b019dbf6332c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.1.tgz","fileCount":1015,"unpackedSize":4405881,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOF5CRA9TVsSAnZWagAAPIAP/RtzjmATvSk13EO6xoT3\nczhR0xU3Og52WuLi0K6j9EeGo7EKHu+siskV6tiWiXatSN4mz8pFcBaxSNNY\ne+OTu+UeNoy89ODBmT7lkPNBkd+hIn4nWsPqh2wWGnHpuu6oBuh9nBAcnOE4\nPD6/gHfVgzzWFAsCJ61oW89RpEgPJH4F7uaPaYiMPtwOHXh8o8P51y+q2h6s\nYnrr8xNQXrjWpju38WbjKZNExDJRWmXJL3095F4+7l/w6ffd7T8rd2rbdwIZ\nfqJMxati04Fjbk0w62ekE8/NSRox/S1OFQFl7iBl1ytRBhcEusBriTh909WE\nBMtxYK9zTcQtPoe/aKGV7fjXz2JrXqPGw622mp1XeF9CbhB6OOmYxzQcnvCL\nsftr5MNcXgePbJ/qQ+60s4CuMg03EbnregG9LE5KqIWV8AGZXHmBvCdkauVk\ndnLM7JGdfAQZH08xuv69AzQip9uTCSxYggAfdOcfhdYR2MLhLoziDF2f+KBG\n18VuiB75zSKsSEOSB7qZ46WdAavzc0iWb+NUfM+pO8KMpiMfgpRVdRn/XVcZ\nWb10c9h8SP/bVGhWpnsDBfPhohsSnhneQNr5vHT6zpGnUTswmzhRM8Dr3FJr\ndVknEEKekQ3tvQN6O/R5Z9C5aVSoxVj58Ed4HwvfJJv1TFCQKrnjo/kcTYWr\nrLUV\r\n=ssPn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoxlul9bzIicE3hTr9xL+D2c51WcfxKG0GVNFrRpiCrQIgbqxRbesxxas5ukwca4Tk9ii7z3MuhU2uyQizaPN6hZk="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.1_1620631929241_0.36602471014262283"},"_hasShrinkwrap":false},"2.2.1-main.2":{"name":"@atomist/automation-client","version":"2.2.1-main.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"52cd5fb03e3b2ad17a739f85b05a95c2cdd40e6b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-9x8vSLD9+VyPd+9dseC3UIhwlhjLvNnKoi1LHNnRd5GcYaY3AXKBYDc2HGbL7AVgN9PyBEKDaWQ0HnZ9jAob5g==","shasum":"fa7309bfd95b7428550312ef62c5b57b6ecaf24d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.2.tgz","fileCount":1015,"unpackedSize":4405974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmOHaCRA9TVsSAnZWagAAjnQP/iSj4LpluN7H2tgyvWW8\ntGlWc94mvpygIsmlt6vIuvsS3CFJDYklPO6T8oLHEhaaqkvCApzggWAbKGMD\nEM1CzTCNbqRKeUdGsnJbfe4oHjIemfq1S+9XYycu+e/mkH7bNorK7HwqxD5T\nbIHZoHJQ6mgwIkZpP2cSqJIuACtJj8t3LZNzGhxC1FA4BFOm9oVVqHXyLMWT\nbaDJPmf0/xtWcOV54fuAHFMD9uvfnlS/+ifwIAU22FikwFiYX0l8dBQH/YVh\n1O0G2WIvKc0qIDh5p/PaaTNIkytNEb1eA9O9OxJhQwXs7BezJKJbZ8FV6bOU\n8Tfg1O2872j8wpuot0SvKXOGFkjXdjq1JrsLg31/AulPfezgOmH/g3TaGvu9\nSnQe0TZ7s+eTvv7xycLlGTmmyis22aMDd7H/Qm4mK9cqSKZLFqaTr+0utPPU\n9i+lhgURtlo2OLzlymCpNcbuKF8yaVcVKM2wd+eK1k+bGLILQg0CvRCXGgrz\noE9DMNBjA/I6UF87oJ6fs1kFJJ7sIkIwblkWe08l2IhtqdzNCVi6uvUcNi6a\ndaGfwLLpkVIJy0CkXg1afLNx42eu6sYxb07fAxmJj3LCmqO8xJ0TwMJ0moDX\nCsuTjIUpIGtBMXeA5hoe6gNX9hUhf7KiXqzS9sjaBfg88x3XvqRIxT96qXgO\nD+q6\r\n=0brU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLCYp7nhmdOizfvx09Z11LNErFuXZj0Pjex+12jKzq9AIhAKLQVt4mV5zIedruXaIdv88iOePtEviRpyv/Njiok8xo"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.2_1620632025657_0.8954614902552549"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.0":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"97346c620bf0ef0c7b2e83a7a790df6e089dab09","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-g4j80DJcHqEvjzL1yaKC8ar7uOFjei7vvHYohjF/tvAxm2Q0BoIgMu9JuNjB2+2NU/1U1mf+9P2wTzE6c1uPMA==","shasum":"6a5a92d0248c5c0b3420987c4d754d039ebf8403","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.0.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm6lWCRA9TVsSAnZWagAAQyQP/RDRk0GY/w4l1QNMZuV3\nXo8a1i0l2YWteRL4zSMgc+3ySHuVGYuT/kwGOhYM0r1Y1wvukvzdA0qSnqRH\n/qfD6cSrjwuVq9UgCxcCt6E9Z5ph62dCsObhiYz796qSfbUMYZf57gwddnS6\nX7xq4enTeDM50WWK1LzQwtzUhPzrZtkq6V5CfV1BGpAPhE+Y/LU0QQwS/Zbi\npUuR5WhH6SG2m2CmMdcl0v8iMCRIgE4oyDl6aCFBui2h/yAd9Wmd7qOGn9Y4\nIhuaVVQoBzi2dNjMANswwlhRAqL/sHPMIlOaEcPF17bRNX9umyIb26noqmLB\ng89wQDcw2+SxIELPpgp95IAIwqJklG6qb7v35pJDrrp6DHIJnPhUQ4BkKGkI\npbsWznmKJXRiIhl5iMYF7oLQA4aZv1Kr97LwZ8MRHIdEAhnv5OOXrCG4nFUS\nFY7S5nh+WE5A0ShXNAI7mQDpQtWxJNTsMtDApe/oMJo/aBAOVvSgM4NLQ1+e\nOXKSlgiQv96v7fPt8n4ymk0S5migBm3OFLYrafrgd0sqOqQGnfelucSlsCto\n24tFHDqYJ00ZmrCJZw0LMbbdxA4C6AYJtsWazAr3KUZn8dvE4kUBkq+friZU\nIS/K1+H0ps1bpdyNP7D9Z8DNpg3du+XKwzWDL6RlkxP40IOI+H8KiKYhNxDq\ncTZ7\r\n=mnM8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEFzDjBMqqGzb0Fv2ogY/6RXRMKBzPkq8bAai9B1CNogIhANOF0xPUrSmEcYosEV6hAR15BbzPPwX9H8Xc+h64qAmw"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.0_1620814165991_0.4635651401946279"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.1":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"8f1e34df96a2c64153a094eabaae8dd00d2b5dce","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-W6xZ00sKdXSynqctvz731bjXrlMsqbi0OZXit4ABYN7vd8Fe3OwvQTPWb4IAF2Sx8YNOVKY4aCQHGqgw807gMw==","shasum":"720bc650e1835a807ff69544ed0a056db74d65b8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.1.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnPpHCRA9TVsSAnZWagAA4dUP/19+f4x/w+ylQSoZg2N/\nxnXwjV6yyo4DCnrLOLnmilCRda1rD1i1x0Jf9mXayXnsK68HB5dn9DEm13VB\ng6JW0Cl2SEE4FhUOsX0GxEJBCkU+nXbXP3llBhAiddRjuFM6ffwlwHzBm8h+\nSxGDd6afGfqrp9roqctwH+jTflDRi2CnewbugB06xwU8RXET+NqgqPCDXvrt\nqoRl2enmD3ipJ0qtTrW4VNEL2ykP7s0yI5/7CwDmP2duTPsVWQvfnj+s+YQL\niFRgnkPEYGOMLXq2Lz30QJrrWTNq4WzS5zoo13cS0qfEOkoWve5CvdZOVS1h\nsBJBTBkT3E7hCGCgpM/tewHt9mvo0+ojL2tz1qyoLlAHQCT72phEIic4oNMq\niFOmZgG5Sjy8MjjyFlsxnV9Negv49BwYCSCV/PbSYRsI+7bKIBFGS45HcH/V\nd5z05ymCF7676h7v6pmc6TqZ4WyNq1l7226aUqIIv/7VnsByi4Xl5f35vBMH\nPQUH9jpgt365hgUw8LR0VAZxexi2AHRISkD5kU4M8UZlkXbOP6ENPOHz9QyL\n9UPafLOCThn0hJUvrsrltMYS4CIgzQcVQmFNLS6aLmyNlgNquEHqVReg/prx\nvfIh+Z+JFVhwtI8FZDzZcblE15jOsBW3PiZJXkCv+odBOFJ1xeZ2U6gQMF7j\n/u4d\r\n=dRjw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnycJRILN9tcRmFQ1KWdY++NdlDW6D9Zsz8lorLAKbgwIgX2ikC7XW8semr2GLncctYxhANSgky2xCZMo46L+dLLo="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.1_1620900422368_0.10900126896314788"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.2":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b2346f330226854fa13bb596ce2808227fb732ad","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.2","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-V+XwRnsX0PsBWYqMx9UGZXE75wO+mHdmrrvbsR+1ruoq/tUJVRndhR4muZNiUHnuvlrxtmT5/rBGlN3nRdv/ww==","shasum":"c789c60e4a047c114feff2cfc16d36571771da70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.2.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgn5zvCRA9TVsSAnZWagAA+q8QAJgn4v6RFD5SE0aAmt93\nWceKroirQ7dHmxUcAoN7E6rWuKZhZ8z4LTGhWHNNTe5w5KE6wVh4JCbRnVy4\nGK65IXflSB6PBN8ydCU6suSRBTHg7go6nxaaTVW9FsnVyMGvtFQV0GU8lJoc\ndi81yE4n4Rwx10PuvjXG2nsnBAM5OLYu0LpV5exfzZtpb0gNdK3HNlvBlq22\nVyA0xQQpLkGKJrZKkhj2KaVqh/2eM1juC3nbNTQmePtjncYMXlHndrDqHcEK\n5dLJ8v6CFyVEZQPh2PBx0IBmT+tnXHoun/C2Esom4WCUO8zKGbUU1qbzqOlE\nCffCZ81e6skq0UcQ8aHDEFoWPo3ZW7joHQlCUnXBvCWgz2EV7HMUICIDcxJN\n0QtZsl6OqeNHf2Qt15Va19p7vX1/H66DV0s2ZiUkOxOzi3xfd+YPTELqvtl5\nFsnnuNwkMGGC+2PBKVZdIJX8U0+GFxcc7iF97KBc3xNpPOqLx8x5anv/piwG\nSKenIsRmz3Fz4MkoJrjmNOL7KfPSaPTk0E1QA+WXVtuZX+0/8PJeE+fJaNHB\nI6OvZ3XHHmjYcFnDkpkoq3KCgxA4J7rXTz98G9KrR19lRQZM1tvOoOQR9T/R\nrx2I7VJPscNcyywufbd4S3ibgo00rzRGMpgfbT4JBMAGcSY/CF7K4Q5OAR3m\nlNys\r\n=H5cN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuap4CO+zLsNt8iY+gLOjCywgzBeunK/NL8sLyWEBG/AiEA0SisRrCQj5rulj3fZbVk0SSDh50gQB2G5WCGq3/hKqM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.2_1621073134388_0.4786439088533998"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.3":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"e0a6f3d5f950e6927dfe5e5ecd159a1dc216ca2e","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.3","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-NqApSye4EfOaKmw+GY50fWS936+FSDXvvCkAlOKdnRDMD2XV5dDXWH+RY5E1OPFRpvpaFrGkgCb0IH0CGUDAOQ==","shasum":"b3d66adbff347c9e7e7f23ec5442e80d4fbae4dd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.3.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoO5oCRA9TVsSAnZWagAAXZsP/jib1H8ODEGUQP5NIbdh\nm0fH8CYCEroa/RWcn20UNisj3NxvEQbnmtDRQ1qdk7xNHKVSYLcKp84NFNrJ\nsm6FJ005ofDecGU0CHyUn521POp3zRafZ5LFlMbdyGfm+xtlklGfogv1ETaD\nQPTBJUgeGRwfBleHgTvTQFBZpdh9WW3/zTXY/jYj13MyBm3XboWdUhM4JQ9+\nBzt93TRt2vFKOmDu7iMFPcLuqKKSDDqriFbVRTMcdMxMAsiP8gwXcw+mlI+A\nepbv6myzD4nGpNHbZh4k6EdVfeOXwx3eh51HanFucz15A5vw7J97jo/ncHRa\nttddt83DjxR8dlCNH2qICqM5Ok8a/E6pGTUJClrMBNt9PbKewnvbaqmmQQBB\nM6kUZ566cDFRsKeLCTj2N23wUhOn97Onjm95Al/I9CfRDm0bQonby/LcrXSC\nZP8jLZlz6qYVdCCeJO21mTH5skMp1MBt3Z311wSalMN7OQoqHyJnwowrACoi\n2qK8N+V/T4mKqdeUNvtsLvBrJT3nHnvahcCe334M0sxoC0gW0Elwq2yjmIao\nu7fVIV2yRjXhkl2AwmeLTNuA6BXrUbeE8VGHTIcSSs+WlQ2Ao1t1h+YL0+aR\ncMjEplHQ6lsLJSCo9fBlZfVMtJuehvFL6DWn2rbr90DEMbyT7QAUtWHLk4xP\nmNA1\r\n=1uRg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdKLUSRReCmSwc80gehda0HKZ085P7Rd0VkXv2I6d34AiAPYtKzHTohjsSRoRPf47fSn9JS/uLeJVlKwm8SOXTZAQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.3_1621159528167_0.9786315845521822"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.4":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.4","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ef6231549a6e991243253cfa182364f9565e8126","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.4","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-wUe0om3MUFr8SajcfaqeShl+4qrBDOQDoxpBfPz94DOGrVr9I4/iek6O/IRy80D/BRwLIUAsQpvdK3+t5IwGFg==","shasum":"250674d44c8a5895c3dd8c9ad22910eac04deea2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.4.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgpjT7CRA9TVsSAnZWagAAgaEP/3Ogefj1tIb89mDvyiC8\nmUFcyEf88Gq3pDCVhUxhRwIOWoPBToBJZGheACtI/asP/d0hDWCQKvf+aYSK\n8IgjTGSuurhA6EORcKy3qeqZMK+NauSUYbMQOoLh7QMSMl/udzSoOnbY2vzu\nfKyD8eeJuWJBJPeFP0tfsJXKQZQezxyWHpw6nU+Y+brU2Fh1xOpg56O9iFvD\ntbu/WAsiOw9nO4yNQOGbOL6dNbMOozOh+igUq0Jfeyn9dresonLgpEBknTvi\noZ3vQ/Ej3/NPuaAiDT4pyESCJ478pKNHAzbIgQkdVs4WsuApHpFMKHrt5era\nLsuF0itl+zSr7tel6pd6bPrSKfR4v/a7fSiM6LyxX5eABhDsBu/BHF38vbKW\nEgUR9o1wtumOyyqoO4veS/voRbx3hcTykx1FjzxHbGcpJFQhNxfswr3y7/h0\n/5J+yJmhL5bA5YbHZ5w2oyxKG3wXWqOgElICMCpTAaqy6nbRwnKEbOJRW7IE\nnPvddOXAQ0VZrKBHE8T+G1WZI2Rp53iHRo5d1+6jbum81vHYXsBoCD2gYUQK\ntOaWZS9jbVKgsd+9b5SVDBQZoWk3ZMB092dODnnWqyoKc9uKK4elONiJFdGT\nXirC2OiMutFo3Em2YbZlU7vKWrba8xjZgNFhEoivuUBcCY1wVzL06+GY4YCR\njuah\r\n=PIsO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1o+buQnowE+1PPB9TeaV6N0+Tn6Ys+dR5wGmZ/KnwKwIgL/6xq3HQ7kJRc/pV/2HQtj8UtsHEaXqf4/i/JRMcVmw="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.4_1621505275085_0.31934413602827827"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.5":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.5","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.169","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.2","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"d1eb5c249fcd612f843f9f2df42bdde13db07d51","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.5","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-bqXr3JegTeufor9hmMLAZmrebxDnwwDw6PYRpoUsqcb4Wrg736CnO+cKY0/W0qw+Ha8X+2G9AwuOQlquXHGVTg==","shasum":"2a7ac97aee4783a8ff3e4d96a66b2164a77c73e4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.5.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgp4XxCRA9TVsSAnZWagAATVsP/j/C5SqKaDBs1JO+XSp+\nGH4aj5jPb5mbgXEdP6HocD/sfSGhXWHS4LJngkI9fAqAq3pqr1qXcFix2hqS\nPhviMfcudseduoX2/S1acUwt3TbeqFvEhYLwotXk8J20O24ZDK8k/RY3jzdF\nqleiR+O1SY13NOBEfRxTyih2XQsxqzRaMt6GFiKAP6j+TL3C0e1OQw9AsgOR\npSjeSt4tS/75R/pf3eWk6It2m1/s9dX61bvkOgpX/AEHwAKJ4LhBO1xwKpSR\nnVCP59ilPw6vjBmBwDuKxH0D7YQsUgKXLvEbeBfcSgxmk53dOM+C8v+C0Sni\nhWd3SSVeDwGEkZh6dqp8bC/xeRVd+ZgPXE+De8hi5/QBUONgXZ1oEagj+luM\n8qYnJISXE1rs+dOg8OlyP7c/izdKtaj0K4IxkkbsXXPwXhNa7eUOyWPH1Q9b\nKgvFynF3/z3ceYNqcLN1KsJQnbxqFilMAuDoF668QxJXt93VBhZHYs9CS/HU\nCpSm/D61bxlspSjugWc8GWCdJHhiXv41T2ihwPWD5npoZcCpLm19UWzcPEox\n3g8SNWsWsv1XxdrGAWXycTxhatT5mVKJRbHEZajJEYLs/eHfaBMqRdAvJHwI\nqFydFPZr0aWd5tVcaU0P/ccOxVvvsBb5A5TBCZHZOqiATA2TU5r4vtuVLFyc\npxUv\r\n=tpPu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGsiY8eThRVPj+Fm1/bQQ5SbqCJfZ0SwjpDza7J3uIhtAiBZy7NSCmYgG+b01+yBS3KfsX0qRu+DoMk3Jn9R+KSj5A=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.5_1621591536905_0.12496232906051197"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.6":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.6","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.3","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.5"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"77f175ac1bbaab095dd4afe289c87ea15dd93453","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.6","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Zs2BVg6Oq+ZJN4KpbBsjjUpRHp5LkqAXX8hQUPtn5FNcUCPubpmD0YCt6Y6hhhBHRYORAi25ulvcnSrAhASQng==","shasum":"d03b4870dfa711b96048e4f62e211d124f8e799b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.6.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrMwKCRA9TVsSAnZWagAAmOYQAImkr2OQssxgeoga5bzz\nZJ5F2XwEFjRiyT2EnKeysGwpmbzJTlny4n7kBG2mhdPRLk+hcadPFH33qe2q\n0nmonL23b7+tVDIigHdjoCD7lQtShcHoTzLEsGawOYFegqaiFyVFrgM9ZuxV\n5OpZStPnsWMd4/BmZo1SEju+Sulz1/cQ9iAu0mwWVk07IaTssxN4liYFyJyY\nGRl327caERy69TjE0ZtTCJuZsHaMV73o5nbsMQjwtVfDAmaH/WTKbAr/OBTo\n4aY/DhX3BMxMtGentgmixkOY3+n2hWtC0iXRv1vn5+I5DXvYyrGRiu8A8uvh\nrFsbmYOWX+Nd8Osj2gVP9uMabTPQCfQkFGw8VrUOpZVBiNsWZtxiWj80e902\n+LSIAvOMvMJwvlU37nHMF+UIaXIaVnSVmYPgjHfxUGyEK9byP5tUKQR89+Ty\nEfV8Hs1sAKC8fyin1bKoyQKfbNfTJ0EjMGTGdZO6MBegqYkoXAbx5B8jtI9o\naJGRUSSbKHhPXvM8pnohM2JoPRDTrY/U/f1l1myjqyNlTDlncuwyXrgPFMib\nHpml/WIz95RMJZw73r/UJNMKjGHenqLFDDBePe4Lt4Z1W0himwJHg4bsrXi2\n3OtDwMbp5+sqBxqBnnmHag9Qdsv19D7kIE7S7Cnou2+v4mfWpYCjcgyBKfgg\nbTtx\r\n=j66t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCF0ucEi42KxdtALVGzIP/U/jYpTNJ59rtFHJUo6pMcLAIgDeZFvPhnjIy03OGy12JcoQ+EFnie9OwjXhV51mV5tEM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.6_1621937161971_0.6962519007030972"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.7":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.7","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.3","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"7c845e0dc13d054f7b7c7e50455c7db4d6e5907b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.7","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-PbwyIU1zfmS9Hi7qpUunigvKNnjMzVCDgtPznxU06qF5Y0I5Sdg7alM4WC5il2Q3vtchXemPxqnSMS99xBPvSA==","shasum":"5240dbf89480690f87b4faa1bea2b82ce30c527d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.7.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrh4DCRA9TVsSAnZWagAAm6cQAIKU0mQXqRBlw378UQcd\nmVy834xYNhHJlWdB1b0qQlOrYAdgm2V56ukLb6fec2SmbTLGIVgi1+Fu0nYa\nbNZWdIiTNslT6vB9AHVy0/Iek7gYYmR2agcrhxMQcBAkjyAQ4eXaRji0KZLc\nUbR012ia8RLvgyqYgaEFa3+VsZo6VT6G/YRPZDm0gII+Jt8wcnk7RLaW1M1k\nMrWhgdoXr5sy73YWcWEOBe2qbmhWlS7uB6o/jpZOcZJVP+93L3A2V7OIGZbv\ntO2qdv/3D52506rgUei7/IBX81zjomb++RSKTc8JRsf9S72nGtF4M75BWbDp\n6R70p/iQe0WbIcQVObzGq9O2bqFugtdgQNs4RQgXWrix9ZYoge7W2pC2Dqv5\n3IslvhJJOD0d/1ku8yMj2y3w5fOFcGhTa2uhv0Eh3OsvItLBs7NthR/21+bB\nRetwB/8yQNyhjI4qnHG0EHqJMpds/jLL0862Z0EU5e3Vsg954eVjpGTA8pj/\noltPbUngn78D+o1qNuaAWq5kn0WJRjVtCZw4oC/GKV90ddUuI1beFQoAb8ls\nuC1dIQJBIkCRkz1w5RbTPfYbkizMGqaqXj5gOHK0nxIns6X2Vqk4rSP23QPM\nQ9uIEDe+C1EbBDcOH0pBMIzT6aPkMVEOm2OGbHxHlkU/9yRj+w6S5+iGGBUa\ntV9Z\r\n=tmpM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPB1Og+wPr7opm1PPP+QtzPW0s0AE0mOeYj2u7u4v3tAiAT5io18aSMncNBTEqASkedGtCFWABxOqe8m/spv82yJQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.7_1622023682607_0.8192025103689837"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.8":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.8","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"35473e0538509e119dcb058c56798200ff534b81","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.8","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Pk5wSuCy0e6PZDWngtI0WHkku61Xnno7K6qPQ2TO0L6F8QIhhB3N+0qIKaLk5jkvYf2ZblWKFQdtpSEajYeDRA==","shasum":"89eea9689fa52b8541ecc78c11ae2d995f98f409","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.8.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr3DBCRA9TVsSAnZWagAAo28P/0pDnAC4i+pgadxGWLaz\nsrKwrJep5hvxYT9eeN9JRAlPnsqZdzzSIzJ5cgodyd5uZp7g967TC30c495H\ndLXpqW/KyDH8Xxr1H1BzOW8pRSxbSYua7H16wEJOHjVlJoR1S+9v6BkHbLeg\nKl54/8BQWTuzlu+3aR8y1/ymgOjiEhXcP2pR25bYeOhmbGm1PKWCZR1vUE/c\nBuwGNjpDmmYB/Qduo85/t5uLSi04iZ6PWAu842aVnZ+F1u4Yv5QuOIrbQUz+\nwVj4A8YjBYwcpR95ZnCiEAtO4XP9yMm7fmx8dFZFpcUZQZFnDyU8IewyXlVv\nk7q8xrZ6gpdh3MP8xKANXNKLCm9LoN/a3h2g05i51qGD2ZUpJV2N5Sl3qN1p\na+kDufdWKLq1wBom7tX9qHtnHALusNjrsukucrGsGvYKL8Mgmi/uO5NpxmNm\ncRfFVAMlYJdpLlyzGHXuxs9tPQ9VoEdFitS/n5MyAED1e1l70rMY6jR7MBuP\nbDFUFNtw8/OL2Ll3a+x77HTXk6GxSTED1CeeMJxxbMVkxsoF1i4v/RZw3AkW\nkbQVoDmnDrOigP1kb7xemW4xaH9pTc7hsTmtV9+bCSECnpf0JMooZX5OoCMm\n0cvoxzZeWjh4Yq6b6Vk9LtjIoDsH1b5281bTGMf2T24r4QudPAT3dZAR1fM0\nT+Yn\r\n=44eA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB5lBogu7LFUMc8fv/mhJCQl6rI6WV8Ya/avtpKiZ6M7AiEA1HghT8+KL8WcMzWEsqemum0RS5+cTMHDhDmIl+AtaEA="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.8_1622110400882_0.5491610833257239"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.9":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.9","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"a3d81717edc53cd01b1237487829e48d408a00af","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.9","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-oDUkc5rkVUM6ZZ/xgcKo62IT+l/kOo19r0ffh0Fu8cjZubEBpphfZDEP6imkWteypLBMaDfSpWMXIQo5oMp/sQ==","shasum":"abeebd478d8894f1bf378de25b3efed6ae65bb11","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.9.tgz","fileCount":1015,"unpackedSize":4406000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsMDnCRA9TVsSAnZWagAAB/gP/1c+9Bbau6rjGoRddGfj\ngIypXymmPURhd/66OPCBiD4yyyg2OWfNlowlntmA8/Tp4UWG0IusNsVfrPB4\nwrUw0EpIYCSW0yELEatYZ6LCIpHSInZRPnJcSDxFr48cUXqvlAiMVqxpEhIf\n6/ihG9HtHxL2UGJm/WN0lPTUysd/xGugjmhpSTgfzDDF6azW2uMI1kuVKUuu\nAS/35XGgakHYrsZh3Ac0a+xcgCx7cbZQUDe4qAcbEQTR148jv+WR5l2+JKhW\nc/IwcwGH4+u0xKEM0aY7ilB9xOM9XBZa5iQuTD9xV+6Dh8A7Rv38eg46e3ay\njSC45xqTOfikjyXaZlfd66AjbZrsA3NotdNC+ejv0uec1noruKnhpakQW+L1\nR+Br1biKFeIW81CvP0AHseo3CqLf0kKkdbqlYnB+VdIbHQT3sKuWlrLt3R7D\nNc8DYKF/BfWLFr/YvEChJLrJ+hzYsMM4iZlDJyGg6kBz64SzM4AeXTx9gSfp\n5A3MPhjCUfhdxi2C1gpVeAXkR/qz+CNGYNe3e+phsTBxETbsUF2m07p+ckFL\nled5rHd5iUC+iUTvGApDmJ1UQtzC84HlIz9zVW6jqjBiDbpiLFQABJ6FoBFT\nx+pdJM190dCJqsgUaS1Xrdj5DRhqkuqTh+YK2KkroeC0Ugh0xRwHDni7ZlJ+\nU+d9\r\n=KfEj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiyCau/m579E1u4xBAMau8xESWUTFixUA1n6Yjcxa+TAiEAyaImaMFFcIeLuJWXO5nPHL2Hk3IOZbuak7cVU5VUHvU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.9_1622196454536_0.02361749336946839"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.10":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.10","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.13","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"d0fb0866bdb9dd8e3e2f9ab305f79288feeb0784","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.10","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ZSAZ+ni3F2yTi2MAS+UVl5L801K4BiYOdnwUhQ6Xh+it4kwUWbmunUQAGpd7nLEp/uPw4Cfda8f76+pjXUG6bA==","shasum":"81d4055f31f94d136d2981762583de1793565e2b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.10.tgz","fileCount":1015,"unpackedSize":4406001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtLUwCRA9TVsSAnZWagAAT2MP+wVHyd/TnrzYwARPYIbl\n6ikZyq6XHdnG/HcZ+Q4zVXzrx5TPOM8+SV8qwqj7JFO+Jk+/94kBl5TmPOzo\nQV2BZzcTkOEgl43a2XkhO1kYzWTkcDIw98AN60fEkFhNUSrzVl7EsFjoc83S\np1Wa4Gj1Gve2r7lUVTonrwD7qy/vs7saelQoHvJdjed600NnwIMNRTElO1Db\nd3cIREUBE9IKJdjj9bBUQzNIWtHKlZfRm//dWjyP2X18D7JawqCDExNJgvcv\nVYrrsDRTHNA44wjC5E5JipyfXPxCQs1wRFSFtRt05O3QI4GuumYUOGPD4v4U\n7Bp1b9jL+kBjZCKMEPsVwL2UQjmMRPeDU2g3iDzoXaqcyx1JehpTEjDVpahb\nSQSpI1pblASgUxx+1ZQa+BEK1VLamlYphZSrgbeBLWfUxsI68n5OS8rEezRY\nUWa5tD75PX3bfW5m/3unL9H3hUahI0odaOUUd/bYxvZFFNRO9nIioaGTM88b\nMyHPWrR6rrKOSHQfs6PT3dlCGcrlk46obIPKyoR1HbASIh7mVchg9EEsVkLi\n5D1sb1EBNoyIGP48jE7o3+K680tKtSampx5HFhiWHfjwcYGw8u844Ys68mT2\nbIh8lzsnTELsaB+iLRQjRINRdtKugETpKHcqamySh9Iwz8npYomygQyR8OJ7\nREbw\r\n=QoCa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAzOTG8bKjnaEth7yid+ReIqS3PjG9J2lNllxMoysItwIhAJ460A3ux5SdcCrzrfC4WJ9ijyVHNHj1rj4VxusWGKHz"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.10_1622455599641_0.747177275552086"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-audit-main.0":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-audit-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"99400057d0c38b8d1e7fae80e4e03a1b902777a9","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-audit-main.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-eq5QmhIeEyyA9ZBQUxli92JQ14TnDes7o56jQGmw0GvJhWrQY06GlojOZIUF9WMeL3jFgkbRN3Uob7V6rqji+g==","shasum":"1cf404116028250bffc824d50d10813d55525d5d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-audit-main.0.tgz","fileCount":1015,"unpackedSize":4405999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt1hKCRA9TVsSAnZWagAAg1oP/idqCuDBj7KMu/P+fjdG\nQx/TyNKXFixdRseOzd5NboZdNtbSDEyCUZgj/WQewVWuwOSo5v551T5iYccC\noJVGF1p9WnQIR4w3dNvabh9urwUmDS/XaInyVLqONKhdsFz42F+bj2+lwPTm\nv6eLmGg1aolytnQLt2gWTU0llVBTMu96mFXH2TYl/fQaYSetcRTk9nAnde8p\nyooCmw9wRgS9CzTt+wKIXqrg4oJwsvyrrzwPDGXoZtiMXN1sfs3846n9Za16\nuWjcwczn3wGnP7a7ShGU361q3fjbeqeX7I1NbEmNqG/vWveyRCs8Z6zmg8yv\nz3dqhhuArVqQRQlVUWDus/G9pR928EuywQbJfg9ORZz/TkNejXbRSbW1bI2i\n0VxjUsSDKa8bvTL75WXo4I4adiefqMVWL4nUMQn1UtfBwZ6Mg4+6X6QTOxnp\nzxcmpDq0fMDvIQi+RAkgnvG321gtWIG+2mm5mgBXbA6K5DIZGNOUC5PIb//v\nP+YhiNQjm0+QelbNlzl9o63+0ft5cUrHgcWks7uXPWOOi8WkpsSIYibJ1qb0\nHFvz4iaOGdC87EoeuSvQSEgrRIz3U5jP7PIJWURlTZXfx/uuOlC3aK2F2v1g\nZ3uK4QbJ/1VtOt+3cszfeq3eFLxagKx1x85VxBWcyu/gpf7+1Fs89DRR25sn\n/zwZ\r\n=8fds\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxBJBOYEfexrMYHRa8NiV1SNPZKR8Jz/Hw6EGLGhd7bQIhAOjGapBS6iiEz7MZXS6dPfu84YSzop8FM3C9Uo1ANrIA"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-audit-main.0_1622628425640_0.34332981887693403"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.11":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.11","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.15","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"e3961c6ec01f80e13f0513272b2549738a5fc54a","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.11","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-9qneZ1XH/mse8A5rWMQ3HmSmT2+zZ15YN3XJcspmVlyJCLc8msZ7xCdHmJsOBmHI7xkhYXjComR1SLsq9fbiZA==","shasum":"64f733afe2a89b2b987fb5983d81e9f0bb5f63fc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.11.tgz","fileCount":1015,"unpackedSize":4406001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0GNCRA9TVsSAnZWagAALrUP/icCRYjvw9leWm41rnlg\nvs7Cau6KgqFYqJOaE/Xe/Q6rZtqwwsLztQ+OKok1ZC+vdxPasgpkDwlEKpq/\nyREhTiljrVXKdcItxDgusTwsP+We/k0KnmftukOaIeUlfNi6POIvKh1pWKj3\nqdQeRYu5HGp/xl2T4lRu5NfKVsd0WGL9d+x0WtiQqjuCdFhxTRSRCDWPYixR\n2CIh7ij9QDWSkc/gvhP/oy7xgqpIIFu4K9hBbM7VufzgloeB5wFIwfrKF4MD\nQ9VhcVUQy07hqhqShGpxLhTuT4p7Kaw4b/pxOCg4BI+xCCPfDcwU0rF7aJ7J\neq2DKjDGirdKYr0TVc/1otyur62CPZlv0zlRW6gp8BRoXSAeuJTCO8LC3SCv\ndbNZ9E5ubqp0oUZftEQ9V7SwgTsLc7Ei95vbuYU5J7YVSWBcA3VjtIjzH/SM\nIYiF3SuHKwuAT2S3KK0Wc+No48V6YBx2xLdld1pCqVSrW9xZqGoOuYh4XR40\nyWdtVR5waoONeH2FuVE6Da25l1wDYcS03fdwmPt9v93TGPRkZyNLEN7eQK0p\nGh07SDea0ec+rx8lpTYxj9G5UiFdkly8OvE/nbhMSfwIiQEa0ApkJCNrFIOM\nlDRuFwlHtpQBsNKHzk8WAtlPk+m8yUe3N1Jwoly289LMWKtTRQT3VVNpl7SY\nXQua\r\n=+PUy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWxEvaqpIpJRsB+bm2y4o+9nYMy7GByCAjmnYByhpTtgIhALWf0e4kRNJfFJ8BIDckPLsLWp+4qqHz4HhWGuEjCAx3"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.11_1623146893609_0.06335348933520613"},"_hasShrinkwrap":false},"2.2.1-main.3":{"name":"@atomist/automation-client","version":"2.2.1-main.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"fc6089a64c0aec144b81d39e1027055080f8ef46","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.3","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-s63aw1fmg5VC4dLW1spPl7QnruE5DflEjFzlGxjjYEfY6t0AoX5GxH6UE3P9nG0T1ShT61qreGFO9DDmwHAYqQ==","shasum":"b38a01a6bf0d2248391a71b0f6d65f2339e827ee","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.3.tgz","fileCount":1015,"unpackedSize":4293400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0I0CRA9TVsSAnZWagAA+YsP/AmFBJ2GY8qY+bw51HFC\nxY/7poUROWHvQXCjQoCXSD/CyhSY5zOltZ67OlStm2eIz4wMm77ta/oVXG9t\nzhlA+DjAqew38sFRXcNmeRKOmjRoBiVB8yZKfDeVIMfSLTvDNvzKsHlcl9SC\nK0oM1i11uxzOX+TsWud4fiLhZb+rnzJCAAg0hC8GxBn0tICxpMMXLUKtT0Wi\nf+AEZqz5uzoUrCP6PSNrIv7tI4ckEHQLGITE3uc0o+G/+8RopRPkYOs9kias\n7d+dy2U3ryL18YM021BDhRDBN0NffS9A56dyX/MAUPje/kk12QHQmNxWYIvg\n9GM5dD3GS7WNEOYzKz80gui9gdEN4KKQDz9DethFmGh1MgTTnuUc/dtgAP4k\nbeB8RBNBy40/WVPziQuEv8GuVEx1SwXwZnLs3HtNPx7r2d1OyzVBxpNmz8PC\n53MolvRV6T/p18j8XC31VI9YCuFkt/uVUFBXq4ZkVyzrisioBVyHRx1DA3Dx\niQIfHwijQYT8Ut/rNAEWq+4nP7M1nLXD9lVADzF4YmG72K35/YTEtNy9/a92\nPAxJxj8xkB5S6U35xTABkl1+zZctrUHxzHOg7w+wqOrNDhHYBmir7Ok+sVb9\n8wmTD6EbaKJLNEanJzMtDMao9NM1MnxxCeHVIbAMkdFC+1zUSHZgR8qSvkf3\nu0y0\r\n=WbR6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9X6qjAWCGX8Ayj5fXmM2B2uinS88K4VQgK9Y4uJpf5wIgUc/iXo2x66TqvhP0ycIbTjy3XFDmIz4TQc7KNnxaADc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.3_1623147059946_0.48980302441022916"},"_hasShrinkwrap":false},"2.2.1-main.20210608101228":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608101228","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"efb2e6588be09cc94485967e6be2ef90d3584d61","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608101228","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Sko5nzk6AgZYjwHRnKDDZ1JaHGURm8fc7Rfz5wVkPFE/4Y8XYpI1ILnAIZdKBkGkGR8GxvJpxmfiPtRD/veR8w==","shasum":"b7707c8fe2864bb212ac0643e5fe95370c27ad25","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608101228.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0RgCRA9TVsSAnZWagAAPsgP/3uk0b9i4JLAdIrC+wAc\nl7LSMsBrvd3bRS2rGW4rIUdu9x6azdDcrjUfr2HalcPru23nRNwzcWRIvguo\nWFLEQFQ8SJW/J0Tl3CYKFadmtD6RZ4pYXmlZma4ESuqNmAmpkLPioPlpcmgO\nh57r3sNZ7T/EhxOz+e4Cn88uP901uJoDLoDg0ZTb67ArWA4kkJFdQPOn28bt\n8iCGLy9mUWGch7xvBaSM9YpPAEMsoboU7z4dHxlxaC8Lo4IM85xE5B1dLSI4\nbqN2S6PH2G+NbFgFvynzXcKSXFVFzrW29PW/lMQToVRHX4PyAiAz3ZujxkO8\nycfw4j0D1W3mP7TdcmnnEoujZvVCZ97btr6TxS2HsIaeWHTR+Fej3QGDndmZ\n9MH/yJ42x3IWHWKHeYetQ3ond7H+phX39crPxNNjDN7LC+RwMONV+gqmya3c\nEavmlhIb4YWoy1C5vayjfcwTCvPDqaBjTMh3K+eeEFX4W8fpLOeE7jjjgHx/\nUCIalzAFroAFpkstOy6K4LkukJlY1GCFBT1QdI4YXh1PWGKc/pINvPVOMN3j\naTiK5wzvSYUphni8bsELrQY0NrbJekkOFn/zXVG0/eP75j9iWUd/4y6H+yPy\nBzBet7cO7QzCwFe/e3DSu/d+0ZxTJ3WjlhNv+yMniSr/3qxv970nJKqJwiz/\nOWF/\r\n=4Fl9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5l0kwqWay8CCi4fl6Bf1ukeJOkt7wg3CCprXhd9fmEAIgfqU5s3SGny88JJIw0LzEzqvWwld7LpZ3sDl6B8WQFos="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608101228_1623147616080_0.029719365019578836"},"_hasShrinkwrap":false},"2.2.1-main.20210608101229":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608101229","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"38df4a7b897b0be4dea117a3d94cacd10b098f8f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608101229","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-1dYbNMJI04zCcZoz5enpvUMoSYw3vv1t71dky0scP6S3nsPCuEw+s8Fn5SMCAlEc6VwBUGBjlD5I4RbWQb+VyA==","shasum":"3192f13790821c6db5fcfadf95eb78441758bb6b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608101229.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0UCCRA9TVsSAnZWagAA0dkP/0OFbQrafdvm39QkzoXU\n2/A329bAup2quEx3JkDAOFucWEGeFSt7odVspjucoom83JZVMhTmWLK/vFK+\ntCjyNs8DcR29hRyKBxo8NNBepND0dW0MiSynWWg9lZTIY1AOVJbRSwjaVDxs\npuEKF1JHqeExoiSFY6aIEZRsIlc3S9xdhd5Ip/veQDzxCUI/e+dZ57dmwGEi\nkgFlU9DYZBQS4uZerBK7Fayo5gZjKaTvmi9tMCz4ogSq1n6wLhPGXv1WK2Cx\nxs3f57lLRhDJrwVz4AaIzEQym8mwpnp9BCExzMf/wZHfl+iqLIvy7XheM7Lb\ndhi0qCC3Sp60pA3SDc+dbcyW0oQ4SpIA1yXum/SEtZDvMGZ9qsyhAU+wTizA\nGk6XUQAu3Q5vqAkuFiQbJNSlsa2hskH8Idu/idUk9ZQSHQmc6Asv96Jz5wB6\nE87z5ZnrHA5ynlMfzZ+CnXpo6sFNO8MfkEc08AUA1xCc2d/ExeyfKdJt0nkU\nL77BNRewlmvGmikjG2WDrGH3uFOaLmCLfCcr2JbSmZllP+kpcTQP0qPn5fJt\ns8VzM82Qg5Mr6ijYJ0U0qsgmg3MDZlG/d+w/4UGIR0DziV4k3MpS1XcASeEX\nGqtp2oKiJ3bmHud9OXt5zEaeNnSw1LRw9NQDiArWhYzP4t6cyFMtTNKdVXxE\nR39s\r\n=916d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATnisRaRhMC4JlE/qTi2QPi7X0NehH4EiA1Vcn5MxgxAiAfbE5Lhu08k05q9n9kjtbG/9RftpWdNVKsRv4dSxshUA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608101229_1623147778289_0.34601011529585657"},"_hasShrinkwrap":false},"2.2.1-main.20210608101935":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608101935","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"fceb7c66bf08a5eba1e9fb941c50d0e9e6c112a0","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608101935","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ToAJ7I/TbX6TJRvXZJKF1aivYXJ6rgltbfRfr36CAwaaIiUC9XNUot7xBruEo0LoRoKCqu340Wf6d0Lnd3ljig==","shasum":"2fe64150a9d07980f711e2e79e7ed817d98b8c70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608101935.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0VpCRA9TVsSAnZWagAA8IUP/jpZGxLeU4MGldnhaGuu\nuGREpWR/g3xSv2JDmMIB1OXJbDiXBkVpxgZUfMjrSKTcER69s6urrSbiNsh3\nmUfr9oJAxLs/VvASJPk0hs1mXWjniacPR6alHl58mXaDnckOjbQ+n3iyLixR\n3xU8ZSmTi5JZZa8VEug2BVaMph77JCKzdZt39BbiPgd1KzPKmzesmqybeX1X\nodYdqohvWe1JdjpRlwn4aK00cPP5q1SipYh3qMoXDnhInV60eUl7g3VUZgbm\nmyN5zxMsu22pL+wuz7JKZE7QwXLyEBdKgjzwGBHNZoaTLr4il8fi7gVC7eD9\nQkcNWvJbXjeVa4/Po231Scdk1s9t32K6ye0cyM1ky64REOInTNQU2BudF3Zk\ndilTXg6s0xaDN+ri8ljzo9CyyHjpMQ++KuyAET+vBISJ8lQwKHDnJEKUMGwR\nzZtfd0HdKEHgrnzAqpJPad7btabIrzJwNwvrrhs53WW/IAyrdnrjboAZ+H5n\nKqcygK8UPoE9pRm+ihSLm34ogRUKfxhg7F7YEJgRVgN2RBQnaEkEzEKEjgiE\nKR/hDrA+1oZBsWm9YMpPxmDgVlpstHJL2YaMeu6g8KjYH4vqPq32A41dtCtj\ndHUwdCiwBzg7w5Lbt9ohYEJu8unUI1YmPuiACYq/ShaisCUKdVV5zlvK7Vdf\nHiew\r\n=AL3e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFT6o7GtPb0SHafEFWhQpLs7DuArzJjtWBguZH8YE7MlAiEAqL6d98Gfqnx/5kynxiyhtA0Z0oIICi2QlVfZHXrxFiA="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608101935_1623147881225_0.3815866139636863"},"_hasShrinkwrap":false},"2.2.1-main.20210608102334":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608102334","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"fc906eafae987b595591a8f28280f4903835cd89","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608102334","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ub28TWso5WhjpqI00nwgGJrzrTnMtt5OSDRy62iq6HjbhQQr5NyLv2lw4j/3GtjRnoMOrbN47tVhB8cnQhrH8w==","shasum":"57463a4e1fb2838c323e5059495d668d03ffeea6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608102334.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0Y0CRA9TVsSAnZWagAATTwQAKALDpR6RdJPXFAA2uEy\nwhC/V7kLjz3UIWsoa9I5ya80iRwkkKT35UUuujvygG3umeigUDCCrjorOR2a\n6tH5puVDRJzzoy6LW8Ks0OTqg/s5F3nRKCDDk0sz4wb+A4fbfyKXEabHzA+F\nupq783vuUEtpztQeqq/URO8klZIdFDMT2VIy/OLmFA7O1U3uyugrmku87N2g\n+YFWLFSgMaJENpcSz679rVLBXt4X2Rhqi7O26Rrw2EgYNV6v7uehTapRDIOH\ncXJJUVhulLUr4uB2QZNQMg51nbsROrukqqKXfqybR4NnetksJlyOP7nxPy9i\nAMJaiibdXPhKQdU5MW4BX07A/AOawReECVr33zYvOYc0CyRYMg7QTbdym2ez\n3seBCiRBn8VLCozfs9cKTAA5PmBsY5AxW5nwbw4xDZShGKZKXysdpwIyv20c\nBwl5MgVFc5hv/1eDiVBf5T5TpasiQusObeqKgTR6Az1CjVKPOwZVKbaHvkv4\nTEokcAgcqmCxua4FfpP/0jBaPzP/hLDT3IMcPrZxhCbZ9iGgtV0r6LS30DvL\nh7sY6fD2Sdqz70HNqmw/FpLh4BgHRFwI+3DRxGEb+zdM1XKeQJG4WU/ZErwJ\n35e65sdxXK123OzX7CrQvm3wraLlUh1LCSxntgxfpIRyxHld0s98hyiBmAA5\n/Atd\r\n=d4tc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtycsQi1KPO6ihBvoEzxRPNEJ34I8B7HjfoIIR/gOwZAiBQVkBxdjHNvI68yplohAMHsqJ9HJTmhrcW8KPKNLYbXA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608102334_1623148084319_0.18406953060668685"},"_hasShrinkwrap":false},"2.2.1-main.20210608102645":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608102645","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"58fc768dbd6d0913733a017516da94cfd8361e61","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608102645","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-QarhlWIxgmvEAAnrOZ3nVoe9evRTzjLWILN/qTvYkyblFD9afuNaZJOrw/1tJmiS8A8wNT0I+iaiWKo4YjuLxQ==","shasum":"4759e3e5537161564d360719b02b723f9ef68bfc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608102645.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0b6CRA9TVsSAnZWagAA5eEP/0L5By2hL18kwl04N7FG\n6UJBIHxpqOvuapmsGPnQiQSqBtsMqe2YT3pXzSNmFyE22vdWITOMDO/rXFGS\nSt8/aLfUKX5owljzW6OFltW6eGqR6UxaJ9jDp9RXrqdWeK+DdGWfRu9cq3v1\nmvFG4mYGvl0FtiYt+UOrUUWYY8NMCITfBQgAWKDqlZ01d5xuYkonrJgANQul\nl+SQTZT038r7Nrk2K88U+V9qnDMOo1lmE91WuZPrBuJ2SqPJa6uhOzJboUls\nSo59mLRbDD/qw3bbvn7Yfa/Luy1y/9Un8qB/kFDV3IclvQ+inP/m/5xxqtCA\n3+fOmUaEjlOGribtcumTfCCkh459QPJRJWxpsNpv6t20k4BmGJPV2A3O3TK0\n1Ldu3GTJJmCZvKO/amz9alIzSdT7OQ8x0/rtdhEaTBL8ez7dNYWwQRzWgdqA\ns8W640yQHYPkE9bYidYs8FOkoP1pbfu9Pka5l5F2nMWSykWrFh+XUX0B3Ij6\nuUT8845auq2nfSIo3mfjN90540kQjbfaSJBMsDICMjt02F2MoisAYwZazo50\n9JUHcCTJPrX8k8XVM/vf7MM7rJLXd11t9ETjs7194DB43GY8ig3Cyhov8Vgv\nFmRvG3n7ATH6QdpwtTVPZPaVMJlcfSc1AtzVVPr8RLq/HkwkWq0Yq94Nt+E6\nIBFc\r\n=AI60\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8dV7ThvT3avzycBD53z14JtbG0nDkLmooSVrHpwBv9QIgVYEGdTtDsEREHp0X4TuCBd9g10YwgNiHzDLuRVdnux0="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608102645_1623148282168_0.9855049163301015"},"_hasShrinkwrap":false},"2.2.1-main.20210608102646":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608102646","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"859801fb09483b03e1e3a6e34d83fc4d5324ed37","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608102646","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Mhngi/gPizTiJHPCcx/qyPUo0cRDnVqk/3ObR9JtygBWzVHMnQhMUtCDqUS/qZU/I94JX7pHExv2y+FKArz9lw==","shasum":"0f00cf20b1bc3a49ba5ec7488843d0f782960d44","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608102646.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0eNCRA9TVsSAnZWagAAU+sQAIB3dWaoVUJMkeYYmUQ7\nctLboG1F96j807lCifCeTpXByOMtkDR9OP9bKVo22yw0cha9MSQ569lHeqOv\nLlJDtLcOKy/bsqIWqqxZQoOZWyGaOkcz1Lr03LHZPRRwlxieXKUxojY3YH1F\nmKMofiPlxgMTCV85tOcgCfZ9o4GyThDpcpP8lE39HMjEkJO++B1ToPI3fyFW\nB9twMptHCKIFjR6PVq/6AANngH3DwkDcX4D/AOS2KBODemdq+EYSPrIYqfQn\nj15p98dkoEQcqlh84ejX7s5mBLo5b8QnENr2sNNzOR1jl2CyeFP4x5p+fZ+B\nH8SQvCN7F3voL4D753ur0wQcCu+4kdZEg7zGzhR1GcAcXLNSn1w1OusaWn1D\n2xXRlUWNYVm0/Sk6AAVGOvNSrrkynW3yv5dU0SI1a8QpncOQaND+qqACim2X\nzxIHONmUyG9QCNIrJTzvYA6/NB0HEWQuIJlTrPDxWJWJ4i7eh9VNiykTqQBk\nT/6tuTuvYBupBU/QeTf7A+BnA4haMuITiIMRozupt+r8hEBeEf4M5XiOJMhf\nAL1cnShiSTjMub5nNGPLhQtvQ/0KuHEjFSwWuwy+mBsnf4mfgoiXmhQmGmsS\nmU1BGl/fZm/JDGOtOZPdmFbkhROgZbn4opF+yFD9fgJaNxkZggI46AORt2eS\n08Hd\r\n=ai/r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGVHlINvePF2vILKGnsMWzIzlmvXb4dxmJ8ILDT4TE4vAiACYjWVFTKhh0/nW5897vZzoeix/CfZdM4e6fpBhyhuig=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608102646_1623148429321_0.4117913748695061"},"_hasShrinkwrap":false},"2.2.1-main.20210608102959":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608102959","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"cf217b4ed48790f83298ffa62407a0714c5ba8af","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608102959","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ICPk+qD/VeL0E8MTn3i5cBqHNiOEEP+iKAquHUb7tXNXj07RiE5uLNf793czNflgKa2/dDB6y7wNyu05GLRUrA==","shasum":"00742f7cb9aece915afe50db6a91193cfa8fee39","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608102959.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0fJCRA9TVsSAnZWagAASQQP/jRK4X0Hb+JJJoBGWYsH\n57geYlu1c9JS2SPXv58oIuTmjiv6WbHRSWNq2bDOa2WQevYLg3Tl8NGGR7K1\n96Z+t/UDcTeWsu89pu/zl3vmKJPuBNl+XbDSJb45gkBOMeIfXWKphR8pV7kX\nu54bmeI4053Ufshzc8TR0vRHrv1xmidpBsVTB2VEzJcD3KcqjsKQU+MQEmFC\nDkDo4sMZsmg0B0/Us3Mgqz5kFeZK7MDRHdJ87ggHRKN8BNKtrNpQmT8pyWgP\n2dRTXfxzliA6FqWWu5gROMzyEbhxUo9UY88qzaB0QdY6GtOtfH5SRj+tMF2e\n/zYPG9k/J4BNRonb4WvAUyFMK9YfAI1oHf62YObiwiAI1RfDgNXoJZpZCxSZ\nBMhqiHogbjlBoLNWkEz+c9aj9cRMru13m7UNzW0agRPT0JubhcO2kaiJNsr7\nJcd68G+FspQlaQASMTcB97N0zXqE9D4hr0yasJ2V96yKAz5wglXifxED9F2q\n+SHGxL6VWEu8WiBaD1RdTJHBv6DRXCeVTO1IGk+iEx2PS4kovtWqLXEyimHv\nir/6QUgGveuTX5fGXs2V1B2TCRIK0wgj9I/1CefMMMFqH9bq2szrjjvITIOt\nEHJbXAjRvZ3WnxLTqs+JZVMWSDJVPp0+kAkRvX8tXBVcH6waiSxZcBtqCK19\nNZ5S\r\n=anC8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk9DI19TsyH8NNvAjL3+v8rhIcBPADVUylcRGIs+hIhAiA0Qh0cACB/g1YpfzwxBTxWThp+oecEA5UE86oBhLm+bA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608102959_1623148489425_0.9543255528931989"},"_hasShrinkwrap":false},"2.2.1-main.20210608102960":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608102960","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"3d67172cb99561ff84ab721b584a8f2b2123b197","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608102960","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-zGBhiALuO/5670fCj0ufVhKUremKLIAJgcqhqYjlszpC8RReZiJ2/y1yI6sV7i2q0PhlAem28jp96N+dwFviBg==","shasum":"21af64ec41f5edaecf0450855c1dc78023305641","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608102960.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0haCRA9TVsSAnZWagAAQ+cP/jYkI+TrLsAjb4dd3eYX\ny7Jscg2K+s3rcEoOGkmzeIP+uLq335dfpi5+MbT26TTJcbQddRe4jAmhiQC2\nmw3vN+X97kfc6M0uMfPLgscR3r5nctr6BTXxuJzwPaHKUPtEu4Lc5WcNUFpy\nf6fqpZp3CaEfhsWmB0Pf5pPXYCXsq2agFJs4mSR+iHe/8p72HtEBQqDzLAXz\neaoYA+sA2ifxd3G1iuA2QZjRdetdmPAmVxHxrRRvHa8LxPTtAMJBTagZ/ue8\nTYVKa7GVPXOKbSjB8Yy8r9WfTW9w12ah9gkDdxMSZ0wrRCfgQgoGMh5SnBSC\nZ2Mqp203dVmE8Yi5By2Mfro4nAIkVnKW+Vq+QgqyAtVwdPG5W59GK/6vVubd\ndznBpPrsFGs3ZavmW0p8jkWWGLLQ8fhPTbPryv5TeQD8cTWeIILNPLLmCpfR\n+O6+diBwOsOv4RDWlWeQvhcTFE5cAPYGDeORBQW0XYXW6OHP2yeqEzS8jHlq\nIYpLyOYMjBR8QF4qFDXZGJS6d9V87nOXgYkXUIikLzWNO8Peyyx761z7+3s8\niPniSPqHlWh6/ieNmrxtw/nkt2WR44eGV5qg7dy9zjJWGbmnNGt8mSmj4Xon\nUQ5VgLuXl3uNixIpPrg5UfD1shuQoRpTCdfJFW9KPZ6NpBJNoQdpgTRSSWGV\nGmqD\r\n=ENXS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXYI7q11cUgdi3OmbxE0V1S3FyQOyDA7QSghrcsakOFwIhAKc2oBciknLdeFSpPM41O8qhnN2z/8Uk0AnZT6UzGawx"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608102960_1623148634473_0.7422682955958217"},"_hasShrinkwrap":false},"2.2.1-main.20210608103313":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608103313","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b40f69dccc4070639e877b1d6edd118431cfc285","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608103313","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-1UUZQb2qWaY0TEQVX4N+Kkf+vSEAQVIQ0oB3Y/Hopbc1XFJ2iuR3/RGrfDmimwPeE0dLc6lgwd7nbF1+x178GQ==","shasum":"7fbd061753a9742013e8b03048ac499bbd24c7a4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608103313.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0iYCRA9TVsSAnZWagAAWx4P/355xYDJys7YR+OoRBSJ\nBePNYaEpPlAV39ZLW3wKKvbJcneOfUej2ovVifHw8q0D4WUtPUmNtw/amHiQ\nlHgCUIDIYEje9o1IjBs1puO2NPjv9SKIQg4Q9FHyctSp/XEl8FhL2Dtt7N+G\nId1b47Fad003ghEG4qFZSeYA9fSo+UjPWljMO6Hzh3WZ23zwBU+jE0jxOMwg\n8BtYkpjrdlAFjjaS0h8nzdtU0sVq2rIgXbgbibixGWTGY1pAcUSVd3lO2ViE\neJabrcto9b1s7bTGNou0LplI/j+Rj56mqmymnc0eM4DMXUGS10pIfvJqsmuZ\nRSzTDqJz1ImbFwYWcFTyaFER/YA9dDc7owxHlduniqJgoEciFg/1Cip7fDqt\neYydjRtp1b3eFHB00coEnD/d6ecQnoWb6RojjxmWOld4/w9JteWqDfW/+ZeC\nSi3Izndh2aWTOOZPB2ix6DZUxsJsf7+StLjPIw5tEOnF2zxleIuD1tIrOYIB\nfySeCc+OxG5sGdGPZtTWWqHjle2Q0FXdUQ/M7EQCPvbwxZ//vVZ+A6WJleM8\np1mvC4ni9wkKaYldOeAszZA7ynw5jYL7gc8y+S3+oeNGOKpSzN8OkOe0b1k9\nnS8J/2USeqLdltprueaNujT6C78NlAYKSf6Ymf9e/rs325tUdHk+X+APt+WJ\nuKv0\r\n=LABP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6j6vB4e1AZB5ET5edsBD75rgUv31fTTmvS7c2lMVcjgIhALRbsxQkHtv4SbngoJyBYaaKgvpgZi9j1lAwGPmawTTu"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608103313_1623148696285_0.9413769881498124"},"_hasShrinkwrap":false},"2.2.1-main.20210608103314":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608103314","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"62634bd914f04bae5048d8fd7d8252ccd1471994","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608103314","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-oIAp+UutLhSOVhx4BVxtD1TzS5GYLOZUKW4kveQCotQNnBSdr5oK9XCdOlkHcdiZRAZtOJlCysJdD5Qo4P40iQ==","shasum":"9af5e7855960a01487ba73a55c1aeede15cb952d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608103314.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0kgCRA9TVsSAnZWagAAQ7UP/Rp0rg40KwFb15mqNaJl\nuNgxqNyS+6GQ+S0E5UYtcBTzSyTC8VhKZVfHg6GFHLfbP/8e5zQ4OWFRzs/o\nxHDPi+qSYNZ7K7f9UIF3/Q2bGQjtuMbrjcllE3BiA6CYXQhBxolad2jw1F0g\n/gYbJMLRcvzTw5LmpvTGp1z11jyB6Q+uOuFldDyfu3Tbb9VsSwU8fG8kqHLP\nxbIHpGUifTxhtaMX1JPwfMKR4B+w1B7LuZN/CmjBTJ4yR/ycY7dt8DYb3rff\nfkRlJpUxbpX8cJjZxEOg9X/vTnppwFIgmN1DNY0AnyPmWve9/UUivWcjNDVc\nHFoL4A1gfk3Vm7z++amylq3aLDAauxiObhW5dfQG0Y+LYlYnLFPP4sMiqD4X\nBrrNWwlldKDz0mv+fnGH54Iy7EvNVuxMSC5Hlontfh49C8ZciQSh/i1deOXN\n1svRSQUGNqaTLHhthBqEwQYPQlzv/CYOQddq7gFVZvtV2id+xCA+QkFOhEit\nHXOeFr5nSNL3fwAFNIoUF6uxVoYbhQcxTEVccG3tM9DfbNol948pxrmHqMVl\naaTKBuOHtdjKdKrJjEmf+FUTnPqMwvE0NO0wqSA9Wh94AS4P+acduWDJkpHN\n3+B9znfpQyfhasVChWkl8tEumAZb3ff4ePNyWimGYSpko5tj2/8TQNUWwCx6\nAAe5\r\n=YGwM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBzRPyS0yz/z4SDzDzjdZIHFvjePsWfzjH6HqMJQ0pGQAiEA2BMIvbQU26TpP/iPhIAa3PzPNOofsHXpco0bdXh0S68="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608103314_1623148832085_0.1574531254206024"},"_hasShrinkwrap":false},"2.2.1-main.20210608103645":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608103645","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"a58702f0e631bef15185870939bff93ce6f2ea9b","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608103645","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-waeAMwisQV5bDVsIX3glusk19A4fVGPcUvE8D6mMXKj4m4BWJQIZSeSEa1VTZXjzPdmeZqzqzfmQ2B1GXtlizg==","shasum":"402b733d1c5479507c0a49f385a79517eac872b7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608103645.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0lgCRA9TVsSAnZWagAAO7QQAIaLVXZZ4hFuIR/R406y\nPKSfuw9cNChS9lEJW4WxDWumOe9biyyCJ4qHzB5fm2R5NHYQBy2cHznfmoyl\nXF36kP4CtNZTwOFZF2xJ9M2J7bWRSSqjEO9gzsrycO3R0Ru7ZO5mjgeMq8io\nNlYyDVxYvz/uC5psU3SnMpawegGoqSvJiz+SuLJDxppyPU5NFZnF5pItcGd3\nY3c4KPn39auYD9fdJlHCpK3A9BsbZkaoXIwMwFs/9U78Ts2cB7Qdrkyb4N7V\nUELAM24vJByMUPcFisn4Ul4E+eApSGUGYT5VoCiljAoUBtzJyXlffo3DJwnO\nDZb87ZOGbmh2daiKRnEYJyrtcOmw2YmEgv1RbFDRnoatilEWlmE5xfkUY6lv\nBgAICjlvsPs3TX0sl7ydd9ee6qeLCqZyOYcyFSLsQwDMv9mZyo1An+G8hTi/\nalWoYJ0Q8rfnN861xuz4XBZMvocbpWgI3XhiybPvUF4ZHnJUKnfZ6fVEDs4o\nl4OzTzU6y5mspnETU5WdxsW7EAF+pnMBydQ/qghYQMNYk0a0gkkvWT7lExQ2\nP0Y2Hm1ABByXMsrB61yLCx6eY7+XUTXcMldm4jjxMRTPiLr2pAih6YeK4SYJ\n3Zu2twlG6oCxSPPcKah4XpdW9EawPFDZpsCXj+MXyG7/CcV1YCk2Tob9vXL+\n78wJ\r\n=Q2uA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh+bnjA3p9g54zC0jFVL7C6mpl95eg9gQlX9Jp7zIySwIgEP7odIJAJvSDS4ks/iUterPbBHgvPyu3JoMZxpBeajo="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608103645_1623148896241_0.8677653505516261"},"_hasShrinkwrap":false},"2.2.1-main.20210608103646":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608103646","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b700cd40aa96270f0207f65824e5f1d343d7735d","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608103646","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8HovQ5YjZg3rM5gX4efOMC5+KikebN6XHy6xSqV2iPBONIc7hZ2yA6V1NjVbnFn/JYEBTz3YIYs4+l1myO8zvg==","shasum":"3d9e2ffbbaead7bfe088ed5190993e7e0a777271","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608103646.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0mzCRA9TVsSAnZWagAAM+YP/iByyx3ZCi2FiqQ2NAlf\no5NqhU3zu8khd77jSp2dPP9Za3rdeLFX+KS4iz7A0ThjhQDhFTjYbYFiKiOX\nyYCUGF0b6HnFV/xXnn03UmdQMzHbwBg+LmoWPEZaCQ55R3/gkUMGQcqIULPz\nqhsBabnH7dIW92oqG4+nXE8JuK+SZAlS0Cv5LJREQIQrt1bMTNm6108Jy/rI\n2Bp+nfhk7bLSmhkKvA9T6HjUqK59BgeGZSD5YHxiztewXmfH0O47FFhUpo9C\nYA+ebL++cOZRGHB2SkgK8HE2HmSjiPOqf+Js+jdn4ok3fmQc7GI9wf7TQXAr\nTepushsvTaX6kf9SVTrDiX7QqCcNHnyxFQtrjcUyG3InRaZtC7mpL0/16VCQ\nkKBapfIXM7YsV3wjJgC+AdUf6U8UD777cZ9lxnq+B4qWZL65d4CV8ek2R7zu\npj4tQw03mTlH+RfrG7CbYFkYrGZMWydyGZ61okGU+uZ1CKzhCmTSMgBRZ6c3\n5jKDw4coqZ/byEj5n8e/8lLq/u7ZbDTDIufO3S+GoRHCKrO4q2cyMyT7Gwgp\nH1OYeKINmOw+aOCGPZnlZeYKtE7i5hzmZU7z1oga9dAlfX4tXS5/VZb9CrXd\nbVKPXp7dedfaAb8KGzsrwL1TAEDmJkMM5vMfZzZk17v60C4OpRY8tXQLytE3\nqrTg\r\n=U8Yp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4lEVVlH+ioKVwvqz3FK84lyocewrv32DUsMfrSXY+xAiEA5Tw047m6AfmpzFSkscK+Yqn7ryyskTVF2O6HqcIqi9M="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608103646_1623148978867_0.6425362515840018"},"_hasShrinkwrap":false},"2.2.1-main.20210608104004":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608104004","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"479d31109520e49359d8b7ec8e4767052ddaaedd","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608104004","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-WieWyu/m2wZcxPwcuGSQtRIZmxdNIAeqT5YXyPyElc56i0ymkae6JoBiO5AIxNw6uZwBbziHt1MKHbA+LhVmbw==","shasum":"7a5f2421c20d5f50f0e010c557bb28230cea2cea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608104004.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0o0CRA9TVsSAnZWagAAItsP/i75EBeIuYQRHzAGgije\nH484M12Isx5Bb8GunjF2B1VCdq8jJ7edfNd99UTox1ibPJrtfS8SFynRwz2K\nARBv8covbGXsIyJoV4nAiB7hPmlobGN5PAnA5ojnpXcm1StjtFisvbKeLBLE\n5Ot0PiCEBt3hojt4fS9TWZe1ARqp/Zn4i7noGn19VEb6jcRwZkh2rYdEnKxb\n9UT5v2An8mxMUUN6/zDwUux46nwj83E+XCkMrplbrTmtoPhBhMcNyRwusYO0\npNbnxFcN1dK/zyja9Zl9wz+rARK78E4Oay3TgldzVWtnBi8LiBD0vyPNJPgO\n0v0Y7uZnWl2XhyXW9gyWsO/eXfC84SqcyoEj1O31GVY+hPeZJ0sm903SR3fz\n+WTKFrq0KO5wowws4nGNd3K6jqygCoBFOYq+07tLTDWaQLVn/ivBWykXDAbF\naSUBbWyKKlY8Q54C3p9r++/+aUwSZUXs9RER9SB8Als8teltg0BY24F4BP6x\nrmkmlA+l7Ap/t0JpAcaHaXBqr8/3Zm/wRzLmgW0T2myyXOLc/t+h2McaETbd\nfSDsg/WV3rx8AzzmrYL7fuvogn6Axy6/mRQ9BjzV6IOYg9B9qC9MNjhf12/6\n1clPsz6m9K0RjNCBIABxbSRvGoIYReU3pnmZMv8r80PKp/fu+wpJ/74T7ik/\nQYKO\r\n=PxsZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBCquX/uQMZsKJibQnkUhfTBFGj0C/E+zqRMjuS+fG4AIgR0OtHHvzQVkYtvXa/EKIEpQQSYoPSwgOHQJN1ZuBWhg="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608104004_1623149108612_0.6935340094757658"},"_hasShrinkwrap":false},"2.2.1-main.20210608104005":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608104005","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"5c10eb577baf6d1b04341e620e5fd41b76d368b2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608104005","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-iOttNwJWTqzXhq+CzYWeyjPlKx/mLpKbV2Echvtw0xkO6qK8SQ6zSDw924kgCC3OeKGdyBTP1VFkC2pQ+D6G1w==","shasum":"4a2bc3827a5b727a149184b9b24844f59588d921","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608104005.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0ruCRA9TVsSAnZWagAAHToQAIA5i7V7VgXJzBtIyTdv\nVYNok7MD2Iqtcx/J+N4pfFP5iaW5f5w2CXnDKQK0rU6deRORlAmX6GAWao1z\nHgeqVSRaHcRE9yxh3gqrPr3kZc7RqvUv9tOeO12eMZ63WMBfxrUsjxjOmFkh\n4DDQ1hm4pIA0FZbi2CthwMRbMDQ+KbVDfO/D0T81ZYu1yHZVfZwht1EHnduP\nHGMceBokeg8lCEyfrdDklwWnEMbeD2H27ZDOWRaW6dZ+Bc6W78/jTPb+yErU\n87gSIgdsk+IQM2C4Cpu8D8Nt3sDnqz7dB2/QILapxoQwEyZ4TPouH+QhhW9r\n8W5vYkv+nAgRL+evNOyjObMkl6g3VlMIGGTkowBV+g2K30kR3nPK0kAOft/j\nisbfz4ZR1q9GDQwTia1RiRDKl3tw4k0qmLrmhhLtZKql1ZHk0qAk8mCHfnpP\njYftCRmsEvrf5CWweJ+8Oa0TPgJvYQTVrVn/8Xn55YG/a4sbl8YeC4jwRWIj\nEx6VksriZfz/CDJnHsD6WHgNL2lMjbeYPNiHDnEsWQR6OZFGtF8pP4XhE/g3\nmUAj5fp7pakhg1GTNV6u2nYAt+bUOjUBT1kYLsqxGvFkEufLazi43tC7ozKe\nXUfOv9eMtEs3rEgwYmj5E5oUIW9hh9wAgvgx0ojs2M5AKB9iCFc0ByZqrOjd\npSo3\r\n=MV67\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC1Q+j6qRt7GWbUS6sub0mKgC4xZjLmDtAsVijplXoBAIhAP/nc6ya+jqsBx7dvsjjM0Y+85Z/wmG7Hm0uc3qxNL/c"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608104005_1623149294628_0.47290640107908555"},"_hasShrinkwrap":false},"2.2.1-main.20210608104006":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608104006","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"d538a50f15f8ce181eb584504df85c2e7374c943","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608104006","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-5gYirb9+sxK2zawMl5ldf/xMPYLEc0gGvWIMuQ7coh9QDmqdds/YEuqF2Oy0ijT+7eUymv8u2eL2cGoPfmUGzA==","shasum":"d118204fb244f523703a743570d0ac181e209d3f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608104006.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0tjCRA9TVsSAnZWagAA608QAIoRGKgKymJRpRHbvmrw\n3/tlgjtoHoxvk6eNOWqABe2NRn7/mA5kjTyHPEdv6zM7XVBQfX+6kbzZ9zsL\nZYU+GWgJ3FCspqt41vg6dYuZu03JPDfhXd7ePjNiPTuwpuj/OSraZWdYmANQ\n/YZo2BwpWuRu3BIv0uQPuEYyTWJoTbKU9od9I6BNfHjnC88pdECoMGQchjrq\naOFbQB0gLrUFByEKt219hE7ztuQD090W/ihNCq3wfTjpRLNA4FVkzPc/B6Oo\nanOuUbI0ujvvZdx+8RBHUFgJ9e9GrEQLnT4z+bqDinCHKoTXlzjcyh63Vf/v\nxMDShb4tZTn/Uwgvt+G8ie704JVeqdfE2GJH7TkIotc5DlsOs4eCsjSdfmWh\n0dcKUQTLkW8ipQHZJp6KlPjwXDiau2+E8p+W/9rmeAXxvAzJwEazELNT8W2q\nkcV0rLhDwUGZKmDjpCbi7MVkEKtLnKzhFyw7kdna96a8BQJEI3NldFItVoNo\nxWvuHGl6kmVzJGQ8hTS50rcfDb2A6YSRw6iCSfKvXGfwzpN2FL1fvfkp0g8N\nXkgvsqn42zvdWj6EFlvh/8iHeS9uGtmd1BSfFSpdQeYDCWNv434CnXqt3Sqy\nL3nVKF8uW2hs3dydiHIwdzGULPXHcsxOc+DMj83lH+FTtK7aMDMoFnXPQBg1\n7nsT\r\n=CHpu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBChbXuRMorXop0MllRYbUZAdnl9q87UWntH5nP55t/0AiEA72ZpHEOke9Ro1uFN4BA4zyg/rWhnLfL4wQtiV0lGrPM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608104006_1623149411088_0.7714310572043332"},"_hasShrinkwrap":false},"2.2.1-main.20210608104708":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608104708","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"5bc1b8b5c26781d4a60799bc0df07b453132b35f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608104708","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-18YnDs3ubHD/Vwy96ibvss+M4k6Vy0lBVi942odfCwYt1b+L6bunoSnoK3JnoCT/mG4PvQ6nE32c9g4UwBp99A==","shasum":"55b06aa7da47572f0c2068b42e511ed9cdc42fca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608104708.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0vVCRA9TVsSAnZWagAAVfcQAJujSxALD13faUuKTJDs\nU49suU5ndcb+4ZNobwyKEL10b9Lm7ZOMUMCDa0l7A9bxYyUGclidRMsEHej5\nr79gmjgjCWfEses8RA8VPk1RklbkvnnOPqyzfkctq4gBrTnn++8L/V6sYse6\nj+hlTjSM1aUjR50reK/1rKB07dQmn3RlzZSYtkH/ZHva/cg+5/Uqv0PNfcOn\nRHT9144PKJRqiEH4hudcR5nSaiv0tTBU8OB6IuY3FalpznBy0BiD6kb/46cV\nVM8ONnCSVVv9x5oAm2pbNR6vMaMXIVLyAI789/KjJDBhTSuQZuJmVdo6v7Ub\nS/pxZ/kG6qF2v3Uir8kwAhRTk5RJEp842iImmBuHGwfgqWHOMVl8QF7y0qOY\nJnXPKbD7lJzR6cZ7wpW+wJeK4LAbuezcsfuVSN1Bc0WUdLyvfgk9/7mOcidV\nMjCqX3k9e8YCUMEPq9fEeOZkDzISW9TvKlh49ajT0RvBuiTuYaCRpKDqpHyA\nJjblErr3Ad28SOMi61z8ZxzAzS7dCs4kXHB3hbdy/jndY6i7nDHAvf/nfA+9\nufOMWc55VbTfmGDABXu9SfFq8CCTxz7Nlo1PfOVcVDK4dsUUVbdb0yuSOP9z\nZQLSoaTRm7nc1qdDhIZNkUqgw/dhpw98xHlQOv4Jup4//SDV/FIRNPVxfnJL\n2bZO\r\n=PykP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoDGYb6HlCQzIxMNK1uO3D/h/kkvX5f2mS0+gL0P2UMwIhAKabw83NaEE9CQmrrUIXfQt4YM6fmxEM4QDdic1LZPZr"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608104708_1623149525763_0.15098097485458006"},"_hasShrinkwrap":false},"2.2.1-main.20210608104709":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608104709","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"dccf4e4acbba1fc64a1924f4716f48ac853b8119","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608104709","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-RUQ3iTUPnQUb2v2Kc7Q98KuGAQx+Vwpv1mokABzPDD/iZjw9YrfdySeB9Entg9YXIzfGhqdS9IdQRgJyaQMxww==","shasum":"1b5d445436cdb121e3b6c1083788e4fed19d53ce","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608104709.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0xECRA9TVsSAnZWagAALFsP/3M1t8sbHMEaNuX6GeZp\nnweucPQNmuDar/iHSf41mH+/RaVZnyoda+SLY7CZxcqs5kYaxqkcdBmufi1n\nbMAr6RqkGTKfmKFAViv5nCQk1BjiLcyq50KOvpQzWZYyC5vabnBRmEtgYcml\ndeYJF1UYihsPkpM8Wtlrh8/2RxhCfR+mXocKENxmFcH2UJ0M6SDy0CIc2uLk\n+SdekobR4RzCqoMcSbi5F+Bek4TUcgA57m2ITWI8PI/WLlyO9SyiJyTfbSQx\n9e4jmI6z1irafxiEmPzStmCaMPSdo28QGtu6saluISwVKGLPlQfrSkbBaz+3\neRONpZPTvnaeelrCdoS4BvNiPBS05d6uArSq3X9t+8LHGl/mjCpdzKCSBflC\nX/35DXdsPT44HAkel0y7tMUHbJPuIiHIAXTzSR4mPJDCXFBA8cadSFov++wj\njgU4CXoGx45ZQ8AaRmOLfHEYa9xAi46MWn5T4iVNfndXAmhrUVyta+6dZ8m5\nE+WygEQEw6IVWnAQz4GwKU+U9/EaJpBHunJrZ8VjfdRSQaCfxycOss/RghRt\n+QCh0Tlna/MBnqDGxs38qSm/AreFkabAXzN6nJBg37fQkCCOGEItjPLLm8ru\nUtR/o5ygzM7cLDULqQB/Pyl/7h8H/rYy7VZClKBZYwDVPOvJOeUfpSpZlTaM\nNoif\r\n=8Hgj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwv53oNGjBywQIUVQ8yYCYCNzTQx0iuQ+YUT0No7vDLAiEAkh+ghmN8fUvJVNDIqRDKLLPy8wstK8NJ4zakcfwmE/E="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608104709_1623149636117_0.3203303442235186"},"_hasShrinkwrap":false},"2.2.1-main.20210608105114":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608105114","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"eef8fad899839426f08f4da63547459e3677c495","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608105114","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-g0jgpXvqi7VGyBDtMrO4nyYZnt+AONWcKTNAx/jJIIxJv/uL8kEM0KiIrbbMIPfUSLQMTlw2/lFTBn5c237x+g==","shasum":"33c907cb3b369da464ef8f1ba7b336c9a0c11983","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608105114.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0ztCRA9TVsSAnZWagAAEXgP/1OBuMgKQotyC1gfeHrF\nJz9D8RTZJG/6mG9Y9b5Cl00fAya+Pe8ZfaiA08xlxOua4BpgrHU+WdjDH/9w\n3S2ic/cJho2c1tBoyrKcKWtsItNW0iV8qKHQgC4XOZPLwezamj855b34skwe\nPuBNkQTGkMaOo8cq4XYwXe81/eWAwAWvXTKE5PsuxUNzxCT+2T1bU519WUV1\nmkxkT53bMqQN8IAfSkBfukt5OgAMIeT3m9P6faovf4ebm809+aKkE5OBccHy\nVREjWlzJ9ZxY2MvlgqRkZyd5pyE4EF9fKq8jvIE8v5rx0DHrsNFMEUr+APeO\n3pxn5iAzjpRKb8fZGAMVLln/CpDLGVaas5bhvkRZX0ok9SKzhcK85FOpUTGa\nwR5ykf3Tz3zccxUnONV0ByzAh6yhqsGCNJPsOjmVf757x94ueGlrQ0wKZ16A\nvrHrJInRIoWpHa1aLP6JQGIlkCszFxXJIDUi+NQMvnZLQAM6FSSRA4NBkffo\nFX5zsJ6egNiEKwsBfM29NFkggHtS8pjvesyqr9IK0mUK8MEOw8Yhl8senmcH\nAoVg4KOUrcPFukCtD2IxZlxvdq1DuiNUVf9+DSBLZN8V9YiGcjV5qM8gLYze\nP37+bl0V3zGEz/QnFDsTcfty+rIK3O1FjPif18i8jkiv+u4VqsG2ol7r6Z0T\n6oy8\r\n=hEmu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnE0KmKtQL4UgN+b5/W7Zsels6tfx7fCTTGCa6bCg6HgIgZhjsFunukfzGs2bWjska1cMLMM7w2W9tvAhWT1jHCJ8="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608105114_1623149805470_0.2368075117734596"},"_hasShrinkwrap":false},"2.2.1-main.20210608105115":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608105115","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"1094e7018d10f485ea375ae5766b9f64d036a622","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608105115","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-w0T1cSs0uHF4c4UwNCjif+oizyMpzvg3fz/2eLJ3ugaNaIJk19TRsGoN7oC0PzW9DJGu/gguWHK1bDF7xnb9/w==","shasum":"5431bd9af1b195fdd58afe3cca1e619d329bb028","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608105115.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv01VCRA9TVsSAnZWagAASR0P/1ZIicob0TcTSIIAgEaw\nAb5m5B0OHzk9ZFFguDLEN6w8pEkvD36QtHgVa3sZ9sUw/xhKCD1nDf4EeOr7\n0OYQVCd003Y1/5hvAKy93JlUyE9V6Dz7cN1w8oHCmifVfsj4ruL0Sw4u9RBb\n3B0Kx125/97J6NxFV4T0VpHAeg45wNS+6ZEXIe7GU6vpCtY1wdvun7Kl8AtZ\n3/6X8pEy/dFchK0EazK6e2hccgdRAzjTc0kA/Xs9wbfP4gDZQIfnatf17qFo\nurcwrWaAijwrg4VKs2OUJ2r8WT18XdASg2tKpiexLpQoE3/6KTfpx0O4aFOC\nYK++4f0qUk4s2mDAU1+MbwGo1kZhVwFQMsZnzn0L4CPzG1ZLBqqOCwcZSohC\nMEvBKNkqR5rH+4749kQwA+4LxT75Jw3z2BExh2hbMAYtF5mws+u/553bXpRx\nz/coKmbco/APpzPIQL6xCOKya/a4Hm4Z+R82TT/ih1tVR0Bdt49qi0bAR8p/\nGeIqinmmuH3ppjRlDQRiFyMQk6d8RZmmj/6zlITWp5kIGEGecMGKcinYM+f0\namkkXXCPC7GKhg92ZEyvvhIALmPbsIlGsEaTh7cj5eya2gt8YblQUOApiOpk\nccTyspB190gTk8o5GpF8L8boeV2bh/ymTeHjBvpAEFF5UKOw/kYHxEMPLcg2\nVgvH\r\n=unSy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCINGzRczNa47WjsFL+Sv3tQZ/ltS/e738lhlMRjaCL1wIhAOVhxy830JuTtrMBb1K4i0CpO075Dnw4YGjdemDtT12W"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608105115_1623149909756_0.5187848146809975"},"_hasShrinkwrap":false},"2.2.1-main.20210608105425":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608105425","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"f45c84141f8cba81032bdb8f036d9884b59138c3","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608105425","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-eJze3O14dKfLWuLUBznytmD+lqXTR1XCSGed1ri1jwP/ICYMhdgizSpjHevjl0HuSavD66rZT1MWyltYHSC3TA==","shasum":"88da1fc716542600fc18c7ec9d08f5c0646d31ca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608105425.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv02+CRA9TVsSAnZWagAAviYQAIO2jVvtwHahyQAqnGah\nRyo0OVZ+qp+XO9N5saf26n/8PXQI3uC3I4HGJtWKRP8gbSlOYIWtHH77HBky\npkdfJZ9sVKQ+QN1tcaM8gm8Ob3h7pYlzHlbTUHnXk1BDsKS+irgymcX1ipRD\nU8Eh91Bt7hTaUWtyGX3/04d2IGfSGo3ld9E64fpBdSetg5x1advKt7AMvcoY\nShwSkeDPinqqvUUwUi4CZL7q41WjVazXAJqRYwnx6j4yC8am93XV4RGqtrqa\nAU4Sz20a4VQziJbExDEz4Ol1F2LGwQNR54N38tPdiSbmhu5fY7CYh/CeehQd\nNDup6QdKnrspLymQUNzurXVvT4HTysgz88Rhq5SIaKPARtmQKoo4+AcX6iJk\nUlwJndTRVUJ+tSmj4MoPU/Y1jyE1GsEImFJrP5SV9u78fqDADw98AvGofSXv\nTZwP7fCKL9vHx/bsYOkqvI0fSMTCXCrFKECO48IQ184RkIhmz3YeLq97aN+w\n1VheUYwZPiE8aJiN8QDepLNdGhfKHB0fM5oU23qCuVyypAezVLeM8JkL7JEC\nkMt9LmeOcunW/yaVvVn3qrqjPSxF2U5YOyZSdp3r5tH89tao7GQ3XhFMHfX7\nu+CxrqWtGRnxB8SEXa90sMhOtpZ2BDuE9MnHSIkFhL2nyYjwC162JYeN3DDI\nDcrB\r\n=FfI/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuSHG7iyUjT3HOwz1eMeTu93IHQG7bnHUvz+5nXwux9wIgLTZs+lhugKAJwL/V0Bs3AQYkShYd6wOBGK6JikGYZ30="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608105425_1623150014430_0.19287873498432972"},"_hasShrinkwrap":false},"2.2.1-main.20210608105426":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608105426","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"088afb09c416ab036c798d383e75d12606b1d0a2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608105426","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hhgBkYPCJa63ja8Q64a5BkoQg8CrJu2CUrJSyflHOXmWXNY26w4JoAdiqtzDb9SREdLeXgPp1nVcmR0YVWHoiQ==","shasum":"d587339762da5cbeb7a6d6624fdf3afb7dd3e8c8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608105426.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv04yCRA9TVsSAnZWagAAm2wP+wZ1uKw79Lpt0gl8ErSJ\n/kK7uLOxsV7LN2wKW9QYjsg8XMxU8AW/Ax8QT8dTJnpbdhIG1rW9pzf3eBUO\n9oJ2v8eCOQ7HegV9A03kb3Mwtas+wQ8jltekltO1hHwawwlpolHNoge5wtxz\nSoHnIPHy8BJiEEpOFmTcXc8LUkwFjB3jbmRdlyL3pfFOF5iezsN6pE1EeFuO\n8K1HJVp/JhdQRMWZMJ3fQcborhxKo1nDeFE928Zz6u47D2zi8eMmrqCfqLGB\nlWoIgcDAcBOQ6XpNi8z/gaV2GgWjYdMuxg418/hkzVLeSYiPfZzfspkt7YpE\nPw50zRGx3Dfr5feeB1njpwd9wQfdY2sL8mRb29XNDKVHrLA+5IZZHL4cAIS/\n+MKl+NEZz9BBjxj0OgrhrjbSht1y351Of1aY5wY0TuOivSaSkPg7OaK/PgiU\nK37ODpHhCHvEk0RY5TvP0ZibpcEfKOvz8e/FaGMBTMhZA0BWtAcaNiBeANgY\nFlNjA6i8nYd22lRRFWGvCt/koOfUpkENfppB+m0x1PezhSvddtqIn6lK67zj\nPhDk3iezu5vhaAWk1nuqlFgFrngxfeh0S+i59VbBz0NjXY2a5SjGxJ2Fyfw+\ndUsck377PT7bO6gruOMZNFvxvP6Ym7RKaUpuS+y/jjWTFAUu0hvOWg+1i7WX\nxwN1\r\n=HeR7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQ8K2iFRSeGY5wMb8s4tJiJRP/IDTjXiDljzjiqIkVGAiEAna2xFbIXBzEQ/ZIPOOjEyVxGdIVBNBHZAP54fxWVDaE="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608105426_1623150130198_0.4491310947541587"},"_hasShrinkwrap":false},"2.2.1-main.20210608105847":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608105847","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"811fe92e5a47fcbac49d046d3b8124ecbd7885cb","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608105847","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-UObNOyCCOSg1cI3TDBieW01FLkHiivvAaU0uCPMtqHa96dNAwU14Bjt4vV1d6GnVHO8rRnZwIo3h2bCrzLrc7g==","shasum":"e8d2ed55494a786dd37ad1c2d77d09982d379405","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608105847.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv050CRA9TVsSAnZWagAABkUP/iJyXWyMcUj0eGDavasI\nMT5uwNVFemBTtO+8OnF50d7hyO5YOxWOWpXIjz4k7nqZnCMUcpAIG2/855HU\ndJp6hFoN4aWCYGOzfXApFDWtiE1X/d8sQ90YEdrl5fPaPb+hddWu1iTwnhcp\n2YEeacKYtawlM1IV4k9ZuQHs13OW+wWUaYjMOjqa91WIFvYU/pZZiJqrrLU5\nvMfIi2ki880eMH+H1udBSelgQOUYRhJHbszQCRQHJE+3kEi9/vOSBLBROb/U\n1mC608wKtt67CpeXkr72SRbNdigi4Nv8kRowPcqXlsDTT8UXj00yECJQZE/Q\ne1iGq6JsEJG+PJtZt3CLBMGOu6YoLZLO9czxVtjeWHDE0+lqIASMFoqbLC7/\nWrbVB8y4rIUuJ8gcu3i5jY5AVNi0ZtSVY5t4cXx/CcXgzehTiTA4t8SbWP3g\nEJgLuHKBl6IoiFeeSNRwD4XlAHGgODPua7GlN+8deansAEVAoi2u4R1uFfsM\nNZN+wzTHjcmbA1GfOcbAOlyrqI+d2ALvjtlPU9icjiARBI2V6z29q+QgV+ov\nkDBZC4D1NfWO4Pwe2qEn+548QrTwBS/eAwYDF/5o2j+HhdxuYHsGPzHYv7Jl\nhiAkTcwP478jDfzOcWM9FwFvD2vrubxnrSYu7MsRL65OIx5KM8Y2wUMSq73b\njMCB\r\n=M3RN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDz9g+gW+pBWrPP5rgNBhc82FMB+LEXE8rVthe8wZyyAiEAr3s4rABoAq6xNTMmp3E72rZrhv9BIlqiO30gBRNI0tc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608105847_1623150196597_0.4476557017791689"},"_hasShrinkwrap":false},"2.2.1-main.20210608110138":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110138","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"8f0515ea4803b1847ca9184fe551b6dda8783ebb","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110138","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Sk6DO+EcYMapjjjfi/BNNlOuW2PJfzB0nGp4S13Bz1SZgmMo4esvs1iFvyg0JNsqdySDlPQ7v7PkLGWcyP2QJg==","shasum":"89c10d5eb7aee5cf67e2b9386ed884e0c0e56e5f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110138.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv09LCRA9TVsSAnZWagAAjSoP/A8/B9M4houyMRh3R2UJ\ng7Md/7cSIKt8bEeeQbADosYXu2+nll3NFaI/x+emAGlbZGUAnOL0Jr2tcncg\nUbK4rIdNq+Jp1qk+ajSNP82yyr0QnEAx6oWuhEs/As0iqcZXzYdzbFFMjn/W\nKEeGTF/ytGuTtWhCmNLUE4nb38SFXiWtPXJG+QhGD90EDduohE7i/8mkx6fx\nFn4ZyJQMQbM/mnOeRe45zyiOHIpHyxVqWxzvsYIgsLSbeALUEe9uF5woxVQm\n7gUPesEfVODTJ4pnsQp+udZGhpZ5gntxGoZ9JAfdxJOlLcgKMniqoG/3B7lU\n7KD/Aao13zJoGJFqPQavwECahwqwvUVR/OhSy9krW0FnZdY5vMMBy2DSTAPw\ncumcLKOpYKE6dLCzC+Z8KPfABaAn014VqSLY/eBavqIfXMfLjF6kDI6L4lEB\nWXHokwBpKSN3xyD/wmUZfWC0m2q6m8oxVB5jQH3fZiIE7Xp5AxXAOAmLjGnO\nfyoZh9H5ci6HBPDCKMa1gCFBpkwyDpxW4M1pZJ3YN70CpAU2nDSZ4OgZqlUY\ngj55Ib7GpUrfPN8o7JpfGxAVvXhuNA7X/3d1FLAF8Enifdy4gVsybxV+symG\nVqUbtGwxBE5am74KM6rYC3Dp8Lzr0uQ6JBd7D4plSaXrkBkgLJgZ3OJ5eoZd\nguD/\r\n=l95g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/uL/Iwt6iD6Ku+UnipGNr3cw9p51oqAGWMmQ+0aC9kAiEA4wYtGWHww1XEzDUmOh2lvI0l4Hf9CMdznbV65Fk+Zds="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110138_1623150411439_0.4910600848494926"},"_hasShrinkwrap":false},"2.2.1-main.20210608110139":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110139","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"52088c6f503ebc98249728a2b2a685cb1c69870c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110139","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-j0Av68oRCVwTDhSoReet1RbWldlbHcLy5fzs2o3nStkSlJnP+xJ55cwMx2KQf3do7q5kXtCp5P3zm7Qs9nXZzw==","shasum":"68ec5f49bf4ce874599274e3680bb6e2363c49ec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110139.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv0/BCRA9TVsSAnZWagAAmdwQAIsu/cTVmRMIO1BINcTw\nIVRwxVb2rU5VZtWD/GDSq4P+g5Hv0TncDP0j1MLX5StR6Fm5ovxzLT8u1eSX\ngfApO8hDtin/XENO+zs/ecbP8TIKKJj5o2nILuegCLbtKdY5V9ssJBJ3jkcK\neMopZHTLAztMItMO1yknD2b+JruOkHSJtJNVAnemUXeX+X65mtsn1gTlfCxs\niU9pEVqzyo/+JdreNQXGmQc9xqVcftsJfpe7wRFNTFg6wQJYM1QxwzonJN4H\nFz8r/9hrbG3NW0m/GsIVxIPc4IJ7VKV3/4B0hvZchTC2RxLST5edOyk41edi\nHOMbx18UKkqW93ucQwDKpI4//+/ZviRFiVXm0KxcVSP4LrUZKgSGwLc/YjcW\nIyojqVg+IrQp0zd8k5rJj/GwGj/qSXsmXsrjU7vHO94Vt6dKphbmLkYQuhZh\ntV0KzNevUQ8sIDleYUUKNiEBcl7ZbwZHEWPW3JpJvx2JLCWGg+JlscOuMS4h\n6HI4GgHRV0AxJxOD0sbt+jNknRAr6FL0oTMze/4Il4ywCBb/mNnPnES64Fml\nXalrazHT/gAFeH5lkDpZsOZ1s4qOwk9HQkIFpKqCVeMg5xrlE5wfnKhgtJ0L\nVa75f9kbHcdhGe8McHcx/+lHy3lKy1DaoB5+H54VtKXLoVhsZVz/8FngFT4N\ngw05\r\n=9dO3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmAtHs8YuDEQEteqps41EmRCiw1Z9iVGZNvTEuQBxwWAiEAt+SZsfibrM08n/PFfVeHkkn1msRAXLjb6nvm5mcqV7w="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110139_1623150529367_0.1439554467819073"},"_hasShrinkwrap":false},"2.2.1-main.20210608110140":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110140","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"4968301003a15119f4276f12f7aade3c50fb8e67","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110140","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-vOU/pBQ3uZmIkaV6ZaCmoRO+qBrzP5ZntQ9qss5qt9/JIc98rBEljKaXPtOUGzXpLFKIaTEgdxhS673LYMJyVw==","shasum":"e1316e7e159a82d091bdca1f758681c3b0761d31","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110140.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1A4CRA9TVsSAnZWagAAX/wP/0H8CEjtk73TAWTFf97F\ndIxtwvBpYnPA6ThlzEXOUEHLMX8JJbkLQPVtsoLy2qPADTuR0gamOv6iWAGO\nsHeUKUHOu68R56lMa8gcYEv+UQnyPeahezJkXnnykMx6MdoJTpmbCyCxVFmS\nnpeY7JKR+akXQMIxX5iooD+OH/ZcTVeLuRlRP9/OaX4Wv5HNN2xy6eJFZ6gV\nsC9nN7HlCbmsPhMlBi4CisEMRuo0FFI413uazthcemcCDoy23cz1vHt4sXUC\nt3xazTBxJxY9hnGBJGqI+/e/iEtlgJub6M75jser5d1rOcYLwyrR/7nV2HYE\ndsOtGrlkt2F0fBWnz6k6J5JsslbSqwSfX8SZps26Tebv2fsmc+209dR9kB77\ntbq/7f1apEr4Qc94EMV3mc2o6sEeSkpdmQusb0Kk8Cuk5JWGODRa7eD0e3hy\nGqOJ54FbLD5lfv1R4o1EklPVCb4iSOPlWorlHi/JU0Dn9zMOKYbNwmLbYA7I\n1JKgWxwlDYo7i+su+x1hQm1VePAjAZ8ybfjKPEv6AlFTokETWZamNy9ptZth\nPUcgyn4sxKfFAY6qg1wlCQFPhhN440i15PHcQGxyA6ZCwqwA4pnLjXtM80Ee\n1h/MYn2XaydRHaFRkXbSXQedp2qEVrzfOq3aAuvbbKW4srzW1wGC4jc8Adlw\nnLjB\r\n=Jj/Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCN3e+krSJ2Cw1dVxP0w/SYPtztDeqEkSqblDEyzYL8SgIgcAwUbcj4lZBluQEG+f8Jviw4m0b6JNG8ydfT7nOm7eA="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110140_1623150648077_0.4583578069402299"},"_hasShrinkwrap":false},"2.2.1-main.20210608110141":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110141","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"317e3fc125272f4f5f3d9955dafc0d3b0a877f40","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110141","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-QkY9IULicMWlZsGNLdz32zhyUkkxv9eCIqOiI/gCC8P6UnU0KZOS38i15MbybEcIXBY4NykBEdxMjnNXYhg3lg==","shasum":"95af88116e8a8e7049a3d9c1a8a008352881cc01","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110141.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1DLCRA9TVsSAnZWagAARGQP/Rat94KzTN3+boS+XDGo\nSE6g45/tEzYSelfpR1Kn/PIL/1J4HPP2VPIUOBMHFf2ksT7ozH0mQkBGMT81\nLBgKbTGISrLA8fiX40SAl0OtjJ7RP1Njgy46BfOkrN3gKUt+kCcDIHr9gDe2\nF3idALtE966d2iNsnvp5xa9T8Wb7f+u9ezFS+EOa3p4MWuq21VKYicPYiVNm\n5ZAgiASkEPdSRJtkwHueTXye4ERY4dSBlPNOj7E1M4l0ewhk3FbkGSgiJL20\nY93LrLNGoMIA3cR0ctyPQYKqTGX35RnIptVvl4tqKe6C8GRlcdQTy4k/1uRH\nv1Akge5nhKsY3f9q9pnJBgrNFvveqVWwQL2gzNzPbwSRgv9BfJ6Lbf+bE2O8\nxbRcW8opQ2aCOC+5qq6l8ZrEsbQ0OqSwcR14N4o5s+Mu/CgPI5nF3ZhVRqJp\nf4h0Z8GB0vP71fZkCRch6kh+Tq1ZlULZx1ZIa5fzwQPfABGIjFCqfvtAgg8Y\nj9r1xnqaZve6msuAQP13TD8Zb0eMjKNhL25rb71mw+Iy6T2LqnlHuF5Jr3hw\ntBo5IGAeHt8VXBpmTAo/f5gV8uSD/qckschZVpKwzCAI3u5KdsbQwibZ95ko\n94AP4CgBlrcmOZWTEneSghi97/UA5Rq2QKK2xKTNVCsI3P5vDZnMma+aISki\nDl/a\r\n=MUNe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwkYcYQDr1MCfj35IvWLXZEtODTzks0eUSW2wVycvLcQIgeqbQOZQfrriDrlN8cj9qKelf6KsUFiNoOtnC/OTnb48="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110141_1623150794876_0.5540874335543646"},"_hasShrinkwrap":false},"2.2.1-main.20210608110142":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110142","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"a1bad8cb9c09ee5e774c83fab97c2f3632bf82b6","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110142","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-vCo8vxhMUHCccVQzLWYyJnGZcSvQYB5pn3PGRdThdLi1BVcs/MyWMSCYbdRXpqT1UzKhJPW0hh7Inhn781Zw/w==","shasum":"100588471e5814d1ab00c734838e687abbaf2817","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110142.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1ElCRA9TVsSAnZWagAAJ94P/0U6CxgE/uYz3a2XzTh3\nsa1BkpVj1wW0R+VpH0RRY+UbZLBabmQMbPc3JaiSNTQcz4USeqIsFfSFAV6a\nRxa0jszZLeRsGi+t1frTiV5REiTLKBaMaf+q3TSEkB6ytuVM5nZLpOeN+mHg\npbKXiEwRBq9EueV0SxMgBdKVZjlNJIrIsjDWesZZpXuFDEh68vSnzPCxwGwa\nb3CtRflp9bRZLPUfo0yjwD157ApO3FnxkY+LIHjCi3X0lHWJHJ2a43pWwrhw\nVFag5bQ/newZ452JL1mSEkF9CfZym3OKAx8V0+DQ2Ipnjpvh5RWKNnFSQeaI\nNZE5ZS+3Qv2YJ5gr2KwgyWHBC9sshYuwjTskUXRwsTlKUqLJG3ACzbtnXJZp\n0b294/2M0JaemyJ/9l0Aa4sZ+aQ1nW/wq0LH5JvFBPKOUunMc7LCbpo8/xsL\nV/UdKvBYdkqy//tGnUA8MHIXKeVmyrWNO9RMyxnHPxcROhJ0aZhcpBHI7zGV\n7xUL4NOqW0aOia5treu757liFInwDvbAVWCvMGwwPW1hgy7p7D/BGHLeEgbo\nQ/AS3QXzbKWAdlQtzJYRL4YxE3dZqcs0+L79v6BNb7WXwJk2Ecm/CCZCU+Vv\ndBZo+Ca/wKr4f/aXgVIpV4HimaGccknQdWk+f7DEhfSCGFHbmQWhnb1prUad\n3geT\r\n=FxA6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjNt5bsI1gpsRgAvryIkpEAh/t40dav8Jqd7yGwBxI2AIgNunZFXL6kpIqFcLf1sdUPqL/gDkSh6wma4Cg7plHk0k="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110142_1623150885083_0.3418215378151108"},"_hasShrinkwrap":false},"2.2.1-main.20210608110143":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608110143","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"13ebddc1307386be508ad924f98f35ef499fe4df","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608110143","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-1dhCW+Og9vtOsMflXhkkE6f/C1qBzxvXOjArv4Bnv9ylJqG4uiw33ATunSGMjwrXW5RazhJwSJydLFhRfmh14w==","shasum":"204e03cb9078ea97301b2e31aadd513f9638c28f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608110143.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1G/CRA9TVsSAnZWagAA/KAP/iT/jkJ1GYxN8Wi6BuOL\nclNy1txtYYw3/OBVDWY6zLhCkw9kkVbIBPm/qLmXPfe8yqXsVBtioKiqifH1\nW15bZPs6NIp9FOaL7fOCoXtMhwHrWI22q/jKEGHRDm67JrrWooHr569ThEqG\nLVxqiCXdXJ0b0+YKLWUCzpUpw4CTihyp50qDhrJvRJalc9xNMYqetEU55L8v\nwcNqrxj5wBVPPd5albIAZ0poCY01jdrTYhkUUr1k2XohCT/PQNUg/3Qc7Nqh\ndqxhxUXo+gDEEuA7sYZHrartds3Q64Rkkv3El56HY/a4qq+F+di9hKFODUZN\n9HnXA9bXlENirrGzG6w1ZKxiQMmiq4QEW7hvuluffgODixVQFMjiBcPNwCRi\ndOP3TNp1pim75GM62opVOjQc7qho5gfA1VyHqcOdqfWeEfXdoepC6jG4mR11\nhDS1cucIRegHbwERPGgsDywfCP4C8QF2d/pADk49oDWtHwAM5Tn77CVZM1pp\n7LUPFXVKKT0RHEqTeDU26DNuV18s4AR8RIjPETwNK4o4s6YFMSx08dE0Cjvz\nalUJ/CSTP+yZGPXJO64q9ZP0g3CbZdQ//sue8ELCVHn8UsucokKt225NRKKX\nbhdqHeDa3sf0xBiyzP5+/2cmDdynwDF3pt4WGJXoYGhDgUa7OBh1UF2SviJK\n2kzg\r\n=aX2F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqdU05ASKG8rMbKv5BZFXyG7oDRItmJfM8CCvoIF5J1gIhANiVY+771fF6jaYb4OXuvpEMxD3NaW1oaeT4RySyD5M4"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608110143_1623151038947_0.021480445502178203"},"_hasShrinkwrap":false},"2.2.1-main.20210608111320":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608111320","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"3adfe6b9d1e7227a23190e5e75203518be1ae447","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608111320","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hxAg0KUFL53i8AyA91aqFZAfPLInXzZBowNGDWSebidxuq297AirKH3HPzhPXaF7aJsJ7eCvofuAceQBJps8Wg==","shasum":"9857f6597f89c6c924c135da60c81b05dff13d0e","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608111320.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1I7CRA9TVsSAnZWagAAGTAP/2+ItxY2Nq/Vnjmkb19d\nanSj0Gwo5o350iVTY3W6hQYn+ouxGGX4GxPOJm12cLaBMwPutjLEI66VWsx4\nBUmwe8iGI2Y8WISBewzYlwHRxUDx6Pb2D6DvUQyn1jRDifUSPcrdRpMC2Fl/\nk/S+IMHDNoYqvCodbRj5fUhJGiq23XwQSUpiYZppyx5FtoleYL1fTDdmyztD\nHhAjNHOuELdO6kRy1XIxe9DkGgV6Eevmjr4i/dQX3o5wSK8MHPbyM8prjedV\nwh2Eg5S/c4po96iFQa7RLjQu9+7SMIa2hI42PyFCe5QsTZa0IH5mqzNNIASn\nTQhlq8pXi2FDL5Yg/taNRG6vGOEyQQtzDqVWEx3N4SxipQWFgtwLaGNl8wDA\nAUYFOVgmGGPAgZDpOlSpNyrlmHn3Qu7CeE8blLCe6AZjFKCwX2cof8G+Wcui\nBsQer2xk2a5NuGXpI6V52qgBNuG53hPFnPrx4fv+8/hYezvXfPAZ6459PNi6\np+eWpf84K+J916zCpVm30TmgF9FfkEK1yX8q7VzTsEvZDGhhhl08dAETMr4n\nT56fSRhlh3bpu+iQSUfCUh3IKznP7y99eaUN8q/ZGRWxsJTTfaHj7xRJS1D5\nPK5JSjqIN1IZJ6UGpRHp8IFGnxtzBz4wK0agaE22CpidQl6XSbMkPhwKteOD\njk6l\r\n=rYh0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGEUt1ejbVN9WQrBACT7JA6Bt2QWzd74p/+XE82V96kpAiAyC4p4elNRg4bvbhIiWLkiKIasmVSFlxd0dn57BD+05A=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608111320_1623151162923_0.9322275798113142"},"_hasShrinkwrap":false},"2.2.1-main.20210608111715":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608111715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"3323b89c2f79e70294327bdbd4aa365649a9275c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608111715","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-cCsJM1IQc2189+OPSxHFPo/URtzAFCXZI4YGL1M/Z/WCFbZq8xDAviAZA8RukLo65KWVcmu+kriPhOMUFCZljQ==","shasum":"09d0cc18281f9266b804ea3c62057142f31fa38c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608111715.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1LtCRA9TVsSAnZWagAAxHwP+QHqcUrj27PYORJRp0QQ\nbUrojZ1Ou5xAn1uudtp4QFywtnH8En0vKMKDXmLBWD/hBaIBvkbxlPY92Yrx\nlYEGVbF9yusMWeeQvMh80D3/HSsFl0CF1szg7r3VIGxmnozRBn3fa0fhj1ib\nKUWwVm3HKEm1+8Q6DvZYuJTBPEO6PLB7/HxCwRX6Raul0QhM3FblAhBQhWsb\nXeLEG7JsuIXv9AuYR0Lo3s92hwG/U/rc3BZ7tbfT9K2OIRuajK3PNv+aHhHi\nSiOJlB9APc819hRfHxiqi+5zZCZZQD02VKSCQPndqNr5qlrD3TYDPqJ7Nzqe\ndA4+XaBN31qrEoBLrWnB+J8B6LyKgBuKdfuy6pRrTQ4lsolrlKSkFtuIZGar\nTBlRklGXW+Hll/G4H1Ot0JRuAxQlHGEO5fhOZS+0Yp8vsKPDjUvLjsZhIr3P\nEpEtuErcrUqfBVxSVVKe9VrmzpsP/8ypmPumqDkZX5Gpo+aM1ETksw39Z7kW\nk2Fu5xqFI+FcsVPm0QnZ8G85B2RNma0zOVBvLB0kB1H+omms6tVc429I4zb+\nAqsu8Lx+eUv4iOmXz35MXLx0rAetqgauqcd0Gmfz2jJvy9oaWOLl1qAdHv/9\nx8ITg7tH5l7SyX3qj9tdcMmtyeViSwJ6NHO0rDMHL9qDBPWRYm8vM9M7uZsL\n4LY8\r\n=nZL0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM/itaFgiW+sofllJt6Mm8zYQdOg+y1WuXmKtzr4ku0AIgJAuJ92z4+0In17JSfVYVRa0xZyzxnaqCpqiGMFulO5g="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608111715_1623151340983_0.9543226299399548"},"_hasShrinkwrap":false},"2.2.1-main.20210608111716":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608111716","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"8215c557521362b8f78477185a1bda6d2983b20d","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608111716","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ja4VWIFtTSqAm2EQZrUCCrPeL9gy0xPHSsC7nGkgoHwwAPkc40mHNWdNUkKTQB0bZcbFMEotG+Luxl70uDiHeQ==","shasum":"a0524ed77194a5016570a72975f2019c02590081","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608111716.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1NwCRA9TVsSAnZWagAAaToQAJMJ/L+XHZaBVIp/lqDc\nbZ2iqIdNrEyr6cYHdxtkUVpasDYJLItJ4MTuCag8e2T8rr04Pk7g85Hk+3wM\nYR0iNrp4EjVm6ax519Iyyte4oQMcbwjljyShc2L4Wtr4Zb7uKySIT/nPuhXj\nz9j+PC3HSHmbdU5bER/CSSR6eIVIWVdC3LAMFw258A912JBZVS+s6Zt1jdgT\nT2EhBJEwh7Rrs2Inz70SuEEAG7s4IdAEP5aKI4zWZU0gu0mfke7uZQ2zApgm\n+F4367eHjJMQiTf/mgP8BF9u382S1MZHRauWMm8anqLAene8orpd5xc+VfSZ\nH57aIpHTUkg08IrIF4uvZC8AHd7z+5zoxbh/BTrIzR6L4wDtRmwiJJFLZ6i+\nur/Z2bGzcYAVca9dHRtXqV68cRrwniVRfz9es+Bye+USME/83cOIhXa60jz4\n+jP75dX/jqGKDzIOfiAlvViqE1mcEd9xXuXdqZUxjk5XlliKra3FiyThDULz\nKPiDpZ66OJ1mj6eUhlcA0CCoZr0nchT6e6mfuQak5dqJtAOo6g5dlml7GvgC\npZuyhfA5yQNMlKZS0ByNSRT51oFEEDRPnw8R/klgh7z7O6dfqdQbZhouRVOq\n1YDzKtU3/4qj2tjq7o8uKtBlUM6ReBvnZd7pSkYyyXc2x1YXCG8nWSOyZwPC\nMprN\r\n=rJC2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv2moGcXyYiH7Dk9tmFJP9TslyrhqVog1RH8Dw5NOZ+wIgZOWOt41kZTZv4J2j/ko2faODYI2WXnZr6fMjUzj7ekE="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608111716_1623151471982_0.8452638125169174"},"_hasShrinkwrap":false},"2.2.1-main.20210608112055":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608112055","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"d421650836d5c1a60e75858da3df7934680ab2da","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608112055","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-AqfSWxTGFEiyrdmgjjVYwtm5QWwMU5obE0lGyKbpBFOSirNE1aLDEQv4ZpsFQT8ZV79KwjXzSOZ3/q7OYlsVHQ==","shasum":"1522f17037b86ffa910c66ca6a82a3f576b60835","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608112055.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1PDCRA9TVsSAnZWagAAcM4P/RHmLtffOa50pEffvQnS\na0cfn/DRdgYJfsQ5g5XNiIBQ4EJMk6A155RJKwX6G2E1v1YpU2YXA2IbHrxv\njf29ZLt2cdJG416phvLNNcrG1/x/+2cXUFcNhQLkgjnsIb1iBMMd3DmOMVsM\numAL2Y5a2wwlZsl2d5lCnvmeh+RJsqfGQdBMOwlhucY0paMWNg985th3zDuv\n4yh19hzeiPb1QTl3xb2hUCEgV+oYLXnIBL8iFcLSIm0BaBF5X+g+j3Uu7EGk\nAzJT2OQpMqWErZCWjEHEvj4fXIJvqjqp9rMWs1CPB1lyDD/BWmJXLb+IQ6+0\nVJXNWHlz8BmJ9LuEH6elogkQbqByKQbQsOcjfBJCbuMjYFjObYqNfi2OHzV0\nJzfL8AOR1hVhCQkxX6kfUobUatt4sVefrxyjXoASSJ7eg9S6ckmCHHg+171T\nFsiFAMcFV06Qr6VWwjDVpHp/XIynNQM/JxWnWNc5d7bZrn4nBIPgO/QY/KfP\nOqB7+JoD1Zh9qEnI62gVml6rbPgqtWEhNK7Du8zTJtV9eNMblkFCGpQqAnLk\nPy/8eo7t4m2AMvGgGvpyOs4Jo+szqJuZId4ythogot9EHPu96mQ+x4ZOmGlC\nCUMzDT+Mtyk50wbgU0XLajCzS2TYynhb8ThbiTkCaS92qxJOWHCAPiNP1MjW\nfacY\r\n=0ZxK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqd45NIgMOR4vHgczWW5B7jImKBgrdJrldNgJ7LspZFAIhAKVVtegNxHnA3KUo9xS7/6JswaxualquR9P2XWn8RILu"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608112055_1623151554951_0.08737309444574248"},"_hasShrinkwrap":false},"2.2.1-main.20210608112056":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608112056","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"021cf32298bafd709113bd8326d079039784ea40","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608112056","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-6tKv694X6J3veEEceCgVJLOu5gNC//RBuBWUnbLlMK6qEBvGply+pkJZ7PorCAOwGkPAhUPVBjLXoItWsTs5Hg==","shasum":"7bcb4b382595c0d1d59838c2b3c1ca99601bee61","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608112056.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1RICRA9TVsSAnZWagAApvQQAKCW7+HY8m/I2zwjMVCs\nif5K2KRtl0xNbJUeghLO11tpHlaCtC9KxNsOa/nxEWmQCjby1q617UUz69gC\nPHlBorF5T8mw4eKHEd6uLAKUQo6cNvPlalK7kg9UkN/mqi7p3N0NK18P0XJu\nGysNHM253lj5mv+fCsZIEY1MnfgqeTAz77pH+CX+6NK3DXp4k5GiwLN+zWZz\nmHSvdDdBRdvRYXD5prGYNZkW1c/ErLGXrqWCu7GkTwvAr7auVN5pJdqtzbeX\nEX1RwbmSM3oEu5aSP1ynXn+vkQ3CkJBRxmepdQs3kRNiSyuUbsK3uxvWpWwe\nH+/fNvhxQEcs2vU8kcfsLCXl2bE4p3hCP8oH7Xn1tU+404FgApR7OpBQOSxy\npH8Z0p38L+nO6VFAxZCu80OYAFXYrwl5OEkdvX+NV9TFevvjQA0lfB+WdQsK\nZ/WC6HoDjU5mqwzCaNmr0AsoG1vLx17g9xVlmYAnCkW7L904nIyqIaMzK5bp\nH2GwAdnnvK7OhI17eoeFxAZx26YP5A+wqr1YjrTL8+shj5msr8+KMSDfxmyg\nbbBGWXsHIc58hvLug6gcaXZfmAb6v0rHoubmqg+fL+nEpqGhu4kVFAmqxaR2\ntBQP2GzSsNbMGA4jmJ7tv79joOf56R5BQjioZvyAl0C8i+v7hC7xiVcOecqw\nYdVH\r\n=cK3P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqtshyC0MopDNmWSmwsKJazMmkf6/Kr1T+quVzkdFUnAIgEa5RHSf4r2XYjTyZsWze98BuKxeKPr10zobjA+G11FM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608112056_1623151688145_0.7437820666404082"},"_hasShrinkwrap":false},"2.2.1-main.20210608112422":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608112422","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ae50e0a31288deb5d2ae456624dd26919bb6eab1","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608112422","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-5ux4rYO51lZsykMYK4E1ACh3sv20Kd1ODvc0ewjViC8UHgi9+j9nvtJoCs848wi0H5NymOdGgtf5MIr9U9YopA==","shasum":"3f74678ee4c1ec3306162d888b35870f4dec0c74","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608112422.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1TDCRA9TVsSAnZWagAAIxEP/0n/TThyr/HiwBeF03LA\ntqhWGDN9DaANpXOSCHGKNYuHl6poMIOsC3eCSj3SUrfafLRk35rhUkkH1X84\n428YDyLQw76KubPSoeopznTu2HzJ3aj4oeW5S7tiFXZplgJldbYcqYDsSN4D\neAtZmweqk0/Ny7F1mwCdFbECvABlcbrUrWJGRh47ik7gODPbcroLb3Ajre87\nd1J6UAOkVOrNGiRVX/vboLJFCE4JE8bnJC1PuxJXo598OC0C7tNrO0UBsZ/w\n+imJ51tcAHV5/1vXyiO/VFaZtzW90hV4EPfWxm4idpzSMcGruyLTkexQI07t\nVNpvTx3jU4T9l7OkS4vVgBO3gniQkqxjYR46+I+0KmywOcs/3gXstmub/Qr+\nyxWzdC2ekWI8PmtSpFUOnuKksm1Zzy2NAPVRj+OnGN/PiWpfQaiRf5Wpa+st\nO3gyqPIHG9nRgXoGSHtuHhbb20AZ7GRaMj0GR4u6p6ePC8scC1p4GKbTVTm0\nyGtyvH7slm9A4GMen5nh1P5QV0Se9XP2T8I9AfpFlJwUrh1GP3VmbxQoCv1J\nz4WrUlagJGWRzOlgI2FZY0eitbxfgUzXo8j+nGQhLl8ljEO3D61v4w/bz/om\nEW2a+77CxPYkNPss6kzNsoD/sMvtRRiGbpW1y0xwrtuyNSPKaadJUskhSrfP\nNoKw\r\n=qmKs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfen/VGYf9pCLZbhDeJgzm/SvxPEtx/KfuGCWoXAK3twIhALx28H0IELgVWNs2hNkPgHhiOyz+2keJ96Q1AOPNS1pH"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608112422_1623151810569_0.13704545811460123"},"_hasShrinkwrap":false},"2.2.1-main.20210608112737":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608112737","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"149796f1f785e5d81a67520d21857db52d45dac2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608112737","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-0l+3eG4rDoW53gjtGWk768vM89LZHe6xVLpke/mqMkONVLT23PMMZfZlrNtCQ75Qoi+ha9v2AO1X6mRXTaxJQA==","shasum":"4cdfc8121dee78f7b5db5f677da2d77bfd7fe4d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608112737.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1VgCRA9TVsSAnZWagAAz38P/jjEdXTd0ckW0MgK03VJ\nxqLEOnzZw0Vbj5A8jmPFY9ob8TFgGqWs56n6/vpQMEi/MMSFFKo34fspTqNE\nlw897oJMPZy48j7Gfjxkml9jMjH7wi5kKJ/ZcoNaoIynw6BXoQ1tH8Ze4UT4\nzfDJrjcGudWNv5QcOyK/12gLpNIqn5znZTmp6CijDLEYeri/hnqad5Y4IPJP\nfxWC9LHUbwAvy2Q/fNzGU4Ehw5+W4dGfemDpWp6JlygJlh16uNhmmq6tg+JF\na6c6unDjuOcY5QdJjij7C5lLRL8QftWPZrvNo+Ed0tWyKho0kIuhNt+fWG9E\nnyEeUe7dFBFjHcN2JAbPcUSq4YW83/bmqiU4E9+41wSVF0qPyDcwP6FF5z5d\n8QZ4ZH7E1+qLnNtdDz1CFxooggoaU0uCsUDR5xSlTqWuhbWTuosjS5ucXEf2\nRgxi510xHI7+MwRdibfoIAEo87ZzJs1yWIZvqoB16/B2TSKPBILj5Rh4c/oi\nVAW6LQsmLWT1MYkZRn2e+7sggpXIG8k0mEQ/LpB7MEhAEIzAXv6sEtgZ9j+9\nkzgpK6lIBMsMmLqnlYWtYvr7EdrS5huPaYyqZCyKyhzNzuYxJHsL/NoM1GVK\nsNnt6GqatpRQDqG41U2v9x47vOKDsdYwNRH0tvj5vbxl1zv/3n6UrPWLU7Rl\nducW\r\n=3exR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICDEEZLwMk1kfF02TTJRqnvWjYw6chEnnUGW8saM9/1LAiEAxLclRVMP/y30F3iCQYdcm9RLIDBYedjN+WcCV6bpHKc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608112737_1623151968173_0.5325999641688266"},"_hasShrinkwrap":false},"2.2.1-main.20210608112738":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608112738","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b2bdb2bcc0e7605f3c45053648667b8b7cf39be1","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608112738","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-eN3ptcPWeZmPUeFjdfp/uNR7aE/Smsur9I/M8g/kO3pD9ofdfiV1v7xzqB1NgZh2sgqo3a34m8KZcDylekWvWA==","shasum":"2d4f85bd8f38c59bc72b3a61c3eb00888337828d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608112738.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1X2CRA9TVsSAnZWagAA+AAP/2aE0Nb3La9wb3tBNYBR\nyksVm9MrzfmtlQnWb4nWghUNOmJduAg8wO+D7GbJM76I4ySKJNSCKrAJgsiq\nq+/CTbHqfbxetMknQkUpBOiW6EKRSZaxi+kKdNHZsi4sgLpza6Yp3rUEMov5\nRn/I+Pv27eqSuwkGkVrvunFMeEz1RXBfWtntO2IGo+dA9nJaNHuBwPc976NR\n1bgiyDpmSv/61jMfBfHDsOusy0wFwsnGbTTeBcQ3osPpqvW3AOi+0w01QfUW\nTfvwvhOnsRtotblGG+7CNRkaDY5uCTMuys35q0wMt2OaVReuMW4M/gxl4CDz\n0mDAAtsIxajw7zcHR1QY5qWtwrxnB89IUeWGVfQpjR2VylDqS9cU7eoXHFef\nh1q6n0RdQkgx6M00lS85/W/kFZHdm4yN2Di7IdZcIFQTlWiR9XvTSj7zhFC5\npTi7hwa9lZdse/FjDxIAjw0REozK1vVFyBEPWQXQXWOiOkhxKjyi6xD1K6+8\nj4VIco/1v6/Nx3VMp1yPCSWuahHYEfQnqWchTvCMfk3yUlyF5oBxoDBQyzah\n3fISqQa8atm7otphBdAnhjITrC+BSxM1p6feGi1WfKHFo4oV5VF4YtEs09tr\nwGZx4cgH/wHJh7xs1sSZ1omt7bkhYwJNHKnvBQxkG6IHLRYfd1fl48XV6tUB\nnzxt\r\n=rLia\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ7no7XQ5CV7V29q/jNoMScSjXaMTySkJD0awVOGrSWAIhAJuTM5NCQRqWBKYKVn1tS1Jf/w2Lk6JPudnH1TFrp5uA"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608112738_1623152117817_0.08640533816819107"},"_hasShrinkwrap":false},"2.2.1-main.20210608113121":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608113121","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"973cebb8e9e6b5bd9420e0bfa85ee4d597cb1b52","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608113121","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-KW8yPtHrxU626Itnj12yqKSCfOpP40cBZh2EmNvnAqkrqycqiFCZDUpi95unmQ25HIdT1u2x43wS7CqPIEUQvA==","shasum":"4430e20335d366d65284eef3578050d49ca04462","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608113121.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1ZmCRA9TVsSAnZWagAAZDIP/2V9788fWZCg5zRw78jL\nBU4RTLRBXkKk2RPqxadDGOUFM8gai171cw7aWDDP4hSIpcv2UVxz0JLO2tSJ\nDituB1v/3NND37YugXdjLHbYIcBu+0dYW9RzTs/yLr4mduidtRMv5eMv0A33\nz9PcSPodqj+Twlwy/D9p+wBUfh7ZlGIiW/VETV79DamNSp1gJcUiGsIbFR4C\nYVnqbsinHyBU8VKmhAiX7lDC8nTP4qbbzJxLLvu1obLcglg567EwnlTF+euA\nTrHCMGKtC7WmgBFuBD2GlP0k/sIYoDkKwFo3Um5TU0ulMXW+xsq0eYbr/dxN\nv5IqVUrCWQ6D4EgE5vhslQIY7Hen2bHZWpxW0j4OC1jDAKhFaMJaqFet8yAJ\n1Ytk9Q+XTUl0Rpvasq5yjWfS02fmVPMAIPovccEJVlf9AMHnB2+mDacxV4Em\n2WPYntrQNJnW4oa72/yLy5SMnEtIuw+pvrdUnyXp06nLoP9/2Iud4HjJ9UM5\n79R+Bp8t56i8n1LQk57b12xRFXgxBnWrheGM2d0rxCDNzpwrcTVC+bgeNuzL\nwaN8OUAG/qMyxN/pk4dCKa/rwKNDrlYi9Q5yeWLgRgSC+FRhfc2MUbYyhjOa\nBz1EXgCsuTGvNjv4gP8xNXKPHnouubE3NY2FymsERltOGXClwmCNDIN8NCeg\nmFSY\r\n=Jh0H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkRok1yc6VRylnx2VNGxoqLkjK35H88dgNDjORvV7/ggIhAKEu4SCQWbgVISzXQ3nCvKGmfSHjq/spEZjzfTTjC1tv"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608113121_1623152229843_0.6922506275785569"},"_hasShrinkwrap":false},"2.2.1-main.20210608113436":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608113436","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"dbbb1be6d09eda3e83f55b8064df722574027655","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608113436","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ivtoXMdhp2j7GX1ygetnsmYQZ5EqSAhK3alwmLIGdmJg5bbAUtZHP+x9F9wzDT1ATwj2bXlRovxaBxJ0CMItAg==","shasum":"a13e933fcea2cd7b70e753669bce88257afe8ac0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608113436.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1dlCRA9TVsSAnZWagAAfXkP/imWoPsEMsfnWAg74ep/\no3zFXmVCrrmKSUfmXNpxXj8j247D2k/Vc6em1Mtf4m+ob1jKwevg3Lm45vcn\nSC3xSz3rhXGn1XDzO5fyUDnFgdqYSg1CYgQPun4GavoXG/EN5q68yb1BrJno\n1Ewep3j/r5Y5hVgJaMyNMVmIiXag5NOqnuG8RSNLOfsjqotYiTKEZHGzT57S\nDTPpH1xuVTAVNJr/0l3rXUbNruh+JL70r4n37dderbkh4i471UXml0/UTHbC\nGvpYPzRvcnjSEgIohtjXQs7PNg3ppmew0v2QVekkXkIOOdvlmXCrpIhOmYT/\npil3PO15w/kDfj9ITDXl0IMcf2/t+C26PPyIBxzlvZ2tIgMaCY6KKuiJnvms\n7BrIV9I885YI2vYqR8Js4sUxDO7iMuQW9sWRsL2Id64MOOHFDUPi914KUlQz\ny/mI+cWflqaXzpWIbXY6npYwkDuaZ+4L5A0avNqlzWaLx6TcxUvlecAiPY68\n4qaCYAQ/9vpfxFfz6VLDEXmN2QBwecjrsIj3gwU3uSXJ1ca44SXKNltPRXke\nTpNg5NtEljUdqp7Gr6bW8NqFDTHTpXZ+Z4dV0flTMxXMNUoIso62GDNJGh5L\nTjzrTvd5pXPeZNT6GHKdYa71v7eu1WJWhql8ceiF3bYgm3sZzs8CvS7539hz\nImzL\r\n=idbr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsuxaxaIMyVjLQe8ziCZY+OzOHzlb6fNgYHWZPZZCz5AiAgBtapT8sN/1ep4FwzMQfB6OXj794nwlXBHqOqyt7FxQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608113436_1623152485067_0.9883046678450504"},"_hasShrinkwrap":false},"2.2.1-main.20210608113437":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608113437","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"0c05104667e375bd08fc3977bbf68154ced286a4","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608113437","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4GOcFMpixRuUzDSNS5LEJ/mNphSx7yEXVHtILpukz3i+Z7Toi9g4sLp1F9BQdF3WjpA5f/UrJt5iVXt6byowgA==","shasum":"17017455287fcb2e5fcf8b5a49be61c4fec0bb92","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608113437.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1gACRA9TVsSAnZWagAAvKoP/3hV43ntLZMAdmVkEERl\no5JvnH6GNPatrGwt6qj7cWf0HpPeDMfb9MZYuj1+hXUXnJHIwNtfMFy/6W49\nQK6iHYCeOcQzaWM4repJ0+2ZjkqsnE/XeRebaFEK04jizcE7rCWYs+sdJR60\nTMNzms2kZjR2AJw4imvaocf3AyDSB8tdt6p66C+JlVTUOANyP4u3S8uzsnJ7\ne1B2ehqf6E7dE6cPFSoE1fMt3/xZ4jxqdY8P8CNBSIqoCJ8GI6zQuhjXsnCr\nvYdyXjleA+ltIdjX0MwlzBXtTMn7GAS0WBkCugyRejSORlDh2CctODNgQDKY\ndsX4fU98S6pd7k0ivlk48M1TgU6VqWytABKW5SMpZZH5hwXNY71ifV1/jazC\notPcojD0BEc1peuryoqXssCQNz29QWLOFBlzvb2FoGdiTRt26bWpzOMqwGMG\nWH/jzmkDrnlSz4z0C+LhTe/2FT3GmWQkD2veGSDbMsLI6scz2TcuxAxFe4Sk\nV/hRysy7hE1XEa3KxWHcySoLb7upZkSHWPr6dobqUkXRiX/OOjp28ciAN3pr\nobnELLaV+QdLImIWTc+Z9wdz2gCVSzLkttTVnFijA76jheQwtHBjUtdbsQyI\n/O8D8MY3Ulit7kFJIx4/DuagwUXWAtxNRUgR7BQ4qQi9KxFZkgGWb/MiePQC\nFpie\r\n=DspK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/3cyNI57C6C4oL0dJX5fNpw6ld6vJgRFzC8/FVbVmdAIhALP1SAtZSq3pAo7gli0fE/9C8XLELSdWj3DSJ8h47vH1"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608113437_1623152640158_0.5933622186025407"},"_hasShrinkwrap":false},"2.2.1-main.20210608114013":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114013","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"f5a3c671552f9f0cbe6cd73eab0270a825e7658e","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114013","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Aw0xbAKB3evvLlZUt1xN8WRRu58Y1RyOq43FH/XJVJyIIcTZcsEUKDFTikErdQLANJg0qVmLt1okAicyr7MxOA==","shasum":"7b9acf60cee189a9b866506b3d05336aa75f7e90","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114013.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1g4CRA9TVsSAnZWagAAzaIP/15IODg3NsUa0cwbDz6q\nOHtFtvhoCJ/ieLvBETpUaS104GfwtC8yx5LMMGjNkuQu3TX+pxYqQjp2bctL\nSeNdsDp8Jh5UC2gYvTZNkOjxXopppdSF49tHtZS56Obs0R16gRVhLJm9o9/w\nkMZHj1bNr/Rmmg4oYQkEjEaJ6vQFh7BDxcjz08yomliGX1vue4h+s6ItH9nQ\nBS3qSSO/e18tRRcYUBM1bc2tTMmOBkuMub3ItB7hzxGASJInp566z0eUvcDl\nL+bHxNBje6+K2C5DUNxELTBFuCGU+rx3V0Qaju8rB9saqG9ct5lQYTZ1WPXg\n3xn1PvdJab5cdfyV1wYGZsuCXnxERMvh6D1kzg8Stb2vcEMdyrpxdowwoSz2\nF0a7zG/K5/UhiclENNwC5+CB12sjmdIiDbbCsEG1JvburX8RVkRFgMrtAaqK\nnu1lZKei3I2Js42dbfaFW2cRFabXUjXWR6OZ1usPdL3QgTQSRc813bK1LOKk\nqbWkXyhJMAlUWKpm9X/CmAQqdnKZSYXJsakukLSHXfP67oGRYW2IlQbUqaHz\nPi95xM4HRagSO4/CCktxM9H3/33dtrKVcXJKDv1gHcOKSdSyvWPhv1GlLICs\nIozYQ9CQjIyoLugpgHsJLZpKCmGz35nDk5vnQYXgCVLFOUDTolUwTZUonbcC\nVLUU\r\n=UUuc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEjTL/zgionJmCdSXsgnmu9rrpTkuMyB/w20WiRIrz3zAiEAh8L9/Wt4uCZ56SagxT0izDNex3+RfdRcNqEY1ss5s0o="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114013_1623152696418_0.19832860594834578"},"_hasShrinkwrap":false},"2.2.1-main.20210608114014":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114014","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ced1fa4b4e006bac9a17ec33f0cd4e63a696ccbf","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114014","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-qkECMhZL9cf8nOJi0UT9SAT+T55dF1CcDAbRvk7FTZ0z7y8B7IWxoG3GAi2ODQcDc1CjseoPe23nZYfHNhiVsw==","shasum":"4f5cbf5d8e926a86912656c45c14fa354e52522a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114014.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1ixCRA9TVsSAnZWagAACc0QAIt35WP9R8evwf0ZDPVN\nJk9EtFMiIgwlT4DdFm3F3A5aROr3QiayPNUoZQ7sIdKg6dUGNX6ocot1pXv6\nHfMBcj485TNEgKRyFHFF3cqoZnRoQaWODobfcAa5EQ9QJbmVUEOknYosuRop\n/Zl6OCdadYsb8O19SWekMoxeGDvSG9Ce+hQ8GzMqxY+HgzVi8n7dxAnevwvw\nVVaicUxA7My9YNXwinzPyNI9VuSW3yhNfmIlGwGc7koQY+FhhOlvQZ6W99hX\nO5YCaw8Y7e1DsGGGyo2oaCvMp6xN/3QiazIoDDW67zQiu4tREhYEgptyLzfh\nms2umdUkqnRUSf9V8QVHQF2IDtW06+dX0NugMp5vxS5mF6m2a8GopRjOx/rH\nhxaeTVFT612Iv8Jnoo3chWMljCqq8wyr0FulMa8kmBG9Mh/ck27FkBRZEeBd\nsdMtrVL47tyjoz/KXNtOv2bkTmgE9MBBZxuddSzekidHSQbHbUiv250J1mOC\nYu5IXHT7xBKlIqmrC2YIlf64Zl3NutmMCV0YmxYny5UOBLSOzx5WVVjeYx8W\nQpgo2tfYNzp+Cpn0jzDClM0Rw99xP5AkpU+UxosnsgBv3TdBQYQ6G3sKeeYk\naYiW0Dc7oiaau0oEWIjN44V+TzFDSQGzoEmd7LwK/3EXWNImj8yHocMtgS3v\noCWD\r\n=o4w4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKDI3J07ndhORovFakKqlJWq6TiqWFT5PprJmxmF1E3wIgV1oNbIc+xlWpcZ7T2XddoMtdRf08ZGkDBj2KPuUvRSY="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114014_1623152817106_0.03872309982215838"},"_hasShrinkwrap":false},"2.2.1-main.20210608114332":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114332","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"805cf5eb710b133144dd855cc527afc26f6042e4","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114332","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4uvfOyDPtvFKgN0YgOCeWiNq8DQijGrWWZ2sOYIY8LaicGb0QJRjiL726Qrp9g+hE8aWkPNvKCH9E9rqdRzyDw==","shasum":"4cd0d1b33080793fa41d5bece73e1d17d56f41eb","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114332.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1kqCRA9TVsSAnZWagAAozAP/17BMmVzcZg+c/fxjFMO\nuMQwZe9VuUlNcxCylgsoTG6p3K/s2B3W1FhQr85Dg7AyKksJelmDT5/UPYOt\nimqCADbaJNVYLrw5yAebT9GBUr8HyDq6VCuI2qe9QVrG0HRlpCi7oy0YpGqi\n2LS0XlQjY9Gd3VEhodfU7dtc12YWrobe1PaXTxEiww1kVxOb4c0F+Rul/4zz\nRp+DohWZlZq+XIwZ4sotxB1n/4FG53V6ji8lw4joqtEyWBh31SkXFBUJMHG/\n7h7atFZ3DyVUfhD7rDybPgfY4mSpNPDKvDQzJk+dMsUnJrSbBIlA6MRyfdrJ\nm37VRwc+btRoGRKqChcAeXWncYqK3YIEOasIqmScXWkCMnJiMo8W3z16QRy0\neWcaurELyeES4NDQtHjMRomnEk9R1YZlXstt124Mw1zK36WpVQYDoH/Yqf/0\n/WxWTiQTJGkeBqrRXwopkdAfFAwsDq2icmi2opXILNoS/d+izCvjTNeqD1+V\n/qwLgK0TCp4G/gqrAEV9tJkQTJzD3OEYIsxx+XSIiPyEIjLFuKszByP4mZnj\nvrSmcGjzAf+3numTiyy2wcQKXQ3Rr5tmUK9h78hXwshjm8yY8BabYX4NWWk2\nmq/+onxZhZcWx3fgvAkO5fyEeDpvVGZ05lrSJ92uDcc5/xjBE+78f9haEfZL\nRrd2\r\n=b+G5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBbpYr1CMiPHaUHh5x6nkF6+1z/fQe2sAit3m4xqEJ7AAiApHSaNnOoFi8yEhStqxNu8CdRTfm9Z6SCf6vYxDCdY/Q=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114332_1623152938639_0.3613054947886192"},"_hasShrinkwrap":false},"2.2.1-main.20210608114634":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114634","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"0f608812382fca6bbc690e15321d627dcb76dc1d","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114634","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-gaQcwsW7KxM2HoXerGZ0S9Qhys26c4ohsEOb9F1AqY3f8ne+M7g5S6zqZB8x38ZmaZ6nGbPWfaBCBBhOeJdamQ==","shasum":"e43ae3641e3adab57e1abb9e3dc3415b9fdc1c7c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114634.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1nvCRA9TVsSAnZWagAADv8QAKA6QT9vAUsjbwhSQ1lv\nn6AhexD0k74xlBovgWc8PE0ZSLC5XwOLG9lhesxxiAPV3BiH44MsBIWx82JH\nzroMEQ2rb/EwszcPOLPxTivBHDNeARpXswwrj03Rsqgu6Oc9X4tHck5qcbJl\n8wwPEA/AoggPLExixDQOdZMO4Ms+J5KYR3GdEVR1RQNexSPlXGBMWsLAoiz6\nr7ESLxsppeD14mEH5ckH04uSHydinu3PsBCawV6k4v4R8b64fjwZweDrKfUp\ni6MKghfne5x5WpCYboYClS9eea14Nx4HRcoX/wEiFgPMheB3gou8yETHf/g6\nUwPANbc1EvsnXK5fNUyIaemI3u3c5YaBYuE52TDYCZba4Rsg3HmNBWi88QTN\nhwDUg1U+g2zE9S4tCMflaoWHmAbwo/nVbLl59icE4BV4i6nbke04IMVek6U5\n80xjcy9Q4xHm2UEMG1eI5TEPy5pjOqAcFPLGnyerLLq9v6N59KLf2pyz2D6L\nVphxuoYQ+ysMeI2m+X+ETOaLOm67T2yEv6cBeZvVdGe0q/fEpE+jn+ALMLQV\nDBZpcn3rMECTqg0aHPtS/ulgngx8s+ru1gcvI6vicc+/YlUB+CztS24QHgdj\n45HII3J81e/hvnXJgKEcVS2QOLFQwuicgoWUU2h6ZCdleK+WA7bbIq7Khb3o\nxeNC\r\n=TAeW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAi8Oy7kqCBvN/ACaQkYlFgGJnThbrX1iaEiVm4u+uWQIgD0E/sDduXjA28MDnb4Py3nQipZCfBR1GEDgVnTnkVRU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114634_1623153135138_0.20514853402761646"},"_hasShrinkwrap":false},"2.2.1-main.20210608114635":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114635","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"941539023a1783288a5c0fe266da8026f898e3c3","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114635","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-y42rbZD/9RsryfhNLLbPt/9saYRaVGCeVOC8A5Uu4dNDBoCumDKTQE24VClEAY6edkyWlAL8VFKjuoEG72jLYg==","shasum":"97e9cf1580052260e5242300dc2ac75bc9a4a292","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114635.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1pqCRA9TVsSAnZWagAAmb0QAIQlq3AKMIW23OK5ktcZ\nRA/7BGjSC+OIaljl8ZxKh3EJbS9HheHV2B7S136BES/Oy1rjKK+1D4BsIgBo\nvUBrO/hD1jFXABSh3Mc4qWMbl2LBKEsgDSqTcDwSH2oGTnFVYRAIuyNI8L4i\ng7H+g+RqjvDBquKQzQvtnh5g375vbZc0MoNRvG0SjPvbE2KnkS9YAYwqIpVm\nK4MnSQEixbfE+6O+9OLTA8F+K+eptNfTrYEIRajpfmWsjo4HqfMEzgqU9P5L\nND6RmZ0SoHXNcPIEUR2i5+KsTZ/MNKLC1HqSdk0ORCtePLKfpu7y1A9mkCTz\nTNh0N7yUW5iKHI2Sb84NzZRFw+SOAf3EUeOsKv2tK0w9MohlKyQPDEFvc2yh\nm48SNMmQAYsi1+sFojl1MyHnF6b8vc/JE24Cpo3UlTRw9TNxlortAW53HNPn\ntVEY1JD2/H5q+JFNCfF+UMqIbCZ5o20lhhkXDIgj4EncOdVhh4UXKVY6ZeyM\n4MVAWEiRaDlCFa9jnvsXUjnZ/X+qbdRivQZE1UpPNiufaO0na4KsAfth++Db\nZgiIRG23dD7Mo8JcTmwDwJfERqO3VMslzLDPSAoABobGDl1D64qHjsI4oZ2I\nbGqaJbxmTJiVRjiiC3E6hunhJO5BptM6XITlWhXbpugPRmKT9vxsvnFgMoYi\nnovD\r\n=nLh6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBGnm98jlTqC+eOjiLbUj0QEw5sqF7X2P8eeOJ+HqcbwIhAPcec9gOt/YdY4YpdjpEbR/6sB5ha6DVM/tx/EDAShUV"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114635_1623153257783_0.028184210608275917"},"_hasShrinkwrap":false},"2.2.1-main.20210608114944":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608114944","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"57aa476d576c72c50a2c2da258e203bb1d3b7ced","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608114944","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4hzCjtmKI6EvSzkETxQbwATwD5kSK65fxMRcECU0Z1KCWLXi8Gss9G5Kp45qfj8qdUH6UG1aTbKGxDaBeLD4rQ==","shasum":"502b9fe2e39fc01450170865a895b72facfc2b6d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608114944.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1smCRA9TVsSAnZWagAAP+gP/AlbEeEbSMHET+R455WI\nYHxPykCAgPiA6UEy2Nxj5yu6v0kXHOwY2yf+WDrgrhAk5P9mK69rcpI7Wohc\nNjM4OHhA/LUcZ5uS1UBjalQVMj6Z9OJfo67S/oLGNe1wZQ8H/RVxWdpEfvCf\naAuG16Sm4JbrPQi2j5P8UxQWI6L7lHmbaZN7dNcnXxEUQOzT35/lwcFKQk1c\nySBfgzyCCH2/tkphITBXnAEKp+IUEGOBr0ulvQ+ItHRNnHa18E2XRJRHxkae\nAF8VP33YOew+SaEdUJZ73l8Ar2nrs9exQZYzo6/FvLg0EtehxcCHLeioHRge\nMFGaX2f/0VrApA/74JrQG2oObJwVCKilciu/mdOWA7RpwhQwNWexIduofa5E\n4wiLviqnrd+tMa+ah8F76gTOL0duerS6nRiaSWyLo1cW5QqhOwEpvI8tfcE6\nul7hks8dut8X0/bgYjlG5k0X7CTR3bZghN0pY3BOLiDvxB39PlY7l0PjtkAI\noT15r3PKru8jXlzvGoEHxL+tw9Hqnmal81lHA9Ox1KTa8CLsFooI+lhuZmv1\nHbLV1VVBqaRIoRbZMv5swFaScjFXgvc0d4t2fmVMRYFtJe/EC8F3UG9FoSnG\n0wVwtCmJN1IJe3rz4L0PPg9VOyedy7rvplu8jT6otmDDkLBRC8TSn62d8YT7\n+kyR\r\n=N097\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWmrZ4Wedd58MPWWfJLSlDzuoQ0w4XUms1byZZk3B6HAiAA4IumShSLNZG/79O9t3GTp582vkE+BeYKKj81Ti6t/A=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608114944_1623153446210_0.6997450031378287"},"_hasShrinkwrap":false},"2.2.1-main.20210608115714":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608115714","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"03701102d8b01fab31c683d4fd8e3d293f8fd547","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608115714","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-sdkkDPBLT9KicS0KJ6fk98m4Nkyisj14PEz27eNm9Adfh0FL29jgJ6MQmtul+ef0LjmXl94rrMnVit8EkxG1YQ==","shasum":"0f92ade5c6964a4224ccfb24238958c428d31858","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608115714.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv1yECRA9TVsSAnZWagAAO8sQAJs6mb31/qcmG7Sl2gMF\n4+9+CtfIlFNl22gZRLfm3qBCJ9a9Zbqa1l5SGjrKRv0CgBHRPRBYy6SIA/sl\nXcr2Xq+mKjmL6o39GDWmrbIoH3pZPras8nEIlyDu90Yu33RfUjcW7Kf/M4Nj\nx+0hbQf/Vz1zcibpZyrR+vHl0TCWcBA42OlJlfphQLTMik7p4lF3JczZ2ezT\nAs9OeRbOaFI6avOIAiloPVCypF3mv32Ri7xXqpmdYh0FMlitOchdCq/2va93\ntdDJopyLInbaHSoruzC2Z2GymxtWTrQQg4mBzutwkZ7scKWQza1VvtBlnBcb\nxTbg/+zqSjleuxoWn9iDbHo807OPK8cGIgiQMDLid9nPgJmvLgUWplmr9pDx\n7Y5442xLdJXicrKkquA1s/NQnABdpRUY4hWFC1zsyMBrWUa4VDWmRF/Xmjke\niSIvN7muLiR1ttHgN8tLWXJ2uOPwSW91m2E6f1kjItYxewte/Vh6zitCTbUv\nefjnXxdpV8DYGVdZ6nWeyfH8ezL/byksdWRJZ5AwBT7ikeskZwUdf5R/qWBz\nrIPmQuIuOgtZ4YIlyXXeqUZrcAVTUzrjxokLJL3SsOm2a4A8hEO8ipxDyMmX\nFftMnOEZuD/ZZZtuy0GCGYOsVOqfj0CBBJAPw8ODOjPmQ4U1HsHI9LiwTFt1\nmiXi\r\n=r+LM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYzGuVpWiq6acaRVGDJBKtRY9Fsoncpjxrr+Q3S7mwpAiBFfi0e4nHnlxS8hPf97Nub9zgXbKZK6+Xf7L+kYCWXuw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608115714_1623153795956_0.7227829769953045"},"_hasShrinkwrap":false},"2.2.1-main.20210608115715":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608115715","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"46d8edf1558f622307a27f136b97f2c8cdeb78ac","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608115715","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Qk0H7fL9IoBg3rLFVcmVF6R+ti8zDGxvADP098G63JMbT3quvOhn7HazekeH4JzrlZTKkY7dALMp+/w1xXEiWQ==","shasum":"d871bc1326ba3a71ac7920aa3fd7e6d4fa3ba410","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608115715.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv11SCRA9TVsSAnZWagAAp7EP/0hOLz4zTTWUUbM+Tzv2\n8dnOAfbIAfcSroZzSc2jds5nCNnz3m6KAPf5eme2GbKRAzEITC51WDz9Bxb5\n3binW5URVCSsUkvpxPYTkfvZOZCOh/4lJIscFM5UbnPUkp7iHhP4d7Ee30ql\n1vuTgT5iNRLdO4E1uyV6JBmi5aoC6yWWj8jZxzLoTskJVKRDNKXBVoSuuLKw\nIPvaHBux/3bbwHZWWEKHXF596RAg3lZmF2qMSwUpN+IH+v9s8RB76KrIL+0i\n1fbtwHlCu13OZuQbS3Uxn6aiusa1d+0rO5msjpPvISUMlBdEf0oqOgOwTpb9\nSZKCL/JA4W0qXTvKMO3kWegPgM6iOvRs2hT3OikdUOzewSqjBEmt+gGbB5E5\nyfh3HU/SBswjgsnQMuwIQpy4XDq4WpqUdhvJ2TAfCVaeymq+nlWjzhtnaMBN\nDHTi9uZ6i2bgU6Du1aOxkQU8SDpVZkq+kJf0gM9xtw8devSRUzxHgmuOdoWc\nASGJl8SIkF14Mz33HB5z7Ij26Lj544FySn0a6OVEFhH27uUtT1q4HOeL35Qo\nXJSIzmcU7qXRwMV4n3utSOkWMBeHjlkaaObrXzSCuLaPoKG9ZhMkFdxLYWO+\nu5FHayneyNg3qT+5B5SGxKTsaTxn9mVEh2jpnq4IxywlIrrQ8Zn0i7wBzL4Q\nDRRW\r\n=Ujid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE74/XRGcDRSPDxVKPRVQGmR7e3X+lbvFLaj1nDxOt/ZAiB0w0rs6Yu3v0rfrD94WzKWp7Z4rB14SjCbYQO3vmrmjw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608115715_1623154001977_0.23464572208653234"},"_hasShrinkwrap":false},"2.2.1-main.20210608115716":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608115716","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"4d4200f662d0d901d6f69f94703229c37dc3e256","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608115716","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-dA05BxxPzg30iMzCdSvHkQS6TAHRcSlpegjyQ0l3bENCpf+a6xxGWm6QZ/LCLkyacp+JIH7Eq8juCrjMN7PLUw==","shasum":"6f9bfb7eaa8499bcf6bd9c531252c78673ebaa69","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608115716.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv13qCRA9TVsSAnZWagAACQkQAIQ/G5EGgAgjKPViBDVn\nnucDhj7kPhUR0E4GA+U78O4/yWLzXShdznRsF4C+ZRFTkUgLUF2bJi9h9WU0\nIfIXjcw+F+0b7RDRPTm4shQpFrMZO1oL6BIs9Fn+ZE2RSkIZIauPVmF4jOdL\nwWbnS8ZeGcipgRxbF4N3P90RrX790wq/YYwImNTO533MHxGoWZzaAVGFRk3K\nv9N3cjZZqeozR+U8OfY9S+uUJN/6/ga6HPa/C7b9prrim0ZuPS9Gk58ZmOGj\nZZQFo9IpBRGi5TTXeqn4WK1ahPkBx3KmIhk8n3RDjRMXdRd8taoCQ+iq0hFb\nAds+Q6e0puku1bZB2hF+1WfLI+q2cZKQae9EzujNwkvoyX2oJsnAz70RHTsG\nV9jdMZiKw0GSsfDy/TRfmSXJQKK5GhcUlF983VkcKXwqUjiAJ7K9ynNHdHmf\ngZdqBMkk+VvE7LqrY6N/m7XcZIoT4TFa9JafATYaj196CayJF11ZbK1EufPd\nQYrlRTTJHEvToHWfL0WTuNmKcCrNDCiBuTls2dSD1bCzfevGRUoDUQgXuQRb\nninv4YtM8DXTWWwOn9IQL6DmQzjzdBB9yWJZqNWIY0FQdwBpqlD2WlS+g9zf\nYtYehyW6SR022gmLRxfoMyXiHvdhMI0eke25bBk0+qO8y2cQ3a/JKUXM1UOq\nCN6x\r\n=t4CR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8EwcFab2wsNELc3cnJoxWrBkVuUIRjpV2YXUgSw4WmAIgCWFrrgFwHH8jNedO3/c7Md+zag0cY3Rwr0uLGdBCeLI="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608115716_1623154154614_0.7382734859974307"},"_hasShrinkwrap":false},"2.2.1-main.20210608115717":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608115717","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"9626d12416a844f381a173a4225fb136cd211870","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608115717","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4srWzGF6fEM8P7YApnDhYjxWIjid1drtrTjNmw4RZ6F5ZkPt4mDlGRKt+SJs9FmMHU7M6u46eY632Rc+8GBHUA==","shasum":"f5014ab5c80c3175b3e86be4b6e6a2e6f9afb6a1","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608115717.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv15nCRA9TVsSAnZWagAAwL0QAJjapNsFX73aeC1SLs9M\neBiI+xukK4hhYSkQsbLCIqdoRBGwrUN3WuST4Sgar+i8NxCtNEXyaK5/ShZl\nkaxpMYUyK78GWoFHaTcBoYNd/Id/3pJrGQ9gJdegoYisHyM7/LewRqQr0IL1\nv2fCiTH58K4byL+l/eZCKElwrhY5nTz1Royd7/UC4qzAz21EmZQm2FOqOfME\n15Si15y10zpfdmQgq2GPd8ouuKySlSpmDSQrB1eSXNmCQWrBZPm1UiNb4igi\nl4/jA7CDTCdDXJY4x1Ck1Y7CmMSqWodPNI9SEt+PcWCAtcicTkXEQwRlzO2N\nH0SRtojpjxN7bX0V/FnPuKw6Tuhd+Ht1icbobLdC9coUoSBbOrhhrssJW26r\ntAOIhaYnJ/j0RP6SnbJpjQLUW0xhGRSUGX8rEQvTrnxMfh8zUEZcqj96BWfN\nQbOckSj8w3jUxxet2t26fac52ppMy4NYA8YqhnoFvKyDikBj/URYv4lKylOu\nTkwwb00OVgKSJw4mTBz3lLH1FOJm015Z9Idcx9uGRO9AMjSO1jBRjSfMNQ3v\ndM/cDS6WCJe8RmxG6dVQGa3ismUC4L7LCUDE/2QSF8wFfydJDHnOH8RFAFcY\nF9rYEAdzeBFE7NvyIteZxSyLJ/D5H4BNDeNiVfrnacSADYXx1TN3Y9lWpTFW\nmNpu\r\n=i+J+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB68zU6Yf0TiCfSfJ/BECyeUWvuQF8iwvjfiFljmvgSwAiEA9t/Nrc6g7M/eJzPnWLnUy+qdyL6UW2DVcLJolDsNchU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608115717_1623154279570_0.44841210602505766"},"_hasShrinkwrap":false},"2.2.1-main.20210608120343":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608120343","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"4c56224c55214f732cc591074cca9c4d973862f6","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608120343","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8i1IjC3a89CnOp5Yo7LCvjOmL3nFyou9KDOFJWUmmBcBIXU654os7uyjqEH8niLJO4M7XT/cwm4YWCO9cf1ifA==","shasum":"1f1484147e46af71b4f57dc0336017633e50cb4c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608120343.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3a6CRA9TVsSAnZWagAApRgP/0nTF8/e5TX57bFyqXVn\n4084KM63lncg2+EgmK8trNzvy4M+lVgV7ueDKkswzAB3qKmIR02cYDF1fjEh\nt0dT8tbkdaUQhRPVbYN7gV+8x2CESwbF+15Gg+XQHo79sWyCLu4H4urEbldW\n1P9tpYuOndel4JRTi0XtfRWQxiPcLEMW1mMzPwMqiXMaLeggcdmDkcS/3MAB\nraQ61B7Oe6ziL90EPYDECIJ1AXOmw6nUctBm/5+sM9eG961rd6bkXaxqCy9Y\nv/Jb+2ZQdE6wGM03Nb+N6ozobuYsVJ+KW0byk8KgylLda1sF9zVV1wAmMlwy\nFcIbm3/4VBHGZOGuCmc3QFPw7Yqicr92WCzJVR+QCV/3UCCmIgALaXXYPxAD\nhG5ptnZba2R4DF/ofE0HJc2+vipOsI6ppqyhQpv+knbd7o0wqil9fpnUeEh9\n95XnFy0VO1yggwkmFFirp6EN+/mVjPB/3nNvPMtxbXbkWb2qpkQ1aPmL+m4r\ndNnlGJHTXvT3t2IVPm37exbO35PdX0VUbgam60fUcJ5KD2YCqa8Ma59iSA/H\nX48H3qT1Se/jdlhTStPkecgrMT+d+VJQXRdKca1tR3GsAT1Gnie82tu5n2Bd\nGU618oL3Wav1nLZI0fKYW2xzzVC23VndnRB9T88pC9RT8dgryRZ3odVkSrK0\nfXXf\r\n=gX8l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf3jZyq8JqCydPODq0BT1/99X02J8le5Gm4OR/ep0VugIhAPq2nSynpTMNDdyJMeZUf2zXalNJow0LZVMqoCSM7Kzn"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608120343_1623160506096_0.9498126325591667"},"_hasShrinkwrap":false},"2.2.1-main.20210608135037":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608135037","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"fca013c1947b22cac38858253d6537a898d9cc1f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608135037","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8vIWRZ4Se3s9Qi9q+RniV7jVTqx5nzIRCxFiAXgQOLjLRCWgzdAiZ1e/XAxJcK6alm5l9Q2EzopxjKSNZM5NFg==","shasum":"bb5af0f5d8ae8e58bc0ffa57ce5bb8189104c902","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608135037.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3dZCRA9TVsSAnZWagAArEEP/3PJe2ZN+hyu0VhtU1/S\nawRW+m2QsxORHuaRSpUY8XQ9jneunYIl7RDug6rzQyuOP+//y2g+/mMY1T5G\nLvLJX0Ohd68G8vccW6AFS1PFcNe29jlMR5Ey0uoc82cWThRai5V96f95QfDB\nHEVnN/ei31uzML1AxjEAW0DD71cb7IeK6Vt6R4f5Wxv5OdiouCoFqWuFlkXo\n7LXVzLH0dUiA8zmVTQvxHbgPPZgbDG8ul28CrlCH157DXOh3Iyxc87S7ozbc\ni+8X8/AMsmp2+DlJUMyWpsGjIIlRaymeM2sUoLadCzOEJ8cT6ehxsfzjXSWq\nALOIT5XvJ882eKTyOKNcahwwNdCvlVDSoSOW0qLWB6ZXmD6En0nH4zxPU8s1\nEfrszw3ki3umaTpG8AbHARWRdAVWBxf9HebsEReyShi/rOEPkP2amaTniCsT\n+G1avy4l5tQ0gkogLXrDpKeEAusdJaet3TmKkiJxBOsAsjFy5ZPoCxKzOjjj\ncaa5tplzUtO/uVgBzT3/ZoEnt7nIUplaCcxO9UzGwHvSaqCP1nt1qQgwNhxv\nQviA4t0Oo0f3GFQRrNlj/aSctvAVnvfk6meh76H9p0CXS1YdKrCjxChjKFxp\nFnS6O2Oi5GkpjjcjSilp2NoZLbEKcPy9IN8s6dnu3EsfZgO76f7zaIJN7LNM\ntvih\r\n=049O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfKQQOgcw+Mz018N0ZpqdWOKFgDVCBtZern3Tu7Rr/HgIhAMtHnZsooWpnLA+OcRRKPBrrPJlxMpLcCSghhEVjghRF"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608135037_1623160664763_0.2717101699507791"},"_hasShrinkwrap":false},"2.2.1-main.20210608135637":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608135637","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"eba71a8ebc6f04e9984e6ded6978eb80a5749fc5","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608135637","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ki/O6se78HsmpKCEOXilm19ttwJbbUTIauGPzXM95qKOqolGly7OV6lhoQJwy/6GBXN/QTnABN48JIazgHQOvw==","shasum":"4744aa93517d0d7a589e047caf0d82f8a0fc8c8d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608135637.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3mRCRA9TVsSAnZWagAADqoP/03N0DnXcdsDtB8r0bXA\nVIGmH6BSNvw8n7q1NPrGeobPHazjTeHOroQ9+GgigrL1AKd/gdnxnYXlFhiw\nCZ15ppIK2d4SUqg4gp9UzCI6N37WjhWV/iRfDS0FFyl4Nki04WzrVZ26CJxP\n5+lhQp4uFFEpsQ+v684G9tUr7qFRg4GKNsJPC0WvXpnYmuhVSw08UoAA3xeh\naAAhOvqbIucEpKeLUqFWpBlwhTlBEVaPHxxgXxtsbKM+vLg/AoJi8CI0Pc8N\n4RdUCeNvhNmZopeC3HHNcxDDper+t5jfgB+Y0N6EKZV/gPEb+UPLUUu+xG/v\n8MCwIohn5CtVDDWR4HJsLgm62YFgoioOsMcalybL0soKNcHL1oLu39fWjPYy\nlT59UztU8ho2fXtPUeH0Q8qYmD1yGNFNQ730tQ23YIcLwLcY6Qr4VlMZrRaP\nyhoiCOKTvXNcQf9HdvjJ5vYekMkdTVzRhvgLrrdhAaQPrF0DOqPrhJGB+b3h\nDasBprTpEQRpA9U5rKi2F2EqzFxwMkroYy/hp12J+q/WxvNwd6jMM3JZiZv8\nb9BidjvSemLPZx5eKKBtdS348U6glcAIww1H54FKF+3C8sJQQQr3HG8LHpXM\n9Qs5/edmi2Z6RMrvfJGPIkKUeFvskr0+wMS3E4E6agMFNGY+lzi/AGdVeQUy\ny9Wk\r\n=WufM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICdCdAEAUYzPzXDVYvaKTSX4mg3oYGirTFHSKBYDtbP2AiA7rfA1R8tTLbqggLgcd0sEQ9raSH2jWNiyRKSk3VE8Mw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608135637_1623161233754_0.6455457291189055"},"_hasShrinkwrap":false},"2.2.1-main.20210608140220":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608140220","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"50d6ceee9d6de2aec93a31943d1e06be47ca5986","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608140220","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-7njNqor0QkDfJ1Y+6fJ/0EL96tVIBfHEpMnT41JqmmcrQ1piigeb8TQmUEpd3mNN9wvvtVOehZPgLkI/X7eRcQ==","shasum":"3c116c2ead9b7d0eaaf90900088b7f88441310e0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608140220.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3njCRA9TVsSAnZWagAA0N8P/2ny3JEMHHuFOli5MEvz\ndT6gDGyUYCaIzS0uUyAkzuVuhEeBeeJmXSuEojUav7K+1g2C5DuZJyu2RqdM\nX0Galr52327bQZ9Of/J6YEUcvhNDxj+e4ZBg0RrAu05fiX0Yso6EdJiCdkRb\nEF9mCxIZkBZ3kPjSAJMAGh415S41TQy9hOZwiXGLSpz1LSLJ8yjJ3CcMmga4\ntSmPX0DHLIp42xdTsPyo8p/1nBaiWBLLNVj+/Uu6TfmRUEYL2hG0VFkVwozc\nFJKs2IAmbTw33oLRgIaTm66mWg+/1Gjvbiiz11DqtLVVazG3ChxAdaNj4N6L\nibY3MXaQ0Zn7yriuOaHF0UUk1Gmy3uxfzP9vKqZyHj925EH1INBV7o2J9Js2\nCRVpggQoZWYFCKMcerTjx3SbPIZcVcaw/OVAm7FS0GRMcvy1P1hw++ULOVHd\nzJanfku3uamUxtR8bw321igOjAgc0c3frREtkt8uRobhzceahHx3IdxBea/x\nuYOV4Ukw/6KukDTlNAPFbqBFy62nMIsOsTyps9cIYfoanFT3sSWpKiY3g1Vg\nXyVCdU/ZGrO4gn/4bj8j5kftf6/peBrJiWCMMDVioTaub3pksz9prBs57WPD\nF7sojH7Nj6mK560fgISNY7mlcy5Jlmm4T24Rw3/tZShlRoMzrwN1yU/Cmyxt\nIrIR\r\n=5t3d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBPRdoUVux54BVUSZ12CfFuVSNNC5SGjt3qrhQqPTinQIgZRA6OJ/QutuIgJKJVEYCL1OARwWYdlUGfYCy954u26M="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608140220_1623161315563_0.839551361952078"},"_hasShrinkwrap":false},"2.2.1-main.20210608140652":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608140652","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"637eeaa2b906e556e5643e2d396b99b52707e594","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608140652","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-1moNbWNQBGh59TAzCznEVy99f9vWm/lyr0/Lp7dzRJjKR1cEGmxYRFsTqLqdJ/UxJ/64KEFuP6ItdvySyZ550g==","shasum":"d439cd0096c3821bc5980b8279b79b66566aef70","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608140652.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3thCRA9TVsSAnZWagAAvpYP/RRv4XzNRS1ZmsmrO5Q7\neELJxavN3cUFEdhYA2ga6qxW40+HQ0J7dBYRxXpBX4xOKUcDioMhbFn/FMHB\nyJMfbLHTjjTckpGTDsDF8/+CzEMYMfyqfiTLF9QEdP2bog69qwNQ46R/nabL\ndx8h5g93zhUBsZis+VwVN2Wfb5p4bnbljJadnMsU50beGMXO0j78KecWVKO2\nB0H84MNZoAcD/SAPWa+HelKkUYpzIkQpUYEHSzEauKiMFV76IqC1ZhA+5urQ\nEiimjKPYtXil5ENoy40GyBR5rasTbxH8+VFtLsQmenY4u0+60pAK33Gykf0q\nKUpj7spyGBQAf1txDGZRMBEjN3DGRFZsU9fSQyGzg1ezK96GBgAPvl4b5M/D\nNp7fhvtwLnbXlW+Ln2WTBaY5kITIYRsi+SLm3ipkz5MJhOCYzCR6dkd5a2wp\nXCoC41srTdxWTtAe99LpYlp4PjkLJYuLjStBdXckl8SmqlV+Uo8C45YjkKq0\nEO+V2GyM5EPKH4/tV9NPY22JBNRJELTbyGQe/VdNBfoeBVwLiK3BpPh+s1u/\njW+CsB5a27Q40OYTNLlDO1RPg4wjwPt/bA1OkbZ4zNdPURM+lCdcV7aGHT83\nhwQDEWvZlKIuQ1JHbJIJwC7LqUm/M/bAW2Gf3lojMcqIIEB48aecIyBq9Px4\n7b/+\r\n=N3YE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF9Lq0/tNOgjJBhZUZ8nzJeMaVChcN6eyeyNUFwGp7rAIhAOOQRU+FyyJeVz+4L/g/Pu1itEvhGfX1S+BpeXTPlQlP"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608140652_1623161697651_0.5693071145101558"},"_hasShrinkwrap":false},"2.2.1-main.20210608140653":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608140653","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"35ea22d9bab3db4a0d9688c7e334f69f091a1ffe","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608140653","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-S/7i1kVZvizXfVvdmjC51DbvkPKwrJ6TlchLSp4rxI1iyO2Kbg+51GvR76KaMKpqPX9S2b4E6d8nqLab76Wd4g==","shasum":"e8ec248b16bd0d3efa4197eff95867078c63e68a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608140653.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3wLCRA9TVsSAnZWagAAV3MQAJI4wUCOsbinhkBDuMKs\nT2KDbwOR9ZvGsBN7kc1v0G0Sz2803jdH1dxu7pVcb7jJh60M3frkiFifqsdK\nqL8csjDc6IdqzNwLSPwa+GRESqWgGlhS7phiRctPXdx4ygh97o9oot2LLDhS\n/TBYYrrmrZDqXBa/67sfgPIbymdJvTDCbQDYoaoqcJBUWl8QEB1SitppDOxI\nOZsLW4TemgFt2Ca5HyEE1uLrGdDxqvsHvJxgIW2jtdpCzHJcoZ8wtY6zk6IL\ncp7wcElniGItJwcVJ5re7ATeGRNXTRfdrSO0T1y4fRar6AKKlDSmfoRmvRhK\n2py7ZxA5BkLjeLLYqSuXwdUq/N2fWDkRUfRU6m3A85dIdB0L8cAZlCchfP77\nPg/Pecg3HL5L75KSjhNDfbe9ipq5BfM71NznokXMZ6kPj5WKTbL+SOLedfGG\n1L/VnWaCYNDslNPEO0vEcrr63pMknyKVcZi+G4+tsaqfuR24iU3LCQndI5n4\n32sDvLVisrYfOHcD71jOo4oK+HsTmnia1Kkn9seL3GGDTms57ftxy/caUrMu\nnl+SxMTmJ3AJJhFoVJ7o3Vjp1cSYD6ks5M1aAn6FuIEITgy9SzyACU2ZtJso\nFO9Fm/hmKH74ifsWyxz5ucC8jKmxcbgceDkninoHBCOb0KhC4oQzBefgXtVa\nEFK0\r\n=s6H7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoXHi0ECkZGWLNmrZGGq1xIAiEQBOPDGzbAplEJY5mcwIhAPClv47EToJnbK5c4ukJnK/ieFFthV86E6TfhZtW6gW/"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608140653_1623161867131_0.9516916354873326"},"_hasShrinkwrap":false},"2.2.1-main.20210608141323":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608141323","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"48c77bf95e7d88a667270e420efa3fb64f04fe99","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608141323","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Iuew11eDl0TiJn3izOyHl1zLSLJ5BGQTcAo3/kH+HHd1tK5ionSZshF3Kr4Va942R0FLjWkxODZ93dYeMkRRnQ==","shasum":"9b23ceab3d2274abdeaa0b497af06c4d681a6ed5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608141323.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3xECRA9TVsSAnZWagAAsZoP/2psASBKYV4I784Ci57C\n+bwItKbb5cKE56qK/Fp5BwKWU/LCkVAnV/sCAhYJbcyzUb47dug+rrMirjco\nxY4QW5Y4dZ2RHHLUbNxCAx2IsgsmTWSdqR32j/VtKhfAfo7ipCk8vanMmSHm\nDGKUfYls9MYtuJJKm85TVPJlT1lS85jV+rgeJT3Fr6kHFdSywsrBy2/vau3x\nmPAfcPHDAET5mK9G4aS6JDid4irWfgYpqVVhoFd7xG7rErPSLzEUnLxjYPR3\n2dwzfjxu4kRtcPCuUNhcXP88uQ8v1Yg7l6BJv7uEr4/GL8pMXeJcHdPvzad9\ngBV3uCQ4Cri7DLKK3cimQ26tmHsd7Zira8ruHJ/qA1v0/MSWpsdze7yPI/HI\nUclEu8As7tfFwK5R/XGBiyVg35CRtFZj04C0ksBAk7wBecYgLxjML8dqjePT\nA8LZqi3eRDG9WIK7crX5eKxxoZeJyInuEbNJLqCENOB1NVoyFS8u39Olk0qz\ndy6DuP+cyq0196bhyDXlOHaEb+uSIrfZy2qnDPprRRvrA/S5Sr82SwyDki3e\na8rD3GlyuuJiPa70jZpr6zJVD7jJ02+cOsa6QkpVo3FSvdZ10HPdSEukFn+9\nojtUuRb2x/yhSMrmJIfUVbSfvGLoQuVvxnQVH6MqI4iJ8QAxvMLmuuxrfxfU\nHf5g\r\n=+Prc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDNYFE7EXJvWFgzYvDohljtc14H9GqcPrc0j4aVJ8M83AiEAunFIXXdrQO8vLghync2ORQ1NNMYp0EcBscZBXjAL1Ds="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608141323_1623161924199_0.054155060355109974"},"_hasShrinkwrap":false},"2.2.1-main.20210608141324":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608141324","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"2b99ff60ccfae99853da593a7cfbac95265756b8","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608141324","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-jkqYfzBVadY4O8SHV+VD5hwuHEF6eFAupdFZjoa/bURqu374WiDxMIwM7oNDC4z1o1ALk3MOII/OXPq1ey7YSQ==","shasum":"81f82bd3b98b681a0e0c17e1efe0d7482a7b0ac3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608141324.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv30uCRA9TVsSAnZWagAAcPAP/jAABcO4WbrJkkg02K5T\ntTINhbo14XRaMOCgDVJW/H+KYlJlg4kiF6eUCzS6tPLeczuSsz44Dz53h/cn\naSae7J1HjrMmxTxCaq613GnwtkhqdZk4DGCam/l0W6W4qGU7BK15oG3S04EM\ngXRGBmdVttTOp8+x10g8mBWh8m9CGSWjU0is9JVBnfqO7aPK3A9EQcL+eAB8\nKEPUxAf+F8UZoEbaM5s+t/Pi9BytHEC5kwFVmdDZ317c34fAIaRMmh0q8iue\nuxXhSBbvatp513mMc3q58x2xvzcDFIB1ci7siPIZeDFA0b1UBYRX1hzzZVyG\nqgN3TqHNUiwXLQZ69cUiK6ID3szcYVllPYaiPad6cg/sCbhsDUvTp5aH94rw\nnMtUUezDT6heARvdo0S+28Q4KGm3GjM62pozhf96OnKCgC/TXybl+hFHcFy8\nJWX0uqIg3lNM4gQpDaRAT8QCM0QjHi3eVqC6C+CGyLfptYjSFLRwRa2ZzZwd\nDI/UW1ARWfUIbVPgEXLmrBLSmj5QsEgzHS+ek0LjaNt1lt4Dw81Q5cdZRwmh\ndkOe0aCjHn8Ikzl9igxxhQW6T2mghkiLkltXF2qBAMpG4iwcO/AEfEWTwdX7\nLwpe/Hfv15Qjng0s1bGfiBJCRRQtVLL0GacaqEKEJL9h2FzEAqatFsebeWNR\nB31k\r\n=ZnE1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFXaAPEPXGMeDfmHv7FUCsiFYzEwJ1fn3igHDZ6erdcwIgA/R8cr3aUK6imGmkeGV7AwbGTETsxA3QC3hgtS1JCQs="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608141324_1623162158470_0.8879851016301492"},"_hasShrinkwrap":false},"2.2.1-main.20210608141915":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608141915","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"570f482336cb6986baebeaef25970450efb45e5d","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608141915","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-nLJJx9+o40fsUJMuwu5yO2S9ct7I1gPxr5RCG+W6I5yWXvagp3yM7Fj3Ch82N6DGvWALxBRWo/+uo9uhwgxDIg==","shasum":"a7c37cdee4663164cc40339fc8b1607a568265d5","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608141915.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv33ACRA9TVsSAnZWagAAUZIP/iAJkeW33rbQIku0RdY9\nFEOrvDDr5wv6RXVj9zZwUuC73YO1O2kc0z1ctkqgx6XTymVmwiKU7MXqOhzJ\nzN8Ap/6zECOX5+e7KJqRt7+5PJfcMjGxVKLslb/A2xX8UFIev+vbC33B8IiW\nzz8l73+PouLAXULR46QB4k6bL1Fh3nkFrrLZz0amJGtT1XjjruPE3JUTZVVM\nF/mQEapMdFTlNA4nJdFyaB386yp+EJVQaZso1+Zs43oWaLDF3sGJWWl2786Q\nQSMw/5Q2UG6AGPJuhE0FyfSwZHkCtwSvwGtSUzIp5fIabyuZHmJllih7/vug\nIoyoNLcTvwK5KPF+30ZBG8w0X2TiD+skgPm/mfcgJ4Io0EWuzznleYmtZ3nv\naeF4RW1jurwmEmLO2rDiUHfoHP/bj4uFch6LwbPMQxWE4ywsWdcoWqcR/osA\ncpTRjqjQXnPIgNKboLh/mIKXBbBsUxws+JHFE/PZDJb5t6su2R8YbOHJR38X\nZkDH/KcsJfkGOwgtmcFwl50TPZJ4NollvhCOAiwOPdRTq7tRBECpYj98Ix/l\nQtUcmvfqNcc+RIPGxnDa+yQQGMdgjiD+3Bde0lX2+PAxuLUklB4vl1NXdfPm\nZDsMywBpaXcPwXOFbyHdpev1asMF4d3U7l6nLXDPCiJlz6oBaf4/nInYB1/j\nPLKy\r\n=wdWi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiG22DnNuvXZC1U5yKROsS+eK9BBQrnbuZR52IboNzZAiBL+Mqfh0IR1Toh7B/VqtzPksi1y0rzfrgu+CyLM5PBUA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608141915_1623162304184_0.3701542910453086"},"_hasShrinkwrap":false},"2.2.1-main.20210608142114":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142114","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"22377d5f8f2b721ba085fba06bc4669e1a7c3e63","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142114","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Gk9UaLo8jsZyOsxAPcFqm0qPboEQI33u3YUngjVVhL0vV4V7vmdIhMa1TbDFQlaWwQ7AeiT24gfw/wxsxNuJgA==","shasum":"44e5fcf70797225d6541c8bad437dda892806f42","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142114.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv34hCRA9TVsSAnZWagAARrUQAIaiUQVb9xsOEVgSmvTz\nBU9GnY/IQAxg8ushzEWEeaEuvXzDQ47PQeypQx3A3lWwf+9HfmHuZCnm2Ldc\n6m9z1UQuttighik9nLMO1kA9gzT4k2PTt7Cr3oYWUw5dfZqJV4d/w83Q3/5l\nIWcfY/qgJdjvVFlbamAHRtrduEoMq1Deu2lSvLeaX4L5JSte85xUqk1r3TMS\nzR8rZ6Q6HZmxMi3CYTuKyv/azh9rPBZgyVdHFlO12QbA/rMdZCSnbrLm+PYI\n/EXOEIw79QuRUfmBYIVAfCtvYUwOLPXYHG/drwIw3AgY1vTw2mHc7Hb+itAo\nEMlRQgYFYLP3IBUmOF2/EBHyLhOCQ7dGrLuA1JvqKYe3gSERBMex5WnTyusy\nXwrvDoaSkL+MlrLjsg58X5EDasxdqccyyDeK+o9GxIUzR5r8WHpg230WAtXh\nxwY1kk4+wzVO+GPgrlBsN3Tgn0nWU2xnjPFuu02WBs7Wj1FN2eug0JrL5XD7\ncpMqLOYrMz7x/bhi4XpuBvVwjUTx+FmBhN6ulpHkXHq9dBgnXVZgW7TcfWtO\ncP7R+wExhw7lf0afsrXfgSM5jR5b5gp6XkgfrFbVNQtw8TNYbYvdv5QZjgvO\nlX1GnYuo7bUv7M5qgHl1A3pNg0MDp04S4stxQ9r9uCUivwnuTYEKWdYVuan4\nBsbX\r\n=N6rz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOI6KLxsxPAknQjdbmPTC94oVW7PTxw67eJ+//YOnb2AiEArz4BxWbFSsh6ARPNAmkfO0lmdlDSr2wssukw6QCW4Uo="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142114_1623162401352_0.04215058578667086"},"_hasShrinkwrap":false},"2.2.1-main.20210608142115":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142115","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"95d21a66c1396c6b0e1482c5e94f9234e6ad5d72","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142115","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-+8iD5zyB/hwbf2xckr8DAwYAols0H3KqTucP3xQv26x3Y8Kv2Ryi8gtREtNgVE5zk1aKf2+zvUBmzqTG8htPxQ==","shasum":"849c3d43639269f28b3363fa6cd375a90451535c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142115.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv36lCRA9TVsSAnZWagAAa9UP/2oz1BJ3VnLrhDE0vUN+\njE5jeoMzbtaC/X59O0XWI/WEyZQU9OQhSuTRcWi8hUU4A8delDYsgKU1OPHE\nl3TXkwhG5nF5JmgSwLi7B5LYL+B7is4k7BOxk3etpoeD0927vXWBd1fV+Mux\nnAQsICASEAUaYqBIO7ksC9Iq/Oj/LszrH1dyxnVWnokWm0Ljg0ZZZz/UVevC\nASQaLvOHD23y8HJbQ3gYCXAYLa40/lcf6Jd3PHiSRA1nZByWsbaVboHIR+Gj\n/lfaSvRG6VwyNa4FpSjzs/Qih1km+syxAfGTejq3x+5Y6vhoceRxdAJKzgIo\n+hBSY0oYCGlJUY6q6///HkIoy/wuDvgPanZb3bg9gZEEZS28yPmh4U7m0RcJ\ndKRqYomzswb1fo4SyAKnaFk/STqBmtmAO0QnVrWAds9M12Zg7meaa7n20IZd\nVBnB+g1FnxZO/bJ3iwY9KAgj9thfQw7+cgoCERyf5V1/CJ0cMMVW32Y7dfk/\nH1QuPnDCQsSJ2CDb04CZH5+VmEOm6RfvKboikD6SkxTijlStA+AYdVee9GLU\nvl1lGpG0wy5/Ck7CDE/nB8gncJ/kMO6VHumj/szdeQcjpqL4UKOpvBAmyCfK\n3UZ7zKr4GxhiLw41QRj39rBwto0WUnJj9Xl088mgFzf3QnmD1vpOo7zYuggB\n3XJ8\r\n=zuPI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGhr8GvcIYmTbF6x5l0Ue8vt7JGs/0NG3TJQynn9ComVAiEAqIlg5ZzN6jHn987HwCw0XFIcp6825bxaoLEfHZTZFlE="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142115_1623162533667_0.730016246678431"},"_hasShrinkwrap":false},"2.2.1-main.20210608142116":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142116","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ee627ff901617cd18a0ca46a5cbafc1d6f0e2c3f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142116","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-U4bTAM9ID0S0d7h8qnFVBdPsyZ+dshU0Uxkqz+uNdXyDuCOOe8VUtP0hwJjP4Re1KmDhP2Cab4tLeJDQriSGGw==","shasum":"fa7292572697d533be86c33c62f5c2f234b3b052","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142116.tgz","fileCount":1015,"unpackedSize":4293413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv38iCRA9TVsSAnZWagAAplYQAJ0EK10epKL5+lBFMNzv\nQqjyPNcNd6QV6hdfXYQ5E5/N8jGWtiKIHllZGD2oaYiSmGi/xLyKQoLNnsk1\nApH5VpK3SK97F7ahrzrvO/K/5jmqgkmh2BCONxkzhg6kCWHBozA+pTUpa39J\nr0+9KSz2brsV+Jlj33DyCTahNqThX8vSF3OUp4DWPRXPROEk1aLwScZolR4c\npfiiUKH8neGS4oI3OCrpQmZjQbLLXL0rt81CpTsvgVcXdeJJkiVlaZXU14zL\npcM7YdH2gEgqd6iknW2SqMn5byyKOgfxaBtDyz9rA+qZzlkWOK19RO4M9rcG\npJRqvMuJuderbMvq0ozy2Ihbt2Qni2gKmzqi4Xj+4HZDsD6Hogy4pocLGb2I\n1IZwzu9XtBPq7rD9rinVW+/pSK+SPO6HgSiuKzTxmymgeQtVuG5o/1dEsZbf\nMJv0IaKGTH5jyTWAv59oSOQkWrwYIBz7rXBpzQCqRjD47oqP6C9r5CrLThk8\nunpfcCUTsKkz0hScZNSHDT4pqXZ7VE4PAX8YorsCDeI//+iiu5Y1jtmdifQh\n5BuZTCaU/TgoeRwu6cptaZZLBTuCUNq9Y8SzRKbq0LJ4tymJt3wRdBKBM//I\n6YDryPt1f9NgLYJHuZxjyc0i7pGrPUjFf8vzY3/JL883EtgyUA9FI+B+yBdh\neI86\r\n=K1YJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLU7RIlIO8Ry1o+kNumKGBykE4xl83Gj45t8V+u70atwIgT6oDRLmAhIYCecQpKjVcH+kYQjFECGvy4ccuOSPbrls="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142116_1623162657937_0.238983410015414"},"_hasShrinkwrap":false},"2.2.1-main.20210608142117":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142117","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"5acb714250d95d6fcc3f26e48023ad947a3ef3f1","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142117","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-VJP5/Rt02GCpBO1IzmcmfMiMyWhZ3/kd7+9SW++e3Utu3OrF5EO4o/2BJ2oSuvmK44o1enoLPstcJKW4WiX5zw==","shasum":"c999e6fa099042c3317648cbdf5c895ff98aa900","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142117.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv3+dCRA9TVsSAnZWagAAl0cP/jDUL5skEuRGuUdM6AOm\nGOUvC7jyXGD8qj8bdQlTEYltGDnawjsW80bnYDmUqtFR5d/WrwloG1wGPHP8\n3DXPT+7lLcLeAfNXftUqT7TK1H7BY2jUIszT9ac3VHRyVhlETw438e3S4nKG\nLX67bbx0R4Uq32yChs2aEx/zKmTb2+8mHfeyMSKoNr4wPyd6kla7Tg5BTF8y\n9860kJ/GAbj+CexIriRsKTH07aQqlnTj+qNfoZdx4zWFVm+XfstSqtFx0xYc\nv6HXEWyLOJ8gyOIGxCuIgAS6lA1vwf/S8laAEM+67co9mYlVPPAVJ39WN/7q\nnCLn3Y/PBxGT7c5VN7nqfarujbpG3LXvgNt7l7eSLKBEvqkSHlqvn41LowId\nlFbxgRsA4tgvb5zuDmkIlyuR6SqSG8P5xcfWgM8GMbTIbbfvpNEaDp8fc5VD\nEUrc3/pvNQuVWDL7g5GpLYQB0oX35wiBJ+To5PsvePghea8Bstcj4KF4xBkJ\nf8T88VzyYQCqyTYNQxscodLZ5eoyvHn7eSjXJq1qy3sKMCHM1ki2Jdw9GdfP\ninG3TjdyvVq30SGigTdQEuTMQefYMGYl1kMLxek5aHU0VFTkNefm6AdcYtji\nedwyNXjPJbv8pT+34Fl5QV2YvHucIe+e84zpjzU/0sv8mB68gluSynzCrLJt\nHs9I\r\n=Ql+H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOJQDiOD2Ssy0B88EL7BBFdHbFWLrhR2ArIF3Zmax0jAIgJ6ewqRvcFnxjpCgMMAnX3xoLiBdj/W7uwz6y2tga+Kc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142117_1623162780756_0.8047286740339044"},"_hasShrinkwrap":false},"2.2.1-main.20210608142118":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142118","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"48774ef8a8c303b4aa64036c71dc78d442a8ae2c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142118","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hBDEVHP7neWrOZZ3A+y7Epy3c/VjbYzNB+WbMOZM40VI0TASPgQaXiHAYaV4iiMs9gHjANYybQz1AwZFM+AYmg==","shasum":"c05c826672664b359e981bd6a379d1445ed2fd88","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142118.tgz","fileCount":1015,"unpackedSize":4405987,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwJKJCRA9TVsSAnZWagAAv3cP/AlTm2cvdVcxDpj90fbr\n/LgN6XhYh4ydMbMWMKVLwfzrJ0AlUe122/y4AML+Pfwp9NXy5je+GWb+3wky\n5I7OSR9IOzaI4dXEA2iCNsSJtattZrMmQmU1+WD4ketZR/WoNIPAtnLCrLNh\nwAGkWo+IY3ksDY/aJH4cKTz629v+sYJUGmsDIrvKL4ixEoztOU12Rm5AA36S\nU7JsoLshsIFKptvyaLECXQP9CSNVB9B0Ny2EyZPD0p4R2W+WKvyIzUmMX++h\n+hmlkuQjN6gCAfbG0UKSHAZuSmGgCQ+jJbw0/hkKljA2cXMmtNCJTVx6xote\nQbhcAZGFrz9tKlrdqUALi5YRdrFJZKIE8Nvbkle+cELYOCcpV2uMQGdyEQ5+\nfQjNMcHe7S66fBdDWTmm5x/K0hvgJ0sJl72twCFm30Lz/DimLS7z9Zc7r5JB\nR8g/d+2UBPfLMjaG8Aq1qVbYOGJdTKJ7bcmk2SJ5kAef/4OUASLJAAPayhqy\nNGEpFKjzlp6gro/YiSlXN0cb3mqNnjrXR2pvI2N7M0wWZtklcYfv28U6CAFn\nJxUquR3Dg4K+jxC2wL/xbgX8zXM7D+eiFnhFZR8CYW75lG7xAd9oXHApvHAP\n1T2UoLYdF2exAR1+LhomfO1fXK5VLUHPN15uxuNQjmSGKOZc+N3sW9Sq30gV\nJYQB\r\n=znIx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGH+WdmPsIPC04UwHqeFPCvuoi0bOeQUm3S8ynMfXGUIAiAyG3v6WzyckK3CuSqplBdonreva6i8QUc5UfmC1HrbPA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142118_1623233161699_0.45946862187016113"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.12":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.12","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.15","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"4470264e838e3276d329dfd5adeb45bf1e759682","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.12","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-sQWMlGvk6SyzbTsCvVcKkbqjolt2oAFJqnRLyPtBNMTULXAKdZuoe22QLnCIRgufkshNDEpPVTjKc3NUZ0BRWA==","shasum":"5ae276ad37b4ddce45e491e4cfadab6dc81dfda0","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.12.tgz","fileCount":1015,"unpackedSize":4406001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwJLUCRA9TVsSAnZWagAA8u8QAJJjvtuUagfZhvJSI0/v\nKChj12yA9vokt6T0Sau4AelOGMlELWJ/ICHhxQzwfRTMstlhfvkN6B6xRdvx\nmtwmrAfOlQ7XMftFauESQdCFLd8CCd1NYUMtwN2gtGRoGqyun+fz31p2ydSu\nTM7VxTeOmcyXL5iytFzzmStiImPtrn2whT+XKsDQu64bnt+IbGmJY7fgqoi9\nkyNsJ7sAhR43l0UMZeGvwNoUP9uYRsMCx8eH7i7w85X5f2gzjW1i8X/kHdEB\n6zW4HLUck4D1qKJllymLjS9a6xe2eTonIMDTCm7q7piwQcDN1T0P0rXHyMKl\ndH1mpHekMfyEVOsu7mgJC2Uv7ZVNaOsGVyKyyPZNbkpa9q5zMB/cJLRI+/ro\nZh6TJ9MyOeAY7jbwKnOgzxAvErbVS02+fE6OCkv3QznoIbdkAiPlxyfKFLj0\nI9qG0pUJjy7kFSICJ3hw/8JreUyFz8NR1btYbeiQWh2Cd4+G41CDNggomIGj\nxfXPQVQ0FneAbouW55UsmCNrzjnX36woLy8/gmpXglTjtlRnxy1KBrM/bbCC\n7TK1z/Ylx1xMc+1T8PHFCYTaSnGC5NYhD+WWfceuIyTWEWeOOWLF5uDkFeqL\nlw71SJaCKJE/AvS+5iMtT4E3RvY6lnN6Qlwm8lkSbikiG4unzdafj/zaGIL6\nCAzM\r\n=Qj1i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBLbbxlk61PMIE8BOL/HfzhuZNix28YBmtjokioqUwpAIhALiv08bpIA4W7cBWRwogTxXc2YrjQ/ocV1sq5JEvfHOd"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.12_1623233236206_0.11277920989027956"},"_hasShrinkwrap":false},"2.2.1-main.20210608142119":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142119","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"c11c069e2bfc4edcaa7bd3c177a8f4908f7b21c8","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142119","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-Cwx4WtBVrZIgw19FobiXArQBzobQW1vD5bmyloX5dHcEGh35kXXor3asiuGfz5nLGk2t/fR71V+cFOs2hzNBQw==","shasum":"013579ce36bdd36d081e116ac9d67ecb5c8d2823","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142119.tgz","fileCount":1015,"unpackedSize":4406535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwJL3CRA9TVsSAnZWagAAokYP/300LwkMhF8or4xpT0gb\nQ2sMDbvqZb5P8ma5Yc2dWrZzM9pNzy6c9ulM0iNphWAqN+lYJub6JKK8b8dG\nMTwM/7xWJA1KLdss55UD7z9ilGZKoK6P/61S5ldmHAuJQo6DzDg6wWVVibP1\nNmx8O8hanYhThvEQiK39qWY9FghGJ4nE4w99pfrJngt0bcB6zW0dIMnzIdL6\n2KN57MByYPAwwTJWpr89Rz+BrhVsIL7rP1LreZAAgH1RZVf6FeJmrxAf2zfJ\n2qPgnbeZqPIDK5NI97cqwz6VfUBmoiJaSFZe4Rc+QTE0lWq3x15zfm2kCrSW\nHqjTnNA24f8K4o+8WbObFrE5YVGCBaAnzYkNXazviRN72SkU9Y0H+Xp2bZ7p\n0DR1hLfKUaVid45u1k8J03FAZ8f31gUjfXghf59agxmd9bQ6ET710RgJEoT0\nY87SDrqpS9WJ8iwe3V7EudBj7u6Xn+Hc1bqQo+zauOvNK8XBhibyVNeMrWUD\nehUwTlCuWqoPGR1Yy6ICRqf45tWm6emRYNJHmRNa5K/AWbEzElKFhAM8wQKC\nBrUvJAPpdfQNw7U6o3C6yILQQL18bO0mPP5giDkjzFF1+p7vh9YKTtf7ubD0\nhKUGJK2TFRBpa/qXKMQ99zt4WvqdGsz5E6tCfwPQsmRTIa964+MqqtYnqu+C\n3DtL\r\n=TT/R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBC9WZQ6TsMShfHBVkU9U2WL1WDEpVZvW5C9ZaHXedk/AiEAhn1p+Zy1lKtZWuGTM8t0Gi/of77LZ3pqVOFpgsmvLMw="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142119_1623233271422_0.3794538430583503"},"_hasShrinkwrap":false},"2.2.1-branch-atomist-npm-update-main.13":{"name":"@atomist/automation-client","version":"2.2.1-branch-atomist-npm-update-main.13","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.15","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.2","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"9f63a84a831830c9e91763f8d73445909143537f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-branch-atomist-npm-update-main.13","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-BLncpieuH5+trnVdzDbFEcK9x47X650B6m8IiiE1OvUgTF0Qojj+K8xHhc4JMrd33DI335U3OFgX/2pjIEIkjQ==","shasum":"0a5e20f0571576e79dfe65eba9adb99d2d396c49","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-branch-atomist-npm-update-main.13.tgz","fileCount":1015,"unpackedSize":4406549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgweP5CRA9TVsSAnZWagAAYvUP/i5xEa618CJpSjTM64Fg\n1lDJUHDoFcS5VlGh48/ACCV8ydBCJiMW13Z/yjEdzCfMBL1OLlebxi69H43W\n0vhohzmy5gwkijpquCs/8jOHAhdoEvx4o5DnX9sdSj9GY6pBf0Ei7t4ly/7Z\nhcIUQlbDE4RfmbYfuGoHXXF9AbXB/dHDo88pXAxNatmvhw82JcrEiWWl3zh7\nnzXsi0CJUrqNCBdu33xkaHaVsCin5dYUWZMvPKLklz6KL+fJWDf8izASqfQQ\n7WcywegYUa0RtFAK1W5csHovGdvWBkuim8zHswN6J4Ju35W5La0Jujzoz9kA\nlLEKR2SCZlfzGQEswO2yeT/HJ30nWWIZI41UfOI5YVkM1/EkSRVaEH4R8SJH\nTazq3gEg7ZU3zKdipsP785r9cidS6AZgXil4qtRK90pBmZ81FichjRAK/u20\n/ojzzQuYn/2vrtA/6re03Ra1nUJ7XDtBbGvae95wk+SewDarRxDo1Kb3Cb+K\nFeY6msE8o96bC8gfjXZa+d6S+WPKnasy0rGvH6tog6Nu9eUXzsNBURtyiZ6m\nnmXeIrHq7XWPjCQe/VgMJpc8xjj0eXKQURdalKrVeEgrj9O4p39Ld+nvKc9/\nRNObBXivt9soOXcN52woAKxyuZjSbKFntfwF1EwpGp3wekLrMPvRfJrs33om\nAwpu\r\n=er1v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFwxa7vP317To4BgNA56GI1nyP4AgLB++ADIu6dUFtcgIgbgBguWrEh4e0dKFJcTKIR8fTvuoMJB9Bxm1Tt+LgrjU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-branch-atomist-npm-update-main.13_1623319545310_0.9772853608726286"},"_hasShrinkwrap":false},"2.2.1-main.20210608142120":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142120","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"310fedf508d5fbc9d8d44594b2090e65a3441e77","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142120","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8vTyCfrSG2Saqv/N26UnADF7WLjeU/cGggV67pFdUMVLsNtFBDCwBC0OJnmxYwRmHTrA36nGg3k6d1KOIOLFxQ==","shasum":"96bfd1bc1cb7ecf928491a657b663687887aa5b3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142120.tgz","fileCount":1015,"unpackedSize":4408094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4yV/CRA9TVsSAnZWagAAdmYP/1vj9B3ksfpMlQcmfEeb\nUY/ee+mDLpNUhkCT4pDG98SsCZ8YVBss6JywWgaoEYhiwzSsRQ99ztAiaoxb\nUU2HuyZm2wNA7PonpKED0f7KAKf0DMXMXdkWRz/oSYyhIm6ttxEMV5XLITdc\nDhfNwnqWQz44rDLJVzW6Oej+aCphJ3fdCHjcesFIYhNq0+Ll40GC/sdMhcMu\n9uZgdXmZa9/5CvlCO4A92r6Q5jI3QGxQ4jEXVp/yzDzjPJuWNno2y4nCZvqn\nHdJd43aTi7jvlxvoc4M/atmagepCgM/RR/kxrKXIgMitln1jt6AAN/oBZcFM\nh534fwU5PaFkWP6KGQ/GrQWfzo+xgvhylul+BpYE1vLzDAUsYSEkDXK9B8Yw\n39WStvBvMHv6fUOX+EeMfVWxAl0UBqbAff9nn1p7Q29YrXN0j9P1ijxSE4DM\nx7FCqYkl8xzXkL6LnPN1olUvxNrLTsPNEKFXv1BL+qK1SirwxWXHQLG8X9kD\nyKCoH5b+IACWjk1sDQTmYQfxGh9Tmd2eIFETLVB0MZihZXn3SxM3yMHKJ1f4\njVSAPYhYDDt6uRvromRw/+qA9/H2oBuQR7y7PEzPeznJcdOWtZkkOmsDvlVx\nsIjEe0fAtJX8u9v1VIO9OjwLypdnw9tt8jXfA0RLGCgQhTkk9cTxuNQo5PGc\nMjLe\r\n=9iOa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZdTusIw8N2Vv56zS2IXv7/6Q8PNkFFx0cEJkHeHtAMgIhALkvdhrk7WCimAdy2IIlub9zTfVi4cPMM/vuYyaWgek7"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142120_1625499006457_0.11673076457355314"},"_hasShrinkwrap":false},"2.2.1-main.20210608142121":{"name":"@atomist/automation-client","version":"2.2.1-main.20210608142121","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b3d7897b4d5c137b8b4fff750474ec22c21db7e2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.1-main.20210608142121","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-xTcLhmHKI/eYeCcIbHzlYv0woyLKm1AFChbdPXKDs5YZaKQMvG1Jn9VTkRgtu9CBhXTjKPxUHrA+UFWxnC9bfg==","shasum":"b1dff2ae6d578b6310040581ba58989849dc2ab6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1-main.20210608142121.tgz","fileCount":1015,"unpackedSize":4408203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4yfwCRA9TVsSAnZWagAA7hoP/1bkOM/lBsRSkSZMp0DN\nq2q9s6faDMcF9cwKK5IT2JmfeJpu+b1ahzOuf2Lb5tY+Vw4gmM8Hbf6GL5DP\nbB7YY7/anwd3qPWdiDRucFzx9SxoTjcBco4ITZzNJ9meEQJrzvzxoKB6oGwd\n0jCeSlKUyLOSPoxya/uMlFbUutUyE4JZemo6h6Yy5et+yZiS2ojYPHbNKhDC\n1IS+IXrRUdPTrjSrfWtaG3B02POtRx/BaegVo1nwkU5lFBmogR7UccCMU502\nbLcLRx90LhQaawSAc0xmXnPrSxb7n/vIZpfpoHUsJawDOqdR2WQKO9Ap+4g5\nsiWF0HEA1lIdPR5HCKwJMzoTwLkndxxnlvWK6EbKavoPltvkA0P5yLtiCHuu\nhZ/QF1d1RMYNfxBig8egh+nIbiCPjajrKFVDRUxgTvvjTxs4X2mL2J1mkYvq\nWIUxdGEL+PYVVpiIoUz5TWWurz0biE2G33Wsk/3o+1C1ZvBynasgvHMgxp/a\nKtH//F76yY3A8LuBgfXXDPghh3AAxvhnNJvd8TheyephEH0fad1Tdq6xXQFy\neTcaEIvwS6C6U741n7B6El/XYavFpt7zyf87Z8gbL5Sfev+Da4CFl2UTHUbR\nTKbHQcRv5GW4DCs7DyG7w9lMAWmHo8YB/dv+4lh9RDpvxWBeQmM8KfVXjP/k\nALZ9\r\n=T7xF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHNeniznNj/rvWOKqhXyzizXnnANejcqd8sG+iIv2bRAiEAzt77UE35u/SR8z9wfPjWREpVTin2mCldhvxmMH1h2Hc="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1-main.20210608142121_1625499632040_0.341907357473922"},"_hasShrinkwrap":false},"2.2.1":{"name":"@atomist/automation-client","version":"2.2.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"_id":"@atomist/automation-client@2.2.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hsZsMViCJjV74qg/QyM35otsDT58o7Riv6bEZxNYX0ive0THQQESc6Of8cEe0dGsfiW1E1HAEJ//qAy0wRZIzA==","shasum":"887eca1c386e8854107dd817c8f26cac28b7b7d2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.1.tgz","fileCount":1015,"unpackedSize":4408183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4ze3CRA9TVsSAnZWagAAn8UP/0+UemzR41Lck+QrW2dj\nShuqAhPpjVIHJngOyOqzrZWE5xObnDKTGjqPU06YacVoAbfxjMUJcPlh4X8e\n6U0as5b8pozyHUG6WLIq9elGdjKaSPCatW4LKt9wOyRKcXwBq2xF0h2NgC1x\nXgothwXNCA5/rTBKG55NWBdOXr0s3+44WgXB1i0OpHrH2XG3RuMxOBP9b/Cf\nnQAb0PPmanD7YNZ/pIHe7vPruGrf2kg8JI3Bz+5tj5d1O1Z6pMWizkP1+BY3\nG7vs5VmRu/c3KUkqEQskDeUpsHWVWr+0wHBcQyOCaPYEyrB0TSXIbMoninaz\nHDvI2XeLdJ6AEdVONPpjqI0w9l6nZkQKV3E3EZM6TYHeQB8aYVuYBHBGdtKo\nFxmc+F7zLGJmHX3lAuQIaVXIJDEjf0BrS/IJg0m6Fe6FTY/+PgxgLnMiVKOt\ngGLbLYhC1winHcZonnxfUEm7eY77opssuUs+AZUTa3bx50ajttYbmBJJl5h9\nGHggv/ETaLnC7ortIftv5oFuCpHKBB11wmpUJuhQNM1Hz3p0ZmKozLayB4W/\n8phLONHlsqlIzOoQLN0zvPKEAsLyuKcVzkuHWGIm+laNKSaBXETKCrUA7dta\nlUDJgnXtNsNBohMD3603l9idn6Yr+a5NT0d+/KpXGC9R2D62m5KCg0frwlX7\nlHdm\r\n=gc8p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCavMJPirxEqJefXRPFjaJiVLHeDuz1qhwVr6UgipDykQIgcLIYso+9Dcry9F9GatD6idYk4kzkZybRfFSmee0uGyw="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.1_1625503671181_0.6616271504591322"},"_hasShrinkwrap":false},"2.2.2-main.0":{"name":"@atomist/automation-client","version":"2.2.2-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"564739d901f3a7986e5b22912e0cf6c9b27ec73a","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-main.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-HDwRndqCG5wXJlGVAqreXiAc5LSj4iVn9hve5nXOA1GiQ3HKJirgH3pANq3smS7mJEi7L4hcwETeaLsGdfnfVQ==","shasum":"00d596a632f7c9f1ed52cd65c00d3ec54d528d1a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-main.0.tgz","fileCount":1015,"unpackedSize":4408190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4ziYCRA9TVsSAnZWagAAEfEP/jrgcexSTGpFPTYqD0LJ\n1Uz+ZG4UixMrQO0/FgSwZ6blk+8zKPAUEEQHkEv9JIRc11VI1KmqaKAwf7DO\n02Y+4D5ooUHLXdVadwEqSj5qmu9Owu9oXtMZX5WOC7Hn9OX6iISqg/TyKsOk\niARzyVCmlhJcOT98d5pms/55+OeoRwfOnCkm67JwmI1piHPo0S5Up4uwWf4f\nwUQYjwqQRTvKXbTS4V1J0fDDDdmTG6LCA7Jw2ddB0fbLgENeh5CshurT3PzM\niuQuPn9KnrLWEII3rs6g2+pNbtH5+UKzjdJSVqSiylMHgoGKZWdgDuYRiWuk\nUizKvrDYxIiyIdi61wR5kVv/wwjngQ2heF2gvOgwIGvU6xaUfsyZez/XE5rj\ntuqIlng9OK902G4Pp4mfNnbdOzQIy7SDtWNYcdti+o1/rzfE4ACgp5fAb8aS\nTlmSUB4z75rFcU3wSVGzm3qxrsMIUG1wUVy0yEQ3RSJJxlJl5cz6bE2cvS1A\n/g3b8CprpoA8Xm6VIbbLV1Mzj19Ect0+hZaZzHOcHwZCFd3yPXSXMNKsR26q\nWTUovMSzAzNUVKRFsufdjbTiRxBlAZTHt5imOTPvVHsAqNLBRhNnZQdc1M9V\nSnB8WBFRK1evz6NfSjdsdn99ps53H2dbIzR4e8Lm7PDihbOwbu5svntZpNkN\noAeg\r\n=o+de\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEjX2oAE6We5UKmwzKWRFDxCmjjFT3Lik9ptikJ0ww3AiBaD3nmopAYYqFyF2VPGFGiGJrtJKGgEFvUAAz4ijbkGQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-main.0_1625503895606_0.21812829777895737"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.0":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.12","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.170","@types/micromatch":"^3.1.1","@types/node":"^12.20.15","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.2"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"b3ac199bdaf086007032fd2cd2c9642b18b7a00c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-gqdHtDMvrttyTBPIXs+9xRPdpJM6/j1hAamsE1/NFCy0Y6w78A/ivUKCfXmUXFzITkEFe2oGIyJcvxQ9MkIiQA==","shasum":"84baf583645f091709608194ee57173d21efcaef","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.0.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4zjbCRA9TVsSAnZWagAATa0P/iRr1hMXUrNGnOYSJlHo\nS1pIOWMwey+GTAJhVPzE64sAP/7WBenkPTYgOZSqvOWuIJjoHKZfNimB2SZm\np2bbaFGgqBY/1wRqoBYWkFbtJXy1sZzpHHt6ffdQUsyAfvHGkrdkYm95vMgw\nXU8qYqSJzhOAxmvxFlredIt/XwAoMMBtofpCgRaxDTy6jsJYeYvcHJkqv69u\nMzN42BmUZ82o1eQEtSHsnaN224MzlHDDi239vGZs1DlOyQecthoEfyrjoYXf\nr9xiFinUp21CXGPUrCvVSsIvhUwLTKkYWnMSZjz7zNIjNHayd6IRbyTUBq95\nUDHZvlyUV9CEhiWshpNEepR/3m1aTU6mrdx91oyuwAmI/3sqSaDPibN9vPa1\nw9aom6NEiSCAEuNoqHFXtd3yAQpCw/XZwR5PPrFaST/V1jRQoPS0sYLZnCgu\n3ivfD7BfCU+zUqNiEewTJCyzEqW3BIG+79vStsQYR2FmtbX5pTtY3x5PdGDd\nd4RqsZSV4apsczV3J3gI8XQsSyDwFap7as3UDiv895CwQ/JQAXMbjJmjsLTr\npP9dJ9LCoq5/aj+kWTjHTsxMZgU0GwH6tPmQI5811cSfPNh9qxt/QpGEuDZK\nAbPE1lAaB0kKRQN55geQL+E+LGR5yV9jInj8uNbqHS4vkbgoT0WAxWiYwK1G\nzCHW\r\n=EkUz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC5WF0+iMgV4POc7gPRh3nOCQyvbGRJcH8isy6EyLVnQIhAK9kQ9twSHaSIIVDYx4RAUDE8z2EsT0yF3QPc3wm2idD"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.0_1625503962521_0.16356016703643061"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.1":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.11","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.15","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.2"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"60e36f8bee386f494593cbef8a1e1631cc34fa61","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.1","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-e7VCSJZyOWhGqCkcHdDdRI4P2nZHiHqaI/zorbrvgAg1gGCGHwhwnkGfCXgIXQ6WdK+0hGRI11sr4BPwYSD/Ug==","shasum":"2788d65797ea3e3d4ff78723fd8b0bdfad8fc2c7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.1.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5WCPCRA9TVsSAnZWagAAlygP/ijINLTodhwp7Uu86sa0\nO8MR5aJDGfhpGB0YVP8ptsXChXwGoehMizDUPn5kfgbkbC2wfzvoLIWGPxpb\nwGPQ6qBKUM4cu6Y9YVhJu1oRbRRZjtkLlWqumRzUKmr8k2XHes25IS28go5Y\nXRxg+IAZ0DDhp7kcOzcHm0q5WU0QllcXyFH+fg982eSWfEqoLpLGoPk0Xd2i\nHOUwljmfakPLTndsh/bH9EjQKWr/h+PlWsYl08Jg+QWybYRpAAxMLvb/d2q9\nJ0f7YFyjl5CIEDRAjTGcSnid+WwFchK40czI+KJQAhO55ZdCNc7DLJXPmtc9\nCWyCojvDqxvH+1AWyi1jrq3ihG8fpY65dcaiXPM9IJgJOGDnhL+zbwitWBb2\n2l0r1AVSbo3fl23Gm1XDY86ikuG+xHXK2Y9aHpIixF1PcdiuaqyvSf0Dv48Y\njRt5oMYduuzwwGomAqqP3dCTh321HSpFxsfK652wXgdE8NlF1oklXHZi8k+r\nS6xLfV+dYbSEJpobW9FmMLtounqOCFarQ8BsJjaG6jvOLcnclkVXxyYVQnTw\naSnwyl4zUfcql+crzaXSAh9FuZqdRFWHo3AZJYVtbg/vlBIFr4xnGPcyYtGp\ntwLp0qO2of9E13QRcpfCqUWDrm1WdJVz27B+7vaXy3CHlYz+lBjZNxCXzmxj\nq+JB\r\n=Anat\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADZP11LRX+5U/8c0kJ3IJZzv7NkeK4Tr3BRmrXhxL4JAiEA/qxM505jm6WTRMLnLvLzroKKqDZuQSRSuZOnC8izXEU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.1_1625645198654_0.3788987433761848"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.2":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.11","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.7","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.2"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"353d1944c031ba9a3b1345bf4be4d12ed50285d7","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-5qo72SDNxZQRAhJMCBupmCc6IKl01gz47yjDDDX9JIUBB1Q0PkrKPNZJNz6TLkOTq5PsBCKQdYvlfl0B90Ti3Q==","shasum":"dd337fef474090b1653ac5db56657747c2628c32","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.2.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5rHtCRA9TVsSAnZWagAAHC0P/RPgLA1zkPHv8lErFO/w\nlG2EbBvr05C/G3JYTHhbqWP6E4JePD1VYUWJP0NI61jCBj+3odcdUvBjJFUQ\niOKWyH0Tw0JNYxxKEfKtUWNU3zo1PIUV3MuBy5TsXl/5rKBUSuEJNGCNpGvS\nvM2nh97xH8tlfw08Nk1WrP/GgVoS5Nc4otFfYPQSpK8W9FB6MYghGZ3xlql7\nrcHKlByQuXVAUDQSo+0mNSRILshRc4lAS3Xi4jh4yLtRJ5JZw7Yv+5Wl7bng\nMJC1rScurhsfESfdv6x1leWsmr/owt6IZ0Oan1RqM8Ej+KZ1R0QF7jx1xKgD\nNT8MKwyStyEbNM3qxCcPVKl1ivg1G+M3LiIGyazPdG84fZWcxVSC5dW1Ks4F\nls3nSY2WQGcn4e3Tbmph2Issdxqv+8m/ifyMBh3A/6YgfwKH9VzrvxUQV7k5\nrPIyFRI22CmyHO8/erAEEtn/9LrV+bsSaNrv4IXjbgwu396aawEN8rzu9t4U\nckQpZXdqtKSDKWv+0z0dx+TPNLrWDlJgAYRybSwQDxfgm6fNjaGI0MB9Ipyz\nKkyAZZpn5RnSB3VOkTzkM9m2CpA4tVt9BxO9/tmcoEFhEEid5IbZEB4PkmFA\nr/tXFMVa7SFYGKlUuR12Oq2RytAH1TnB8wC9azHBgzIAljBY+qGChFDoocHd\nhyGX\r\n=TrDW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH1EdF62oa4OSW8i4lACaiRgS+mRP3KN4MWAEZbNFydkCIQDA399W1iGO60YsbUxtEIiNSTLQtOn1oofZrjyjNa8F/w=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.2_1625731565110_0.31047076060745615"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.3":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.3","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.2"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"80664cb41dda280d45f39255ecce5e5ae486275f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.3","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-tCDzsnhjJDgQPuCCkP4SPliKGyQBmKe0ZgllStNLbwRL1b1acaHUFxJbRwyL/vWWV5UlQEn9qWAJeg1kqcO9eg==","shasum":"888305ba8d5ebe14d65b23c2f78c55080749a005","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.3.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6AOVCRA9TVsSAnZWagAAy/AP/iiPJBGoLsNLvfxiaFau\nFdjFyzq8p1n0zdWmUkOSU0gpNUOSjBqjuTcRW6iekDOemqihM8NybukUwm6I\nhKc+nq0mE651sb/NILpv99qvpd4MrXCY8fcjLWrsFoQ23DOmy4807Yw05PvF\np6MzrKaple5G4EGWa8LsJPiB47u14IOrmDje4SgJoHDCTbXdq0aYSBlDH7Z3\n9zMOCCBHFgNVA8PYK+KiJXXlSrkXaIQ7/8UogmePF7zggFSd9PSF4JPJEiKL\na3UI9zwDiloBQrjC6umsDARFNdKLEg9SBV9MtVg718iStPFh35kPu81VKpcM\nSzn0e2sGDAILVgN/l66P/7I4IMxKjnlmovrZVbYkC5ftTTKxH86lLMMRBAQl\nNV1FZn7TqfD82hC8Abqti2KFgX5/ElQk0K4VRZTZEdLC2WqUO0SFF32vdHbn\nIf28fN6WUUZyKCLEbOZPJp3hDhmdfjw4MHPiX6w2PtkQQjNdPpz3l0j2IvYU\nqyarTsUouzlQKbV07uoU+LvQgzcBQkzWqlklYgPjjAhRzTjTsjiX3hxULdlh\nII1hW7MX4wtjAvHrNXnUqAtXKSvip27WmNQ9ITuDAq/cHrKTDwF6/qKyPows\nD9cOfugqZ6CfY6ODMuNq9xgxZa97/AzlkOraXxfhHyhORXooF2tncfqDy3vw\njv4b\r\n=OGXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3LB42JVkxiSGdPy+s5yamwAkawVKwr8YyNNJQGLVrSAiEAzse31ByyKHgSGFACmGjA7PGKkE1KMKRa+md+8a8xing="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.3_1625818005390_0.6380918335632237"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.4":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.4","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"07a3a5cd282df3c8074a161227c8c3d2d52418f9","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.4","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-2i8wLccPljqI4Yx/rjvMT7ztrfHXpyXzPBLVh1y46/P1W+ofDEtajbyzyTD6CHgk7fusEEJabnLKdrEgVuuXuQ==","shasum":"bae462bb93754ee8af0e875a980ee16958dff48d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.4.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6VTiCRA9TVsSAnZWagAAh2cP/in+d90K0LRcD5ZZPhlI\n6EIjbQWq87iD3rDcub1muylfpPBdogxw/JCpXN8kUqUvMlYeINZ7O6vQOO+1\nmCOp3Mbg76BXaHXc+s1nNduBezkHVxUxJdhk7DPW0zm+XBvOQqdkjRTTYrXB\n/+aURUy2RbGlYymosast6SFOFW3IMUGFdS7cRq/dokJRVAmpI2rylpwN15WM\nFzc+jD+SUNvtT/HPQRPXyYMMH9fbeUJsBsKMd8O8zHuu+iVOTiE68KSywDCO\ng0wuqxNBYhWGX/iiV1zVlCIodSB6nZlyOyhzMIA7GX5kTQ7RhVOvvMooXdO9\nm6SHA06X5Sntg3DIHYYIpgEyLseOp4OEt1Pb3ToVQ24M8a+HSqg0gPjqXdyY\nD9RbdsepEPOcb3XD7OkF1tLpBhwA9F1E0H/vFExEiqjIbQtSxLQ0AN+kmAEV\n0oExQJiKUwWMdtO0qhNWCch3xPuDfGt330cKhcGI8jL6/XrmdIUaDROGfQmE\ntHnLRTZH/zYTtJuwAqojvncDnPZ6/rxGWXXWAg1MTCQlgHDWZXel2ItwPNom\nY9anKn1WATPykGiJJ115PUbyS98QHrwIbbI9I937WkfUO033avzO12KGk+Cm\nULzQwel3qlwQktXiWMfrNZWHJiFfflzpCnnPksYHdjgzlEJv0mp8fEmdKvDH\nbc0I\r\n=C+2g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChzMWW+Ku5d7aTi2Kh7LMC6LiIrlIYuHZ2thuV4ExE4gIgQnVIna7JGiV+JeTNfKZVxoR98YbupYlukpfX6SJtNq4="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.4_1625904353194_0.26597058001040486"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.5":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.5","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"2513406f0401191ef899a9248970e01acd4d206f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.5","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-87getQD10b7PkxWwvoaFEgFVkKYZOoDJaQSZyiZ027Nn8I2Dlwn4Fud0VOwvUDTxIgNcQ6bNIwptu3YNZwFfpQ==","shasum":"526eb5292659f77aafec658a1d97ea20365ed1e8","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.5.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7UmDCRA9TVsSAnZWagAACAgQAJnxrSUi/mK7Xe1Rt3mz\nMV2IddspHBguoKhui2eKSmgCz0raUkTS9xCMdwBVoKnmwETia17tbSV6k9aw\nGs0XrvEA/of/5TGbyEJJju+FAgMzSTTf6RrBjLCn62ibUZk9+kvTpXuWkJez\nLH3mCN49MOQy98jR5cFk/9NF6v/8R9MU3TRedNsY/HjXP/9XQSBp413qa1Ty\nATa1/y2rWLWqmeyiufgWKR+lTHY7f0MNpM5WrKnNg6YqBccyag5sFhLR2H2q\nQit+tiX4gGbzKi3L1TkRu5zgFOCVPy5ZQtUWyL/RgX77tqRd+trilpheRmeY\n6BLXyZFDz9KrxzfN4jS0EfmqGMLH1E02+abuNhPDi6S/6Ls3or3H/dVN9YLM\n2xk5/9woUjaHZqV7Iqxyl70tS8WaPV2btbdoc0z8xhr0Rw8vl8UsrIr615ja\n8+vOx1dBrnRgDC3oLG9LwbmdHoRspH4rDXFFPfSKFN/imVjQcq/xo9xwpc5q\npBjuEX0sQv7w1WDMWofutr6gWMX5+ZZU03DEjYt4YJh4lcS1jhUjv+i4iDp1\nDOuYtqsFkhJOgHkZ+aSPoPM/ccUtnRsuwaGmS1KsWX+lj6opk6e5f+2DaxRW\nnn0w3jwhw/l1w7OQhPqeHxdFKyVuMe8DK3RSdP1F+m+RyP2or+CDygfFQNR2\nPObB\r\n=xqML\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGYD28vE71Xu/bE5yyUf8wLUGLierYnU3OLhaghoOGxwIhALKP/m8bZWPo/Mjxp3a4kwIIIjsv6FORuX7zxOcf+NJH"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.5_1626163586624_0.501623580216358"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.6":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.6","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"dcbf7c820e0188b0df84fb2dcd4039ea1daec1c7","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.6","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-0zXk4pzxiil6otPrJdBchadZ337GYC1ezEVZCm31wwrJEH0jJgIK53ZboXPVu2ZdaJRpvJi2hBnqtYwF+CM0hQ==","shasum":"7dfc89c1c69ebd02f69c6830d5790b646f455ae2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.6.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8T3cCRA9TVsSAnZWagAAa4YQAJzzFNOMNEZeKeQv9K1q\n9GDRfNE55XP2EdIhw7CBSCdbZjd+hQyFuYO/x0lPXKIcK3SwqpOKk+bKiuko\n/ooReomUZ1nlDxNsfiOKCzSs+/pXGR4cLMHca0+EWzBMWQbzduM9gRmlhPo5\nDBXw7h2nQxf6LVwF5Cld0vHGiRDI1yfBWUFI6I0o3TflePJM/PnI5wQlBHZR\nWcKlCog5G/Q7bWCVZhvb5ii3mcyPxtAeLZwQdlzIKoI1X+tfpKd06JDhM6cz\nIhJEIN5skUWseNui9gKEIAVoRBeWcDw3bjkFMaNh7Z95pQ+F3adzUAPmdUD9\nSX2u+UNH1KYCCTGLqoBwt7POuGA50ue80v1xLs4Fs+dGgQ5AG1PbHl7ce7sU\nYHa9NDO2leprITC4XlC2YHjM6rA3wwc8mZ5asaNprt20+5fJ7vh358uYcZ0p\nOAR5Cv+pqFIcY+PF37j21N7BVGN0KUx4PGIabY653SnPIELNzh9sEYT/fMCJ\nDQV0lLseNM79r4FECcClCxNfGUe8U31UJZNcBmDKEO9c2sHLnnZT4Ps7YDTl\n5YhZLjL6977HYlu6UPHEfW1l4WStxyjk5Z3V+zOvdgHEnNlXh0NbfczjXYt6\n0kAi8jTQ8Jz1etV7KJr/XoQW478LeA2MpWtDHuP2azPmuRoeagrExqk5ABw6\nH+rq\r\n=4H5m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIly2Nr+gkeeoFnkMW9Tl1PwSaeWOGHONiKECumekD3gIhAPivPMx7iecSIGvKZNpJEtoTTyd3ItXHR5XXIeaZ99c4"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.6_1626422748429_0.8735452059279625"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.7":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.7","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"1b804ffdb224b13455031539d47b419e0c15df08","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.7","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-jNWCDuzjBMXpJitd/lvLKMsgvd8sYuY7cCPtBsnZ14ted4h1B8Wz2mz6AiSkBTkQuYzPbi0Dh7kMYF2WmLXQNQ==","shasum":"e003afb89569c6892cca2a02dd9e8e4a99c2208d","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.7.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg99VqCRA9TVsSAnZWagAAEZkQAJXepi8FHqnrbPC9geyd\nVk5LdpFI5U9bP3RuOORuxRB5Wbg/jE2yQ23OUARyVKYskJo0rpNHt5NW1fVQ\nUAB+xTVI++TVVPqJcHeuTeCWSLHvZtFmO6Pr7OXiknELZQDzVsszA16VzRW3\nm7qk7nk+TPEKpDMgdVNsB8rYZBh3dA8K99Zh7uK6ZSGWnD7scCgxOKiyZ5ph\nIcnSsgTioEpKD82RSAIbMjFT7TH5rr8248Uz+NriswJxyCvfcBMBEry41zGi\nbFIJgDJ9TbKhbm7R6rfftw0A6h3NdXMK1BFRaKRivQMM3I7sPJ88IcGwdHOh\nr6c4OYfG9q3OCdtDP8yDp2uH5MrVIQQpAsqTx6XFzxt2MM5jLG02kU2pjqtw\nURQ7GrNIKJVrXZbdr8/PRMQMOo/YAoqbGwR1dLcT5CcTrrEqEUa+Oyy9rbmT\n3Yrz5xYODh6h9vdyoTZSbz43l/Is+qaohlA/LZ2DoV/ZeFUcCKFXiznYLa2o\n0FvBPnVr0p3oqCu1FneTS39SwmUCVzL2mMG/ZnHN1DewftGZzrTD+f3yGHLA\nVlon2aOTG1HUzHOf0BDBqjzO8vX3jj9QvxAc2Xt1MtUCmT4FH8O337YHnDSD\nCfsfzdyacVG5vh7X6bLtTt/I9cxfmqEfSNafLRpHQB/7vN6Zv1MkMWW1niie\ngxAy\r\n=CR8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsr5kKcjBPPdzjkE9oVvT0HkxajwSugfBIh6tyPNWtAAiAKGWxu5qHpnq6w1pGCqA7Wc2IYFh4YbgYFeKq5Tk9eFA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.7_1626854762210_0.041056164201004774"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.8":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.8","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.16","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"17ed50e10433ac7f839204cf32c339daa1b6504e","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.8","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-23ISLXJgnn6j/TayU5U6MOTaD7HHn13ZhrSQ1js1D+zFPlA6WEM1kqJiINN5reuIDeqOD9xUJBWN2LXM229iyA==","shasum":"60f03d2071350a211171a4ab900301d1b4971608","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.8.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+nhUCRA9TVsSAnZWagAAj+QP/3o9SI3tAcaa5TfdbfYA\n7fsb167MS94TIKunvbAD2YVEN0LnYynFcbcKDJFJrJQe0JLWvCyUTxBU+E6M\n8SRhan8XdkN+cBH0xrhSgdBKK/dFAOffA2M5DIRSGQKtwASog+BayCpChLRy\nb04sIfkND6cngr1hqSeMCLNHOl9a9Rmt4jDWgHhp2meURaUZ8vYl4taxTuDK\nSgcNt801uXp44cmIB8bgKWJ+EVqZXLznoC6fWTkdXv6EBJLKzEB9958GvUcw\nWrVgT6YbmPx9EDW0iLfIjP/KPCwdSyDrgrRD4pLA5xXKtijQCAlKXcjxTLXI\nDRWNRVsMIq5HK17U0+dVW9gEE2pytvrApFUVjN0pcePGEUgv/Fbf64FCsKY7\n8Q5YLJ7RujT0Puvtefoprs0R5IQQltT0a04KCvjLsf+g24Zj850fX85M7FK/\nk3sewJUor5EtqieGco821/aC91syPHsSfZV1BLe0R/FINpVEmdEXxtPezVZg\n3a1LxdmmQgHDamYXt8Qv6q6Nn9nW1tphuj/6DWUIQb3apTmH2rvyd3mIi8fX\n4aAgsAaG3sABdpzw/Zq4q/KKH5v8yuE5cIzoFmBN83w1NdR5WTf/rkPIvYo5\ni/ZXC3Qy+5VkvwM+tpU32V1g0g2HnuIDtQ+XxICuXT9xziExRt3BQKByt8/5\nU2/w\r\n=vekY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfQpp3NIGLJ5efmECPKEBBCpR8Jh2uG/bVT39BVnxn0AiEAgoykkIyFMayzRFp6FTNGFI488BH5nJoVLyYTWOvkYd0="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.8_1627027539805_0.6786172806230815"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.9":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.9","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"fa595b78fe6536960144541d27597ec8f52b1976","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.9","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-/wiiPhwkj5rNgrLIlEn+4iLY2NqysbGM8AQqcRRC3HsG4AuD/GxWjmnBdIIPUeOtrRBG+yPkqFqgNbvQzvcSPQ==","shasum":"8c61b131c8ff5517b2d051007c7394616a2dfbb2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.9.tgz","fileCount":1015,"unpackedSize":4408217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/RtCCRA9TVsSAnZWagAA2bwQAKEH2SoF+phMBeINj+Mg\n5lckxTZ8wfQDdKPdnmYSqm2u8WJyi/lmWLF7FImbxtZ+XufvkOhi10dWQFNq\nG1q4O9kFr62mFZvJ3IfiXCq45C3jAdqhqZjVjiAPzNlLDaF2vQFWIhirPMtR\nbbWn4qReWcDSn7iYyYKOCS5dW0ZcSxs+5iD3zaDV2hRJglL9XxMnGvvLgVdU\n2p+TBeBu5cFCQDoL1ratFd/SwOH5BRJds7bV/SCI4Q/PIUJ+4uh5wgIGUR0+\nNYcrECkQ9lDwjDXy1NT7q2csiRFpLhjd8QaZk6/1mp+EpXzVUu/RZMV1KpUa\n3QCmpeMw1gbLyX/WuOanxUkUgoH9RREKicmmv7KhdUNwcR4gagOFyI8Szhx2\nNax2e+K+su6bKrJz8Dd59INrY/mI2Jb65QBhE+11k/uWwMGNnAXt/Y2M4oD9\nN+0W+WWM4zxYrMIQ4je/YoKUMbVJOx5Pu2xJ4BlAxFEgjchFEmSBKZy7Cdc8\nPk7u7AfW1rCj7ec0eaRN2Uqq6qkrb1s9sfrNrqMq8HXdLflMfK1j5WonWase\naCVwLvRptamMvq3IyLiAVR8NQuHVqX5lfMLHXirJmzzvZPsvBqfbUoe9yHFm\nro0eyo1zd+nw95E4z8xc73udKSYZ5EMQACUsf4C94L2YB6+6V1SEu8ao8cud\n+Ny+\r\n=HhAU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCT3rSyvdaLmtd/ruNW9KyukJmoGM9Eq9RD59YwwCdYRgIgeZ82TWsQ1qZh2LNroF3Z56WL+x2bY4md3ZqZhFDT8c4="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.9_1627200322123_0.1454392355856866"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.10":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.10","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"a2aeec5f89b2eb7b0af470cb09073702932a5c0c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.10","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-YNql/TUXwBw9mu15ODHbZF8c+GOfrpNHOGQ5ZhGaArX8DQd0e1zSFFdd8tdIybfBHxeacqesFZn7cAHhiEXNig==","shasum":"bde65251d13bcdf1fc6d245beb3e4d7a11c7356a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.10.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/75pCRA9TVsSAnZWagAAmVAQAKJVxQvHAZBmW3wn6r/I\nPFr3j4oEUdTcN+qiIpOQuqF6/A+FAZIQGre3hAJ2i/zSkaHpGCgIrnnLegU0\nQnm1n8G2jds23SKU4brJ0+z/gUs9zb8fIyoNYW7SlNWdZwBbp8UDQyh0xBDk\noDFcq6kyMuPDr/ESIKeVBxH3c6RhBwokczmRQPjV1HY/lCAa9sQNpILnPs+h\nM1oDz15xQ3P4ks/7r9WyTpX3AGZJX/cvN5krgr8m6CxqNq/VsmrWYlzOQb60\nIGfCyCKm9ltFOZhYxPtEJjHyXYaR0bhPifk7uxAVFTvxhjuDqvyeAajR3JSM\nlwybFgiag9+zvYrsemLi27o/l97u7329j9eBh/pee/+evcxlWVohuer//u0r\n+xlHGDWaojQIRf5xL0PVZA9NZz9oOwz5C0+TO72efmeZ7IOSMBOnTIL/LjWg\nI9/nei53KUCyijTT2ISIFXcgPDfWwbDs4HQIGlNRaTQYdxW6IyoaE9gOyVEX\nRBsMr9uQGEaAuRN0n2QrQ9EUTQ2jz7CVdN2ULcvGP219xUHWUbFJ8eY0FFYG\nCC1r5D3PwfJQfiE6JZKwmW5bjflLnDSTLpLV57NvC1qWSGNBfUcZQdIOLNMc\nwN0NceB+6vFCzXPLxd2XfRtIN2jkZwJtAyRZLHDPD3jJBeNHvqEMmGYNUCdl\n8Vb3\r\n=9gb5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa/9hCMSP735mAGfYedFQz2BIGxSRmt+WbD+xAGRxpNAiEA1QPKrL3xusCR6rk0ExL7zA5I0giWmMSFFGVyWZcUzjA="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.10_1627373161355_0.7268422170070721"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.11":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.11","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"7dc38d7f89b3231ddc11a69be03a0c40cba045f6","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.11","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-RXGc9cmc++l2JlLmblci0QIR6APu9Q3vl/iMzqdpBnFRO/QedvOKSbU35lEV3znADKX7Jjj+Fm+dyc3p4EZrfQ==","shasum":"5a0a75ebda2c59536d1149ad548441ba54a8f17f","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.11.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAQ/nCRA9TVsSAnZWagAAEVQP+gO2Rm530xIiLGtnyIRs\n0mgoTrqzs09avUt6P9MYjSFFbcASthew8BV1/2Hk9mqnVB1nUcsm7f7TC86N\nLJvyaLT6EJ1yFoimzzBG/RnE/3FI+DfpecMaruAk7odGLjLJ2h9CCE7QvYJ8\n2LuaxXYVnAyMEgWgqAtiWpYmdwdxbg0MaHxIuGWKIlNdAMJAkxIbuvdFYpqy\nOYt8rEoYtVtLq20BrONSH/OHCNoVqXLzyX3rbMXGRB4mkJntRG3JBkpcPMOi\na4OOFxt5mGYgGFkoxZb5FI69lIM5GJHXQ38EhvjAAe3L11fcYGmbtVYPVUKP\ngvxOy/iMw5elszTVM3Vijxdr+P5MMsBoKp81eZlNwFh3nFnPjSM7XFQixi1P\nYpaVrFIRc4y2HGmFgdvEazyf9tIvhpWR5OZ3/IfNYdzEp4+i4Vrdq6UsxwXa\nSpG36Muy4lUyZjCH5MpBj4oS8ihW27sqJMPT4cS0Srs8c/R4nVRu1EyMJlco\nTT4J1KPY2MSR0TSlCtw6DSjzg6kuFX1ywEvLLaBaKp+ca2vEkLOVqA5jjkJS\nJz3RLT8SSDFn3JFLxv/v/9zzabzBli8fvSjj1gppbAI97lj8r6pRvj1LvAVE\n4f9RaqODKF5pCZvtcnQyX2LHHoNlfnwesot03zHXBMV36hflOJ3D2yY7z/yw\nrcqs\r\n=mvdv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCH5pYKDH3ZNhS0ld8LEGCEXhgIhSolgLLMrcn4o4a8eAIgUuvN4OpYnjnT6FoWmooJwBKIZn3AhGhK+7sN8Pr7xxs="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.11_1627459559328_0.8101092982309284"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.12":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.12","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"203362f341f1928087ff3affb066b1344f50aa42","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.12","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-HuRIjwrH3w2gA/EPIPz36uIRcVRdcUcPKOngFdabVirvT80lWtp/vdU6vYaCENbKHJj+9jRw9KwYZTc5eiVx4w==","shasum":"80ad46df4a6e4b042d7a1f8c926439c8a67ff9da","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.12.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA7MKCRA9TVsSAnZWagAAqvQP/iV57/dH3aUJ5Sjfmarc\n2aQtDI4o9lD3SOBKXc3DXLUhuyRBzrcXvRNtmNeF1expiZsArh7hS3+NO6CW\nnoxWHVPrPDMbKe8tMe3aUiQxKCzYVuNUu8u4VR6hUIjcR5bPAdRYcc6dv7Qh\n3Jylgp1E6sEoVfnYUW7n3hJ9Z6VhzmSyAWe2WnWC1xweW1reDhQjwtztU4bH\np3cJCExadmSLtwMyGUlyBmfX21hYxI5Gw7aVeJebHjgpFfL+TdP1NWkQ7b+0\nJuXFwrMDtHSR9t+o/ttk9nTf0qnso8PQtAxdawbahN/pN79TBNUwikV9T51W\noAK9FmXN4oX97122vdanzrD9H42hdq7OuTqaHqfliN3vo+KIIgu1RSThPsNJ\njR7p+BgLwNoE2mZZbUzPKXq7xV+Pr3F2aIHiN6xhQQtIvAu+9QgjcLS7uQPM\nBwg2m2/0C1kJ9q7KHJw2IViZwNieqF4hNX5yM7AtHKUqzxMhshEZj4nwP+AD\nPF9jF0c9benCkOF7ERU9dz1pMwXTG9H4shaqOXu6Cm/UYdu7qgQc7/7wuFlo\nSvhqxgVt1Q8Q1t1ctng/4bcAYMmoptv94G25s6ptxixIcYwA9SsIgPCgDb+D\nW7MmNwYVdQRnfIK9tAWKJfG25/SaRqb/43nW9WP8vaN+hwc77fHUJfmXJFwj\n28OQ\r\n=6aqK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGux5ivbI6o71u+kmH7cdSO2YFkbpqEqlf5F9PGh+WyOAiAL7xFTUEtliF4O0czSgk+xovgl6wUj6tEflx5mP0b3fA=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.12_1627632394119_0.19362842954324466"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.13":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.13","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"270915e2dae71d17ab84f3434e8d8530cd8c19e6","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.13","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-YYqsKSQAAOJ115Xspxsr9VOVyPALm/ltOsACU3QvZV5f8bSmeGg0EFtCCaXggpdyEFCgwqrjz4EIn/EIv2aXOw==","shasum":"a97e53fe8607026dbd371ae9671aede6ba4e3d0b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.13.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBQRtCRA9TVsSAnZWagAAxgwP/1bHKmj6/zLBZa/UgRxa\nmi5Vp3cUDCp0uVqtTzQbBl7JIU+Pa2MjIFI+ob/z+K4xS8lgdZSL/NNlk0hN\nXiSrnnA5nJOQy08HFCaLkbt+gs38O0R8pNNlxSyRe1wKBzfTc32nIHQ7RFlu\nxgxyBhaMMoV38cSsLRRti+7WREVfNumhfXAcIVqFcHZ4wioxhSkcR+MezOf+\nPB7Zwf3ke4rlvYSaz7wJyt00v2m2IoiclEd9D0oHINiTwrBPe5fWifLqbqTm\nS1gtR1uGFxvpn0BuW/Qmf4psu/73P2zcrP3FJIWTYfW3LJ1XwAF18YLRKEIi\nKZJCGu+pEFtxxGFaKfmDXZjK28Nb5fUepHg2mu34oCu71HY5BBvXcWpi9Iou\nGtJJFZ26gBrHIYn4259cSPgDDq9IN3Itw2g7QsREcfUgrWy9HASSVx4KVZGE\n4/oa1PlOxFQTdY0GJEJLuEMhtolJd9e4fyq5GMthZ0DhmFQr79rfZZRuBouw\n8HEBoYXGJjU26NXVDodq42YURS1OOCDnRmmyFYMHHgQmWawEZeLd1awxn9Pk\no/0JW6liVGdvVSsFupGIrg2dPlIiyZKS8dUEuPm5P7Gxz1fXssO1zQq6PZDI\n2365tbnZYQK+qms2ajABfgFa4JzJQqXyLqsvy1O9wjLUOzt1Q3W91/tQrdHQ\nI0hH\r\n=KXDu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiREsmSG+/iKwOgk7RqDVVwiYhZtOLAQpKEjHyyVnMHgIgYniTTX2WEUawLR2bFWEwLMzj3sIvkCEldTOQ+XX65NU="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.13_1627718765439_0.993255192183081"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.14":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.14","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.17","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"880a7d21b9fddd3765aaed9b4538dec568d04461","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.14","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-/rIR5oLDbwRNJeFsX6KqG03uFwR+VRztwHkRY0Rg7AMYJj53Qeuy7E4gq+9pCAwpCLSor9VYZkqZF3XyyIROIA==","shasum":"c2338b74efac85c31ef9612ad66bbbe78b11454a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.14.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBlYSCRA9TVsSAnZWagAAN+sQAJ7tA1WnVWdncYvrjSSD\nH4sn2JQutBBqCkFVLwfCMOzLopFDGGJ786bh9qTFEXz1Yw1Lp66fcs3Q71vv\n4/nsOa/HEXhi7aP7iJjSshcsbiMFMMlExAau+EXMpYVJQ6NLNQw1aEJMXtC8\n9LW54xxkMoiXVGF+KOH0q50F/HdDkOyuYME101rinKjDb18x3oKEhTSIrmo7\nnTBkp7Am5R1VkGA7LSpQ46gY1k9vOKespQIcR8UeI5IjGXigy5lCBhuWgPdd\nPPyAG/NyjQr5OLPgdxL8IEpOMxZV7w7YrkClhDpB+evqMUUwduDTze+cXBgn\nQzszAU6i3zfbZMCfss0ghH7TEhFitgQFD4A0gqmZNwWk+tURunlD1Ij7ntbY\nZwYj4G8a5qS9nHf6eITQyIlz27MEJ38xNdx56dEzZhj17fduIRN66mrhJyxv\nwfvq4Pw8mulIXxkJvMVbj1/5CrF1SfUho1RWXPzISFGJ8pzJvPF/zz9Xw/b4\nwohByH5HSgLMoID6tk3K/X2UVcnHunuZRJ9s42ww+9xBMAwb6+ZoQ5Xpkhby\n2ANzPpGN/BcmkkRnwxkZ166edYshiZwp/dXvfgBIypGgNLXSFiPYff1ZoCq+\n/oFd0CpK+lHKtRSJcq2MBgZjODM1V5snjiawrmxzy151N/1G4jMh3rmKoSWT\nVAqU\r\n=zYY7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx3eWYBEElVk0pteV2GqgVdILxwv67Y+uOdTkCIYVUygIgVfnPsSOgoxM30nB2n1M70ZPMkP/tRBsJ6zZMhff05oM="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.14_1627805202130_0.8476185036597332"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.15":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.15","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.171","@types/micromatch":"^3.1.1","@types/node":"^12.20.18","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"18f6e7e5fca0306461edf13ae6487c6682071d2c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.15","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-klLak60rjH9OOmmcqkuBFUyRLzZgmXpL3ARfh74jqUSsvA55Xyy6qmTy9bJfYqolxTb2qxkvrZ2RD55ezJwT/A==","shasum":"9f3f37727915e4fe5ebccf4fd13e9fdb61befc23","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.15.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhB6fwCRA9TVsSAnZWagAAcM0P/2Z5JMUCV66zgbj7jvmm\n/qEUdpVe3rV/H4pyrjTyQx8e7RZPFH7oEmTs1vCai88fRL/tKcfQVNI/+cKc\nJhEgcj13A6jSXMyJm/d82JizYsAtyUdwOt3CS1tRXma4meLRAF8XuA6+bi46\nvWay+fGnOY64D4tqoPOBtfQxLP+V0dtw7fZhg1cVdjlFZ2BrG5AzYz7yohdM\nxDiUNsxqoy2dnZOTB02+rIx2elUn/E94NmB0fioYA3BlCxM2gs0qP9bRz9M3\nc1W6ieqJ6H37wNyXGzrt3eKoPmCRwC4DX1Ym64baRsjzRnPP5v3/cwvsULce\nhzYrqIdateZvjgbmoBNbAlI+rZQTMO9URlPCNOHUcWxgqSnLSEI67pqLVPyx\nuZ7EmaM5BPo4mCD7Kn6RL9wNuvqp7SJ84FvTHSZYfY29Yt77i6iyAC9bz7XD\npJWwFiz2f4KiJvjLDOnvekHUqoPXK6rkC+1FYmL6JfjcASGfXkEAv9Ax9O9r\nc1U3QDY0jNjOJJ9WJcT58Mf0B62o7Xyrr7asC5Y6zBVbUpsykJBpLREJ14gW\nKGccwzciYgKpF2dYwxA7F5QAus+/uCFfGv5lg+2o1rLx9N5xyy4/gq2ItS1g\ndYlFQlQ++XQJd79ImZrHUzWdiyre+yGnph2Wt5Sqr8XlUvafO5Y3swkEPIUQ\n7u4v\r\n=mxk6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvQm/c5U92B5OvJvvw4VxEAILHxSrXBVTKUrXr9yvVgAIgNXvmWlkcWt8iA3FP5Bqw8cqtjbYmJneEYNujLilTS0A="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.15_1627891696650_0.006205040060899947"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.16":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.16","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.18","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"0938535dabffabbb3195aeec5c98f52380e700cd","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.16","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-NCINTMt7cOFR6C3KlcHl8DV7elvp6d3rWqebTuwOJI1lqbhVMLCazveM5a4kqLpmYYY8leRngoYzB2HgpBzkQg==","shasum":"a63b0c0679ff01ecc629d2dddfa03c6e2d34c8b7","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.16.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCkqBCRA9TVsSAnZWagAA0QcP/0+8Hcd+cq50+mmsUOCM\n73tt24Tnj5D2FKfXqbyj3DDJ4khcJM1mCnf4KZyQ/mXVYn0n9dmusWSiYi/F\nKvL+jfNpBHRvJZQgccrcIdrIuN1Hi3tKKl1wgLx+VvHuSMAZB+0WztkW2hGR\nIt+BJ8TuPxtLidfKX0Mf57r6D93j3mVxQg6l8Oo2Rf1ToIVHrseOiOYl4edv\n/7MNT/Fi50vm5ulsxI0LpyCHpSWYQGv59f4sRtD+Ono2bD+vwKHqj5NSLZiO\n43jv/SPUw3tMHxcsz6YDxjuBfBSN2Sahsit6h83fiF8NxOZR52oaqIKV04Ee\nEpcb5dknn5Wz6BxtfCVo7xcMFp5O0du7lI3+CcE9KHGUc3cMkCScXPn4aXH0\nMr6iqOEtWN3W1FXWsO+WmPRohLV9kSp++eM90ZWtcn9b+XScUCzHSgvijhmF\nR35K3yFWvA7lGm0co49I0yUT+Z9LkY71jr5MZX+rYG6Gnk+Eepm/eaqjZ5aB\naHY59bq/iSVF3pPMKP+Cy2VtkIo9RdOwOL/mRTvq1naoG8pdK6yALGaM03Oz\nY2GiK8Yd8+9ShjDP2leVssO49gzCoH/TmEx10/NAnwlULg7rweGCll5AaE+V\nGEYUZI3a5lDREFh5kVsr96dLz0I6EHges8jvjbFShnEVgjTbxSUaRlKlrcXO\nl1K2\r\n=QU7I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfqJgUuU8ExSNzOIJ8ECR6pl9QECpDlfO5ofyq5BEbrAiEAvM9+chmbbFxvItvYyv+XYnw/N8Zctkv0xyZw/8S2I+o="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.16_1628064385678_0.08935378395456017"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.17":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.17","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"9ad09a58a89180fd97365f6b912051ba178de043","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.17","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-OYhc75prJbuE5ydB8nt9XVcKoZaaGVBKSEof84Kv1MIAbJEEZ0D9kC44THEvre+X8lm0aKogLT5vRfVprmdZkg==","shasum":"632b9e24c1db5ff2fa3bb6a6576b554a65108106","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.17.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC5vtCRA9TVsSAnZWagAAo9MQAIAckrFOoDx4npWkEcf9\ncrYd19Wq197CkjMq77EZDW+bwY7s6dAgA9weEdldDybvJLEv2fg1wNF83jhu\nFQES7n2AeT578MIr8m53vAngrplWuFludBtW3NwsCSttpn8Pq2O5QCcQVYGD\n0eMu2mobHyRatLo3D6snrWfsgj2WjOVjKI4f/kjz5h/XwHjNwosLyVnAb1Mr\nSUuMTTEYw3R0IRKEJVZS0/EEeQntEbp5sPyOvwJ7Y33OBWbcdez0OQlBLRIu\nyFd/obJVvolUyLNSx2ODmC7e1xGHhIg7Ux4b30DLb1GAnbMJadQCa8bEiWpU\nlXq1PLoBT0V2Km+MHSZhc39z6iix+bwTc8mCItuPzOlzIQfaU5gNT2ejFqxE\nfIRFLHphrQqxtW5R0BgPguVooUB1cuCaJR56uNaQkYvZLwWK5Oar69VLNbT6\n2FVYS02ALNE8rQ4/ui5lsVcDTjede7hneBRFYAt901yZyImVGa+zUtOl8yPW\ne2IFukZ1ynsFzUWOYNQj9dfDCafoTem7YeOyiJYKGO8cFs04Tw8ptQcrf7R0\nlbRFEEoRxzEKoSM9xIyHfs6vITieoRMht7uHcZL0iBX7R6biCpXTZ+rENVr9\n8Jy2duo4mZFRR8UKEK5N81UjDAa1bAQNSaC7nTqYyJ7RWyMrOZrEfa71ebHg\naQUl\r\n=TM8D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQziZ6ZZ3wPaB7+eVTviruIZvdHn7V7DTGRTHS5c6C6AiEArjcY68EMxN/rJH5WCHJXjLr+0irxnTk/63/Nl1avHlY="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.17_1628150765675_0.9754543061006693"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.18":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.18","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.2","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"c33aacb4caf53bb9d80a845b40c075d6983ee0c5","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.18","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Oz2zb9+iWPd/UbcB7HZgb1zu271KfkZEqmWgql8YYILmTQW7BrBfjC1oDD8xee/L2ozIOfN1xw2Bts/HqQns8Q==","shasum":"0ae4a1a4fdd947ace8d28b165c0309479391b3bc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.18.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDO1RCRA9TVsSAnZWagAAJqsQAI4VgzgrUtAOoBaa1P1h\nKr85y8WwS+XiiCs9EEOtFFsEwR4rhvaprLTMrhtBGAY3PwZTsYtwdz3OqI9P\n/evuIVqnqbHei9aSGbamVA8JAsRo1FpOJHhajWndLXm6ltUBfkEv1lNlxACS\nEHaahrbGb099gLOT/iXUA63G8xPIHxPkqIes+SHzMdOgswVAn9uvA77Mem9Z\n0CZVwjR+D9Gcb/IL6fNf1ZwM6rvio7DJFDqfEgsSKubBc47jThB2RECGKcg9\nzrgO4hqPDcfla8xYJ3Kgzu/Ta5tgHOwUOSP4OB2WjctWgB3yTo9aMFIG08T9\n/tCMULftFq7M6wM3RJYdOxv2rUVE9QFjL2MFnVsjIt195p1hugQzs6kI7aKs\n0K0SGzYVxaFd8acZQX/uH3acpVB0nTglDS1rV5vDf490sVcHESyH0eZME+SZ\nK8ilHFRMtLz5ELW7i1cX8xi8SazVF6aQWHzTXP/OUK9aIJtfytwIu8d62s5L\n7oVw6zQHqH2Lcu32u8k0X70651ALYRE9U+bjrYsJrTm5EDfL0P88N7TEg/2x\nXsU07mta6Yw5K/eD874QbQMvmSMc/KMILWNKjph9k7AeX5Uw2G3oOYq/loip\nt5m79zve1E+sTGHYAZnrV208gP1LiyJzuAEDqGJbMEApxmECj0Z0Cb2CNZGl\nzS4+\r\n=U4Ek\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHelOhybtX5bmsIf2bMsNur5ZpQXZMqD3GgbN5gVIotAIhAIDyveZXrusEksn8z44GmZCFlHIMsncDP8JY9LllobTU"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.18_1628237137240_0.998306693543918"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.19":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.19","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"6329df920ebec1ebfdd3d35d98ce16681811e7d7","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.19","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-0Oceg9xr5HqDz0rdOZX69VBungVTfV8Mma0KrZ3I+ZLOSdfq0vr99UCBwkDn1WTm1WdimZkM1bMM4edPiAjI4w==","shasum":"6ba03a0bdc22e4ed213bbe50364f77a185f1340c","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.19.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDj7uCRA9TVsSAnZWagAASfsP+wVoak3XW5zYhvmZpbgm\nRpoksPQl/8egrxOCorlQlGlQ/n5sKPO8jubTHH364iS6wCpSlqAoYtt4ssWu\nGDP9lxVjem3GxAqxEDUabnGteJPmMgjz+SagLxKrEARTVNW0NlLWb1514G8X\nPSdsgCzwxHRoTQOhfLjImfBfHMQdR0/g63z3HdB7WG1YGnY8k7rsbMYHePHq\njaMSwu3reSyRw4xQM0BV9VhCw6Ij+IjjjpIsd4u/OUN3n9FyINGy3CAcj27F\nC+8zpSgUeqEtJz0/wQklNeqwTMBzezYmvGMc7fljiMhzy+pHtccQQ4Huhqgk\n4Bg/rdcZGvyQzHGnTbIBi+l4eoS1JsSIeXr2kPsG91jyw6X5GYshDRtwZL/C\nlzMBGuozX8IObI2Pgv1RgCCjlq/ZcYGvs7ny0ck1Otm7mUCgDlFinJpTUgG2\n+Q/+ZTkVKBwHQFMWH9ZPyU9OL30aJuEuoc2hQkv0VXa1Vm/D+mIIxdzEFhNs\n/LYjlRpTJbVWPRvEAapcGVavATahRvq8FDbqZm0d0TRV7G6gpb1dJyS1vwCg\nxr0G4PC5DRipru9yT2I2YCL0fFEJs77JvSPwE2quHc23RP3buNq85LIB20bW\n9Rz0V08m1CafK+xUFbg4EC85nt8tz6H+pbPABBcK7nl06RBd0u5XLQgMuE3l\nQeQ7\r\n=1dCa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEAkmzEuoJtm+jGgRUZUYnBh6qO39g4Bm7seUjgIrxHEAiEAiFN57S0xZyncEauZDBoRMFwXhU5Dq7E2A7dR3f2Lyt0="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.19_1628323564722_0.1537153340389139"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.20":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.20","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"3f0195ea4397aa428e9871f4a0c05193cf7991de","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.20","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-7KfQzetyd8tCafpurNHEkKHtvG2aZVREeidpvwbrRF0H0T0UM3Dewfp598pBi+v9YrX15sgxQdSHVLCHdEdqFg==","shasum":"e4ae54f6430de219e15dbfc437edc32dab71a3ef","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.20.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEOHKCRA9TVsSAnZWagAAORoP/3tqEobbo6lQMCLx+M5c\nINgu2/NSJ7csJ/VzdQeA7HdffZFa2fyhtr6NZ2euPDPjULgFPZm1dR4+aqI5\n1wRcmnAd6Lw4OLDXdB+TpVaHxBVa+8CXIUSa0WsPH6xvV04xlkujHtTtCzxn\ni8cFyIZI8WaBQZwgmIGgl2+4JITb8C79JNAR4jfTb27iWXAR8Z8MkmYlG+B0\ne8AV8e/PXPnA1zLUw4CxvNwyQQcVRzErGnE0/6DLNadlUggtLxeoG1kQCauI\n4RaxsGdYRopb3e9yPzmpYOFGWPN9m4rWdYfpojPJ0mbI1Lw28R5C9vH4v17c\nJN69Z8SJ1vTK4sutIN5GMUOxtqXmI3KFK38cl4BNP4VKyhsJEZqJEPyaodyl\n1SLdFw+FseoAwmU5xyEYLF32a+DMHt5HJIrZNap+BhLR+AOqTcdjXzN3atcT\nSwLELfRHjFfVEEg0MdgofUHsBjNg2rX/VshgZ4ppZMjWZ6RZx6su4L3XRmqV\neRAlzZQXDyLRp/oqerk5cTG/gGzCTQrnxjgP3IInTli9+CIwosJVSjj5gRuI\n5OJgMB5K9A++b4h2YwXyxNpLiJ6IAuv6g4c1uvmab1EEazh38bbrVsaHDIhg\nwGYDQsYj2ER2XVp8/sPc++MwX8ogJSoB87KjFzy8Tjv6sCsuzuxL5Ed1U65v\nRocH\r\n=O/zu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHqiuZOwDPrQFEfCoeyVm1A3qR3nRj/BPskfTDwBFFIwIhAMsS8A7dJzXmk8m8xS5o1F+fdR8lWLEMx5rcFQ4mI8EZ"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.20_1628496329892_0.47961792456882835"},"_hasShrinkwrap":false},"2.2.2-main.1":{"name":"@atomist/automation-client","version":"2.2.2-main.1","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"593a4ff58693837e3c6444aad4bc7fd53e0e70cd","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-main.1","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-674eE6SVB2Gd3aUD/K616pYsRJfGFsbOl+3NWxyS+vTUrlRxKdia1q21M8unk0Vh97o7bcpS1p8YkwWlYOH9OQ==","shasum":"750a873cda0d6dd9daa0299c7ce3419bdb1f8eea","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-main.1.tgz","fileCount":1015,"unpackedSize":4408190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE4UECRA9TVsSAnZWagAAQUwP/1PgNZNf1dIBlNADP1jd\ncmIBTBO2wguBdxci9fcxqxF3bx41CZ7PiZGBt5s8Q4fZapA4W65JRjGYaDnT\nHSW7l/37t9z/duJswsf208iW3f0qcq+HXsbAkmh5gvvq86HD5tfBG1cEQcYu\nNViwZFyGTQ4aRDa2TIhTFLZs62VTf166VwN/y2JfHE7bflBIQ5zwt0r8NOtz\nvcI88oMvISSIID5Tax9sFFcF5LpIx++KpXxE3MlUR7WyMmZmCUqJGVKC8L1T\n2piS1J1TntgHNBTLsZVaCkPzL43+DAmmhSf0EU4WxiRMuXxKq9AOdGDSBqcY\nX980qLH2xjhfa+ScSCouYkigY7AKoDLGbkQ5zhhzQrKtIDbHydCE/z0rs1Om\nzc2CbUTmg9sRElYqjdHpsjqyUEBtKdb8zE+VurOVyvYQ8IRw6mXzXkiyWsV/\nsJPoKCpF+x6bSVqIe7auINqUZSQjCkzy8min49hMG+FzP6j9IXwPHnyOnnuv\nmsvUxq7n5s06yMUiUi0c/SOvz3ZX+pXtLhciofhU6Vb3TA6KH4MuBSaW3gnu\nWIP+YdEhbL2XuKAa0tCY7ZgyVYSWLIC5gooZ8nP/H8VvOy+hPBy83oMwy2TY\nQMNiLZz/rvvvmbFIyz8hwbH5A2spHjXHWz3WtFHQX57ebR3Hee/ZHwDA/NQC\nvf/a\r\n=3a0i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHC1OZLg4YK8XWbRnKqbHyAuLr50VMVKlZvRiweOFQuNAiA187bV1BbyoG37sJ27359uVo/3MLKSlNSPQXMHYmYdVg=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-main.1_1628669187714_0.5679029145591199"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-audit-main.0":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-audit-main.0","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"16bbd46819cd68e3169e1b9a5771ac9c1cccb122","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-audit-main.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-mSseK+fpWZgPFryMkSHg7m3+iH3FK144Q85GiSMEmuqJ1BEC+qboZlolkk4XaIuQPzsT/kCdxV4u2u999iaxRQ==","shasum":"3298cce5d78b99453d3263a70ccfdb88f80044b2","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-audit-main.0.tgz","fileCount":1015,"unpackedSize":4408215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE4VCCRA9TVsSAnZWagAAN0AP/0bgH9SZHDlU37AMU+8q\nrNJls68uqmeestPoQziE1Wc7NXBJFUjhSYnpLqND+NES+1P1OQub/EBeXKuu\nFKAbYv6WbbZ0Hq5AeRvQ0ePSkvIzYRdOAVxBspIzhspVFrdFZNfr52bPLiko\nRPJIdxFRl128ZIimNMliAHIZ5NT4Duqse1SSDo3fCIBK03VccBbrMcgv+EAx\nq+/dFtfJmbyOk1SHBs4yEZZiPWMUrvcyK4xrM9+Zr1vrSSXdGng1SomA1SEI\nvzOVP6xoJpFuCpz2yL9cjbCdOrOnaUG01maJhMo7yDCrsEqSODOQuWL85u99\nzgTJ6vSKAIYmxg5RHwYSulYv0VWyyWslscIOQqZ7cLaVpQs9yuCarVoilShg\nBmWC22d44ePTnjXlV92Y4ZNhtLKwGWG6XFWOcc4RiP8VTTeFC25tVxTCpefI\nqiR0elFQ5VLyI9tls2SZ5epEJj4deVl4L/AGtfKztHHK1wXj5U3CSh/QZwGG\nvdRy0+Wyph0+IDRp00PH6EwO9XIG5xs1FX/vX3xlgu7vr2o1LdS0D9kWDf8G\nyQQhGcj0GXfEIHZoXfVtwYVEbN1Ia4AQYfpG2CxUoV6GhJiTSyZcKSs+pG/X\nRYozVQJY+MxHMPMV7HL/Ex1dOUmTZVJ0nMUoDdcCQMnelcQ2I95OvbJNGbCu\n4Ij+\r\n=greC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGVyAUlXb+cgdoEfbldtCBGmyMOXslMZeQLU29Y9MVNgIhAKJy4aYbpVZubhrNGLD5G38Gvv311RYMZTWwMpG/ZzJU"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-audit-main.0_1628669249949_0.006427008767770692"},"_hasShrinkwrap":false},"2.2.2-main.2":{"name":"@atomist/automation-client","version":"2.2.2-main.2","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.11","@types/fs-extra":"^8.1.1","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.168","@types/micromatch":"^3.1.1","@types/node":"^12.20.12","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.6","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.36","@types/power-assert":"^1.5.3","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.2","@types/shelljs":"^0.8.8","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.9","@types/ws":"^6.0.4","apollo":"^2.33.1","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.1","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.1","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.4.4","graphql":"^14.7.0","graphql-tag":"^2.12.4","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.2.4","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.4.6"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.1","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.6","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.36"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"7337040101f5684a82d729fae07ee92a88a9f9fc","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-main.2","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-C4ExXlLK6fhjnlEHnmE6jMnqAd6Kd/q+NMLe1XJSy9QdvZsczosuS4Zxc+xM5BI7TmdxsWL67HirJlzuCJrSXg==","shasum":"267c8669cc8db2cb8dcbb8d4af77ac8537a78362","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-main.2.tgz","fileCount":1015,"unpackedSize":4408190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE4V6CRA9TVsSAnZWagAAhy8P/1rejse4VC1hNBL7JThv\nRzdfhh75yGPmjZOHRpQmJESHrgwqMbKINavtJJ1n3fjMOZ5yp2b4apOx+YDg\nQKulQCMnS6s5zBR0ph9RlWZ9DVx+VxGZ3ql97USC5aGL55xWWLEgnF4mGUXJ\nxsmuxa0oVF/cWaC+frCS0tIHTggzKhDmfGhp1bM8Nbwe+X7z2PgMd6IAUTEN\nG0DybNZl3o3gW2QHDYZPinYH7wafOl54oH4vY6kK47w9y5qWA1lmjBnoauWW\nVzhp78iZh+q1K9qXhgyxD2/HhXgC37xNvqqxkXgaFzRSqdPvTLW+3CJ9TfHX\nnNvVM+c8d7TvZF3J3q7Twp4x0CK8WJvgHElCMjyCk2KQgEji6aDiQj0Kww4F\nB7I9XauYK1nnkgr6GLcbdFCg77XOl+lxhZgQYct8fAp/TEECLaoc95aqZSHd\nRmoOPYTXhZDEbPZct/4Hfseq/bU6oxLumhFGshguGBrUJeb02YDz0Gw/yKYc\nuiMB1FnTby0DSg2IADlBPIKVlDlHLCW6bMdJ+iBVJRqoaBiDzocbJGunZtP4\nH+wW+1BJk6/lMB26Snr7JyKp94k5NjAXzvU6wPsQQCsWWR6v6Oos23P1sMvL\nkOeO9CIZfS21nuHn4BydaJ9HF3eaXqhCSC6rh+3R5q3x8LmwvEZFg/Vj1u5X\nqC5x\r\n=6ZmQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGR+7ew6JXNRUJbHUlXFGj1Fds37JCPAY6mZFAyM8h5sAiBGb1l1H2sZp9yajb8u0rVoik9gv1kEO35KKuKtpfnnJg=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-main.2_1628669306195_0.6653266196683805"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.21":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.21","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"581c32321590401ecb287d2f66289d36ac85062f","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.21","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-pTCwVwXF5dG3Iae3XrCceGBh3mWzi5eK3sFeNF4oaRl57Hvl/9h3hRRssCNAkWtfoMAeAYgqnKD1UtPG2hoAJA==","shasum":"097d18a92751acfdc508bdb49965300743663fa6","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.21.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhE4XbCRA9TVsSAnZWagAAXxYQAIsQQKtw51CQPk3eiX+6\nYjrLAZCIhP+TeR17SUnFJ/sr4Q6d2Q2xJmDJOIMX5QurJ14H9BI5CPbNIhkS\nN743OgPflprtG9Bpy1/0wxkPWQ5IM0kv/4EwjdvUtgk1+pKoCed5Ki76PFEJ\nTHmwB/mzcJaJBqonXSSQNDO7djfknkkD7Tpa0uSbJgIznOmDKK7+ZeruhO81\nR0h+IvvLOqH8Pz57DX8usE324MS7Yc2JHxZL3cExMZxThuE5aR19C6ykX3l5\no7Zl+mAKyoh17Yv9FsYNcX2umFDG/AXb/XfSE6i9X59Fizvqa60iUxaI0+Dw\n7K2YOKuot6+m75hWl9Wv9x3QSS92NwGULNWC895sP1JrMpj008p3FIpDrW2H\nuSmTAAvNpucaxNKaJKirPEd5tyLLJKg1PXxS05JtjLW7UupTw5PfRXa8lAtu\n+aQ7H99zRF2OFHin3t1dUN02h9Pl75ZiqKRvCk6HIUjnUztU4Jce7lqvsVFq\nmY9zr/Fzdhfa+HRVKkHbIph+NB8FpnKs4nWD04DgbiamiEaEwHyGd65eSoS6\nrxbWnFVxf2oDPvyWTicUrlBNH09ggb+DrUiGgY6QHnVDOEs06VVc3u6SvZen\nlNC3omV4PgFIvT2jLMiMuyrLl1qmrix+m0acF4gQgmYgk7MPJZzAp/bb5OHN\nbmhl\r\n=kfjb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR1k/yEAdhZZvCQCKlE6s04XnEnSPMXZbRIJ7VvXOCTQIhAIKDdKWnKdulFsmwUI0IIExh6+2QHoZ6nmNIXOOuf22h"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.21_1628669402910_0.1725240793439866"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.22":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.22","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.4","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.19.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"31dd3a01f66844e427966156fdb2aa2eb7c8b7dc","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.22","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-pdVoHhnjLfrnQh1S6QTEPgDYc0F19vlPxtzKdNPzqWb0u17+uYRTmpt/d60reOxTvAm/yFBPf8bCWwiicbyoHw==","shasum":"b7d7474e7ab30f71d964312e92fcbc86ba1cfe92","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.22.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFNa3CRA9TVsSAnZWagAAZVcP/iKrgFz4+OAhQ5yvy64q\n1ex99x6xynh/6Pu3+W1ANe66f2/AWfoO8rL+gyuAaCaxSC5TYooQlBHWHdT4\nu+GjLbiszccc7rQ5u4dncodLqcPqV1Cm3km6EtNhp4n0TGlzILJ9WDR2/pIU\nCeJMXdA6cMCXaEtqqRbl3tPcIB54qSHd5lq6jwet5IWK2WffhfTDnGZQrYHH\n6/XsUmy0jVJ8MWL8S6Eei4qgFxi50kQK6oGRYjaE42NC+zjGSZ5Dt6+QINhp\n7A9Laj2LNleq055Mdh22VHQTXabi+0rSA9c1C1gl/Nqo8OkfTcsI/Z5eZYSr\nkWvQRFAX0pWo9x5B6yUNOILGyKFoCSqR5qaPl62LPYOTFxKXeXrLL91TkPSH\nVFR5mSMcoLb+0JzFLBIPomMk9vn0qgjG20VF8rdmo+RkcRuAJvwDQYTe6D0/\nef+UtdNIj0/8Z0+1mP6KcQdBNXMCQu/m0N4NqT8ZpPVOe5OppIglBxFrTQlA\nLlY+vGrtlh/wR2GLzJpOOdXi9s5/yWxalWheZMFSba/rIKho5AVbdY6sXbP6\n0UHNPKP6kYtDna3v+d6whTd/ZNRA8v8x7Gb1vHkJoJqn6TITvowcSPvn54wh\nyV1BVd3mSYyIsbSIy+5iznvWtv9Faqi7cdUDdhaGfSnOLqB4oSobqIVT/saq\n8xpI\r\n=kJMf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElj9jb6QgLdzJIRjmKecSbj4JT0jDGcHIdp30Hwf47oAiBdV6AfQ3QnGBMyAQzivRU6jp9bv0ZlVxJr6WH9Vv3fsw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.22_1628755639530_0.8848351208134633"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.23":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.23","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"5ac346e4791bf172e00a0195575a2a34d5580ccd","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.23","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-EAVfwe3vr9+2WfOFH1OHNKNa9ZdglSPsVn121MWM2B8ZUFRd3jg8Ea4OT7v8Fkd00T7NOUfMYdTJgpwmcG0NvQ==","shasum":"0f69d42ae3fa265040e65c04180856eda91c67ca","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.23.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFifrCRA9TVsSAnZWagAA+W0P/ArKiPDxPvqwoIAD3h/T\nSBkelx9KMLZXkHsW/UESHoxufPIK8+VOta8cSmFa+nN27ROfmBytCPwlXiuj\npSb3IbtQ5aLAtDBo0Npc9KCvQRRsPHcesTfC5SO73LdBFwWTxpdmhpEE7VZv\nLRd+KJf9aiu9NI2bGn5hXga8LEGnANnv94r7S0QSzToRDjOx+eUpSIzhoi7S\n086O/J4oiPeJSpM+voqQtRt25sXHQlYQOFLqULvXjondr8Q+k9rvlyZFGnne\nef2mxtVvhKQFz5CMjlwTPg/6xyVV1IBXcst4OW2VcbxwtvWH+XirIYvpCLFL\n/nEu6yDjeSy5JqnrzjffIji4FMhSeHoxzecunAGSG5vBknnMz2b0WmtITptR\nhl2wFu23YnmEQmTAXEBTpUv6lu8ZYUwHB+eiF8jzUYMedqcmlqKDr4WuRYaZ\nMDUFwRs+rfLQeL4a9K3o4Bj/TeZEHGgkUD74iEkj9Pj3KrCdKEubZSnLwBQ9\n28geUhp5Wwqq43keVh+YC5xxabDYR5v84pnM/WvOtIqzzrHeIyWz6fXDiiUp\nasZXlBuytvsd57qwiJWkG87rwupWLupOojIF46KQBVB/3BU7S5yejyNyZSTj\nmtkfHjPlcAmBMOYLGPW7tbEec9NiMKWsY/iy8S5OXAq0So4Wo7rST3ND5hOl\noSia\r\n=isqL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADMNOL76GGlacW0Ay+/NEW/fZCiAEm+/WVJqQ5px48KAiEA06iC6Csjo9cXAfQ2l7P/L+Lj97erlftOHAz5xFEgXjQ="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.23_1628841963273_0.4706272969876164"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.24":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.24","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"ebe147726520090bbaf511b149791d57642dd7b5","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.24","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Xv0o321HUVrvBH0EeglYf/eiWJfqfnmSU8yb+gcXKzKya2xk8DXdpj50G/tBzQbrr6YGn52/2m1L7xx1S6mFxQ==","shasum":"7d9ce66afac96d6ee9fc6222690cb3240475fc3a","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.24.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHL94CRA9TVsSAnZWagAAU6UP+QDYG5w4L3X0jWbqKHMM\nZu8moTKjrMZ32+1LZeUn4pM9nIqhFts7/L8hO7hZxim8x9Xr8/7dJvngcmDd\nthPSlZA3bRTDiJNVWozbADzTHkiZIfcaUUuG8lkxUNYw+mBJe+EBYL+3zz1x\njJ0n0x+UBeEjZdpcYE7JMZJyEEHd/hewj15jljAUVsrzipXiYLmD+SZ/oKJU\nY3NsWtARcDJCYk/TLbb/WX2xTrihQT6DoCMv3wlo7Om7+g4atW1X7QLKA98r\ntF1ASXq0I12VVbnWZr4/Sh56rDoUDtfUDPEKjwkTZzwebzGPJzRj81xTA7iq\nuRkophT7hwkrHaYQ1A4GHac8uwmOoAqoCYuhtqRBxKTj9H8gXu0ba/HQz5qo\noR49ukEQSvgK2XfCIRPCooPzeWtoMRTzayLJ2mA7wcryslcwJajimMKImtgJ\n7IAGHyNYbIh7WjGQZe3QTfP7Sl0SwwscPHfZHF1N5bG0HDKVnDgXiylYiXEP\nl3VMGtb7Ke/eQkh7dHdXIIuYv4jWxd6AXKzKIxTennPS+SHSAV9WlanPxF+4\nbvjsk/7xGlKEVmEIjkmOxzcx49dFGceMaTWVx1SbYe69eQ7CNNiCjECgqXao\n7L8mLhskrHa1NjkewUWgJiJpV+IJdFq/7oVIee1hFIahvHnr+02yYUeasu1E\nQ8gD\r\n=3rwC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrE/slHnvHgPRbV4dqTy+vQjrFYZ5HJzzIfqqMS2sBxAiA9abfxRzv++aanhi8W4FXxvVqOYFT/A+Li3luuohmjAw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.24_1629273975847_0.7843070576355964"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.25":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.25","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"82123492aba411c4840c1d281a034278e73d1141","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.25","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-bQeS7guKlIdt3jC1cORM5f7KCe/RELPIPfuADoCxRdeWxTt2LKht311R+cwX9YbwmvlzBp3C1CQ35yvwaVbzcQ==","shasum":"ca0957010749b99a8399fd184acf1655fdb932b4","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.25.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHhDICRA9TVsSAnZWagAA1WIP/i7QfYhHmtx4ONp1esQr\n1pCRHb3L7DB08xYp4B1tZCwCZMHdHacfeQXxNzaoTsTB3MAOptBVBu6e8aZe\nLlEtTNBHuGpfaC4Kz12diTcnbswfrbSzCBbFO1caiat8ddaIZoEtfJ797v/1\n4czLmR5dkHJDoYSlVNuyzsCuxXKHqWQQF3Etc3kr04MJxpV57oup9Nb5RJDG\nQuV+EE1Xu80X7VgGlNhWFsXHJcFPS6Z4YlAXx4/AkbCmuCnKcqIremzGXtIp\nuFMov+dKkhr+zvwfdgLhhMYZyG5o8FUm0SFTVoC3fGK7+m7EZRQqJRNu31r/\nEPBqz4B2N9eqgdJanHAWlepsRMBr72p0/GFqq2owDijF80ryX67viFRiO8jC\nKdx5K/gVr2SFEdPkl/xmdSy7RTT3Pc8Yy1Z9+JtnfH+LxwpnysgEAL5N78tB\ntVTPAayWZA4HMukACSgLUHUcm6XB5S0DJrjzs9XpSwR6XYbjDBBZbz0miSG3\nX4uirpE2l+EbE4m9f5W+Why4gEINOnI2Qb19pJT5DWinc3dB23dFi2P44fkZ\nD+eO/7fft8cdgMKBOA56c68xqlWXUZnut8bTmdb26DpJ4zB1DrxlRuQz3dn+\nUTWbmfch9GUMf9VpSIPFzEZpoYfxqc6D8IX6oSr5ptcmarGo+rxh0XNWKU5e\nVoI0\r\n=2MKm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs5PngouqyCkUhoRS0zXmqyhAxPH0M8whF4JpXzDnDiwIgTvf/rAu10mH163oA20s+BpE9qnI+jlM/L6WW0je5x8A="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.25_1629360327822_0.9100976925213977"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.26":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.26","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.19","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"4e1f921519e7c8a2cf53160a9d52f70fd7af416c","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.26","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-WBMORTyphQFWLymD9NNLbE00eSO33qmoSbH3YuySpS5bDT4KNfwkuCdhOL3ueW1qwZ/XtwBbeBgDiL0Px1vNNw==","shasum":"e5c2a29dd4f7ad8aa008b91d6a765e10d1be5365","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.26.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH2JRCRA9TVsSAnZWagAAnboP/1Q1q8ZAZJM39a4/OYHF\n0C8LfyuM0lNA8wYoVSkp04pg5JyEzOh5GyigHEWtXGM/P4itovwCkj0ESwVm\nT33yeT1Dy9EhsyHq84gUpw2RSxAPWOWmFcYDv1Vzby/mRXIP0axc3K/eLhul\nZzYAlaRjlnXhET6EFJ4SeRGXHQd2F9xeTq0U5SScVE6q5HMXpeZW6iNQYwFZ\ndCfnfg/i177XIfEGX2KTK6m1uUCQQcg4GwJyPVxoYoNg12M0V0JchrYwI40m\nM3wpaMK/a9Q17Q/CkDKFxLocsYXp9tS0xZmEnSpFxIDSEMUDEvx0sCPNYXIF\nX4eGHbEYsTMoLkHi61pX9Y/072R5w7mFxCmNNb9X4c8NQhG910yfT7JoIY7Y\nS+v1DeKx58gvHYf5fQHSzZgmEftfBYkcIzrWxb/4GKOE7Cq/FaN+Sa3wMfDT\nUCt/uJ4pFlpGUglHNwhlufQ9k709cQ8RANTiYNerY4nYj+E+XaC9ZeIkYDVv\nbzn/lEBp7wzwwxtg6lHxEt8VJmj91tJo4kvdCB9QDWRYiY+Q3lVyeOcLpr1r\nfV8TJSA8zjeOhCGh0B0LmD/2MOwksZWQYkPONJzCx4s51hl0xkf19m+DhStq\nMPHHcccSuRJscrCCDkJIjenbDuhRUE1KvqtM96CisU0Xk1VA8WPfui4gcjtM\nKMc/\r\n=SRK3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwanuvbRs/qBHfqRm1OMVwUU52FSpcdVOyxNPG0XxJDwIgc8bU+LKlLkE1asp2j/PoV/3WV4Wl/7zatDWybLBlIqY="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.26_1629446737200_0.22121516177888378"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.27":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.27","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.20","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"289ffcdb5a1905aac01fec2e2cb01f1c1842f3a4","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.27","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-H0v4JZHQXz56B2oPSpYGqf6vPuuXb6HyHfxKP2f5EO1ao/Bbxw0rfwHut7XfayazigJNl56zfvm5wduezdN7ug==","shasum":"62a57ef54ca6af2e456d7d66e5db81bf2712c072","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.27.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhILPVCRA9TVsSAnZWagAASpQP/3CsISl+tQcbMhAyC1Gt\nOS9sHPxTvnKyx+4KyrY8PaHUktszspdJEOJTBIM7jL1I02rh8lJHfbvgT26V\n43QlDgs0ga9pCk1ipZGWGdwX2uiXwdaihamwD9vCDcUjgnj+YCvwPNcVUL9T\nz/c3dVbryTqj/2F84UP2IXsmoPqVQvUNyf34ME+AIKIN2Sl8a01RQP9kfbEL\ncCEb3IkBlQ9PQneoqhS2GuI+4G9rGJOwj4tknlKVeM1CKozQWAYU/wgyNwu/\n1HhytY6ekLhfhA8lk8MjY3c8ev0goVi24hGGn7rB0EcIxNPjia9//kLFapGU\nCbJ/MWDk1bnj6ukLivMzwT83Omd2E5i2RbDWptj/wLzq1P8iMQoKcUPIyyf4\nme2zqS9IOYQnUi65Z9epTj1IOgVen6rRFjPzA2CIsj1llG96KLRkQ4i0Cc4d\nY3z649hHpvixAeFGru3qIBE1FYuVV+bzJ6jzxoskmwdkWbj+Uryx2A0D/1x/\n6hud5D5qL9h3/0kzd62P9NG1x6jjOSER2hWnWxi1jAPrORj9APMGKoW64ljj\nuuvdaF2QBd5a7pnw4FoJ71djTGSUxMxvr0QXVzps+hPGwgB/h1giIBrQ2LcG\nJJC86wMx5LzzYmOqA0TCnuJgwG4C0vo31yoEVqDmsHhPU7jwfvR3Hc6/Wgzs\nfbUp\r\n=SmjN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOvrSEUXpLeC1jhHde4LRTTHG7oKwNrBds8E8sTbw9WAiAqBdqPEfJt54Kx49+BXcRjJYEZrSuYu2OZpOm1j7nOZQ=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.27_1629533141814_0.596544293409915"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.28":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.28","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.20","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"a5d9dad04b68ae176fb08c59e59eca141fb4efa2","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.28","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-HGjYsxFJW7Zqxga6sk5F+TrRjOOjrMZM7UZ3YXrQKTvF43YImRxEGoND2u2SYudBcK9IFciFZ8Cxfh7YCGWMLQ==","shasum":"ac8e000ecf8d36397c308bab2cf69707d357232b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.28.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJfn4CRA9TVsSAnZWagAAMjgP+QCKB7s6tF4/ViaJ7G61\nwzqPH/K6azsUOwXCIPuYzjnrE/f3A7uA5lVBh3hFvTckbuiLkquqkWZ90DB2\nnDJu70huocDIDemqtW+dO67cHMIKBpd5ygM0qCcRg0RXz68YSx81aG8+voEw\niZDvAOPuhthZO15yYsPf/MxLixBHkiaJtmUbK8zIn2TmQodR/3/FSd4h4/Ci\nGeIq41fVKby7kb16mxuWq8rq71bTO1RQS6s7cm7a51oJ4w425Z41D54mBgA1\nf1B+lVit6VopIZbIgpMwuhufmIVjJFBkj8dwJB24MvnFX7+XVyX5hFvggA2i\nFbrT6manFDoLIyf4f8FKCsOht5hPMR/bcdXRkH4/SdV6+Cdv35RRXY+e30Us\noAXEb13O8I1vqfmszyFgL76N4bt2m5UadJsgr6zVuSts06or+WJunZ8mDFB9\ng5GpQeK3TxdTYbOdtB0SMk5hCmCKkEpQq1gaL+BcVSBa4Kwq0BYMbBYTa4JQ\ngQ07zdtuZxirAxxDVDhefLtCAzPqZnQN1hY7Ro5iBwbulVtQyguhf/qASseW\ndNx5yD66Qv/BvekcWcaIgmH2s+LXDR3XLEuzblfnkKSfWom9nY/3GdxQFBlm\nrk8miajoxdKVdRTneWXRxiTNHd/hNYYwWyPud5tSEw/+R1tHAzyJcIWAxCCg\n+lbg\r\n=Ke0p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdUGrFI260K9KJRW263v3ZLS2QD/C7CCiExIMn8GzfWgIhAJJxwqvs3RgrSNuRGzj+/8ltwLyYLS4CAIj0QcLOrMRX"}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.28_1629878776216_0.6238458302838239"},"_hasShrinkwrap":false},"2.2.2-branch-atomist-npm-update-main.29":{"name":"@atomist/automation-client","version":"2.2.2-branch-atomist-npm-update-main.29","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.2.2","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.43.2","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.19.1","@types/cors":"^2.8.12","@types/cross-spawn":"^6.0.2","@types/express":"^4.17.13","@types/fs-extra":"^8.1.2","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.172","@types/micromatch":"^3.1.1","@types/node":"^12.20.21","@types/node-statsd":"^0.1.3","@types/passport":"^1.0.7","@types/passport-http":"^0.3.9","@types/passport-http-bearer":"^1.0.37","@types/power-assert":"^1.5.4","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.2.3","@types/shelljs":"^0.8.9","@types/tmp":"^0.2.1","@types/utf8":"^2.1.6","@types/uuid":"^3.4.10","@types/ws":"^6.0.4","apollo":"^2.33.6","apollo-cache-inmemory":"^1.6.6","apollo-client":"^2.6.10","apollo-link":"^1.2.14","apollo-link-error":"^1.1.13","apollo-link-http":"^1.5.17","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.21.1","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.5.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.17.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.1","fs-extra":"^8.1.0","git-url-parse":"^11.5.0","graphql":"^14.7.0","graphql-tag":"^2.12.5","graphql-tag-pluck":"^0.8.7","graphql-toolkit":"^0.7.5","graphql-tools":"^4.0.8","heavy":"^6.1.2","helmet":"^3.23.3","hot-shots":"^6.8.7","https-proxy-agent":"^3.0.1","isbinaryfile":"^4.0.8","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","logform":"^2.2.0","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.4","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.1","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.28","power-assert":"^1.6.1","promise-retry":"^1.1.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.19","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^4.3.5","utf8":"^3.0.0","uuid":"^3.4.0","winston":"^3.3.3","winston-transport":"^4.4.0","ws":"^7.5.3"},"peerDependencies":{"gc-stats":"^1.4.0"},"devDependencies":{"@atomist/npm-tools":"^0.1.1-main.0","@types/mocha":"^7.0.2","@types/statsd-client":"^0.4.3","axios-mock-adapter":"^1.20.0","config":"^3.3.6","espower-typescript":"^9.0.2","mocha":"^7.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.2","statsd-client":"^0.4.7","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.37"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc lib","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","prepack":"atm-npm-tools source-maps"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=10.3.0","npm":">=6.0.0"},"gitHead":"904a8d1561973d9d1afaf5258d2c69cb2dd0dcfc","readme":"# @atomist/automation-client\n\nThis package contains the low-level API client for the Atomist service\nunderpinning the Atomist Software Delivery Machine (SDM) framework.\nPlease see the [`@atomist/sdm`][sdm] package for information on how to\ndevelop SDMs.\n\n[sdm]: https://github.com/atomist/sdm\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\nFirst install the package dependencies.\n\n```\n$ npm ci\n```\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n```\n$ npm run build\n```\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/automation-client@2.2.2-branch-atomist-npm-update-main.29","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-barnve7MNhI5i4Rzv3eJPmzyFX6xplILzvFwAFph+8yRK3jQHo8TSP5m5roxayQo/cOQyXaqhPrdBnsaQvAOZQ==","shasum":"6308adac252f36c64a4909c1ff41d421030d93dc","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-2.2.2-branch-atomist-npm-update-main.29.tgz","fileCount":1015,"unpackedSize":4408218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ0uTCRA9TVsSAnZWagAAyv8P/1UXGNH9Hwcu9qtG6N3e\nPBxG6n76Fh034LWcEIH6ed/4YGc7o218hQ8SwIWW3M7XgVH/Sq36kOLrdNeR\nplc5KfxRH3iQKyCbDbWeGQB7e1YbTH4Ak5mlaYuQ0X+6K9WbbNIMn3JcvqFy\nwI07caPBjqgxTXO5Cp93W2JkcO5BBdHwRa+5TvJsmN8R+rGzrXa0/M/5BLHM\nPrYgIgPYc67yFGJfIUHkY8eh6TdLc5480Os14YPwG9+Mq/MakmzDaxkAKbEH\nOb0dZ3wLzye3WulGdiPI1DK4uw0bb7CIY/7UkYcKr6e3/V95HJgWOMBWjjcX\nLwEjT8+YwRA4VgLGTBFo/8tI/45+XXXRVRLBJre5090JtGDXEuDZmCLPz11D\nZoffToJMRaAVn7qW6X3GIiom2YlEPzys4ELOJmVcEc/2N27emJci+9prW2YX\nVuqD6cKLErm7a+usHSZiM1iyeqzOCE9UAL92cOTDqF7fy/gEF5azrjXSOUZ8\nzazY23GnjK0vC5LHlPvjSOSGmUop9RC2CzMyPG6UpaarBB2iArYZIQMB6dIk\nmN1nfpA6UasJ7+tORd0RgnHDvJ28yNBqcBPuxO3i8BUDDpn9DIC297WV/Iat\nOWdJkrzyez3FJyur0PBow6VVPtDQLI1duP6FjnSHf7IiX7Z/euexqIrSIYzA\nEAxg\r\n=N7tS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIaa4jj3Z8mmTg4KSQr4C3aJqxaCIvecNTVnUvBmbh4AiBLDP3GcCdHy/efM+uXTVLljLJpnDZzPQyAE/0LD+tLpw=="}]},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_2.2.2-branch-atomist-npm-update-main.29_1629965203671_0.6485401384198493"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20220503134500":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20220503134500","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"_id":"@atomist/automation-client@1.8.3-1.8-fixes.20220503134500","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-uD0ED2FgWBRfiqsd7sL5ipouUQmG9Nebg9OfSAlIwxZ3B5MTfDAzycLlXAipf12dZulRM9aYD2oQhjiUJYXWNg==","shasum":"e191e597ef412b52815c9fb8cef5c0ca9019a66b","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20220503134500.tgz","fileCount":1040,"unpackedSize":4609784,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDex0OrFLLnTj4puUdmUteKu9iamAnxPLNzWW9nPUsDZAIgD26409xSPTx1g3KIlFGB7gcphYYVTrZl4Ga4fi9ItQU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicRYDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQzQ//Vc4EGzJdBogdfh3JuDZw5y24i94Zd3hif5DhywKR0lDnleXG\r\n9MR7NvYVNbv5DSQ013eISU9ul+dMk34lrGyYrTvOprDqgWThBRSbs8ci+Efm\r\nJzeOH3Ccq+BVDIWaL1a+F/5XBF5wUD25et0ERp5+Nos9+c9FB70DpttzxfkL\r\nDf/z2YeTX8vKbwD222B78pe4jm7dGSAU+RVk+mPK+kbdHeGdXao/tU5sqfOA\r\noTWFw5olXI+9oKvH/kiiGXYba9ZN5FJDhJG5PqCo57FadZBhRmocmxIle7Di\r\nJsZfYFhaX+vuRMsYqyvBqhJddGS2rb1Y5F8eSD81ogGJt73CtA9rzNnJ0Izq\r\nfNT5FPFWHcmIFqL1OeVyiGln3fcIlxHA+6q1cOGCTY97RBjqGCKwlsWd2RZg\r\n8lJt9FRussf/qK9QGn1H6nMXYDlkN5QnE0xlaLC5whgq6xY/Pe+6w1hbILDP\r\nEc0Ik/NcXApTSlrtPlqnf1KRtNe2k+5iWzrfUL5MYBJdct9uu600jSpagaW1\r\nPoCHJk1ql0FRUMTbBsWKujcZVYFf6cmF3i/Z3pWhagaRkVVXhCsIZrYHy0L7\r\ntn/88jVpmwi/8wERI/E303+yOBBtRIZ8p/ysaRL7lniQ31eqD5Bi6NBKJP4B\r\n5bD70ZB3NFrAC+qztX9USZM9/1AtN4wphUw=\r\n=f8bG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20220503134500_1651578371391_0.23508835617144674"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20230414134500":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20230414134500","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"3a18aadeb50200e911ffdc57060368e416044563","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20230414134500","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-oZ87KeDZvLPUF/CjmbrdteiLLGcznIv59ZZxS+Tq5C4BhWrvlWptJVgrj7Zwpj0ZCze2SoTBbDgdrTOSyd7l3Q==","shasum":"ca9995af676f9e5d0682d675d63c2e99fbff22d3","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20230414134500.tgz","fileCount":1040,"unpackedSize":4603447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD36kkfImseRJJdgEgI/XKlXDt4V/WeGpP/Q9P0bAF6fwIhALxkOVWsKBm/2TLeq5XYGJOJC1n74v1aPHTV+nDRdOt+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN8VpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFlg/9FTF25JPXzGKcqJlsRQBCaC/5jdn0KXeAjXOMCcpodYPu5upe\r\nB1NmVMzwDyEBZaAsv9dKzraVq9dtSTUJM7mkvMbHFm/oU8/cN/HdREY4wKiT\r\nD2am2ext2mjBZX9/K9Sx7iaqU45pVsnJ2fT/QOSmEGjNjVC1orGfls07Kcqi\r\n55ZgbriAjwWSf5aPTngEgWx+W5HSlOyFpgbdErOtrd+4CWzD0tCnPg5g9+MB\r\nPrg3I2aiXFSFcBzUlbNNQKolJRxzKH4e0uovuf3V9AyKjovwAHs6zsd33fbD\r\ni6RZc8OO72GsgVcVLJ3Q1MQ3S1c4KFkVMKX8S6iZ3tZ65x9GusJUlVw1cAXg\r\n9HwJc+LmsoKDG+USdTIGgVLVttJkddUw02DTh1G0OtIJdyhebeZecx1vgkUD\r\nDPs8MnVsOumWUoVJg4/SWzJGl/2XaDJWBBeVmVtNxnYRHzkz7+d7gLdRQapX\r\nVVM4NbE2Z8R9E19bC5jwiZp2x1u+f3B8E7uJQ8cqF3oJA4LRCwS8c2HIK4wH\r\nTbwiDXKmprZReovRAAzzb9FF/QlDk7VQ4V2YwaZObXPMlz5GL0v2gr1AoBIW\r\nfcxQg4Kdux+d+2TuUyMgkmwQaQ1N40Facm5uXNQrhCAezmYtx+D/NZLzcNFS\r\nV2wN0XJV31Qr9f70LsL3lmJIywc6YJSP9bY=\r\n=sJ8D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"neilprosser","email":"neil.prosser+npmjs@gmail.com"},{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20230414134500_1681376617476_0.06414175136110312"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20230414220100":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20230414220100","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"^4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"3a18aadeb50200e911ffdc57060368e416044563","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20230414220100","_nodeVersion":"14.19.3","_npmVersion":"6.14.17","dist":{"integrity":"sha512-IaBg8H8iIMQQbINuDPChq7/E3QNeyMNWxf4zq3PyHaxUpR1jb80q/Yf6KTpzbDNen4AqCS/fgRwK3kJX2RcZTg==","shasum":"94ea0a988fe1067d84e0d0ce773841086aca06ec","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20230414220100.tgz","fileCount":1040,"unpackedSize":4603447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDscaU5Ug4Aa+MV82buC27ePrViqTHYp+rH0U6OD+GqqgIhALjUHGZvE7Rb5hZNGt3VIPb9V6NqXeM2yH1F8O6lPO2B"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOF/NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrbzxAAn0Md5lb7Rd+ZFlIW6UBFN/XEE5lpFAJBaUXYCUMDSyhCJ7aF\r\nFmFaihD8FJRbVmtD5+kh8wFx45gz47/GOd9n2/0DpnBIBts6nm38J1+vvZsn\r\njV6h/Ij/uXjTwlgIdGpNQPVYH9d/1pzElV6fQfX9q97qw2hNHVHzJFueuQ7C\r\nuKUvb9VzPQglua/lVjI+A8UiHsWhL723Z7DtkRcVqlTkRZTqtlrQm1gusKNz\r\n8j9dQWRX8ThviJwOEHF8spQEWJBLBvefV75GfmRpWQNding9eiAqNh4cFJgr\r\n1tN6c2SWht6UkYbiavhybDBNZJXN9Iz0RlAtEepoMy7l2akmf3E8yJXdjJZ4\r\nhPfa6+GNUkuDMKb9SRWmV441X5mIraEF+kQ55WR5VS+hO9o0iG/yiZUmd3kb\r\nHRwJ9XLPGHjDrUU2IRzEDBKp+sr0MCRSJ9r43vaHfE8NxXteekEX1IHrUqcH\r\nl2OH7QgDAkov/ZzcJj9SqStm21bnhybFEhWiPLRfW/xD99/TUc+O0ZpYvBkJ\r\npUZvA9lWzIyIhFNUAtpB2Vxx9oqSV5yiDRuXbqZrvPfKuO1nlWak5B1oY4qo\r\noREUeiuQeZvXqUUD/dz2ixH+vd9cEiHZmPmQv1QlpHplK3wJH2VR5+17isAv\r\nbRhoDAnVs2o5O/u9yUZZZ4j3ReJLp1jnxQk=\r\n=E7mQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"neilprosser","email":"neil.prosser+npmjs@gmail.com"},{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20230414220100_1681416140644_0.6180024572860425"},"_hasShrinkwrap":false},"1.8.3-1.8-fixes.20230418232200":{"name":"@atomist/automation-client","version":"1.8.3-1.8-fixes.20230418232200","description":"Atomist API for software low-level client","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/atomist/automation-client#readme","repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"keywords":["atomist","automation"],"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"main":"./index.js","types":"./index.d.ts","dependencies":{"@atomist/microgrammar":"^1.2.1","@atomist/slack-messages":"^1.1.1","@atomist/tree-path":"^1.0.3","@graphql-codegen/core":"1.7.0","@graphql-codegen/plugin-helpers":"1.7.0","@graphql-codegen/typescript":"1.7.0","@graphql-codegen/typescript-compatibility":"1.7.0","@graphql-codegen/typescript-operations":"1.7.0","@octokit/rest":"^16.15.0","@typed/curry":"^1.0.1","@types/app-root-path":"^1.2.4","@types/base-64":"^0.1.3","@types/body-parser":"^1.17.0","@types/cors":"^2.8.5","@types/cross-spawn":"^6.0.0","@types/express":"^4.17.0","@types/fs-extra":"^8.0.0","@types/helmet":"^0.0.43","@types/inquirer":"^0.0.43","@types/isomorphic-fetch":"^0.0.35","@types/json-stringify-safe":"^5.0.0","@types/lodash":"^4.14.157","@types/micromatch":"^3.1.0","@types/node":"^12.7.5","@types/node-statsd":"^0.1.2","@types/passport":"^1.0.0","@types/passport-http":"^0.3.8","@types/passport-http-bearer":"^1.0.33","@types/power-assert":"^1.5.0","@types/promise-retry":"^1.1.3","@types/retry":"^0.10.2","@types/semver":"^6.0.1","@types/shelljs":"^0.8.5","@types/tmp":"^0.2.0","@types/utf8":"^2.1.6","@types/uuid":"^3.4.5","@types/ws":"^6.0.1","apollo":"^2.18.0","apollo-cache-inmemory":"^1.6.3","apollo-client":"^2.6.4","apollo-link":"^1.2.12","apollo-link-error":"^1.1.11","apollo-link-http":"^1.5.15","app-root-path":"^2.1.0","asciify":"^1.3.5","async-exit-hook":"^2.0.1","axios":"^0.19.0","axios-fetch":"^1.1.0","base-64":"^0.1.0","body-parser":"^1.18.3","chalk":"^2.4.2","chokidar":"^3.0.2","cors":"^2.8.5","cross-spawn":"^6.0.5","es6-promise-pool":"^2.5.0","express":"^4.17.1","express-session":"^1.16.2","fast-glob":"3.1.1","find-up":"^4.1.0","flat":"^4.1.0","fs-extra":"^8.1.0","git-url-parse":"^11.1.2","graphql":"^14.5.4","graphql-tag":"^2.10.1","graphql-tag-pluck":"^0.8.4","graphql-toolkit":"^0.5.11","graphql-tools":"^4.0.5","heavy":"^6.1.2","helmet":"^3.18.0","hot-shots":"^6.3.0","https-proxy-agent":"^3.0.0","isbinaryfile":"^4.0.0","json-diff":"^0.5.4","json-stringify-safe":"^5.0.1","lodash":"4.17.19","logform":"^2.1.2","lru_map":"^0.3.3","metrics":"^0.1.21","micromatch":"^4.0.2","murmurhash3js":"^3.0.1","node-cache":"^4.2.0","node-statsd":"^0.1.1","passport":"^0.4.0","passport-http":"^0.3.0","passport-http-bearer":"^1.0.1","passport-http-header-token":"^1.1.0","portfinder":"^1.0.20","power-assert":"^1.6.1","promise-retry":"^1.1.1","proper-lockfile":"^2.0.1","retry":"^0.12.0","semver":"^6.2.0","serialize-error":"^3.0.0","source-map-support":"^0.5.12","stack-trace":"^0.0.10","stream-spigot":"^3.0.6","strip-ansi":"^5.2.0","tinyqueue":"2.0.0","tmp-promise":"^3.0.2","tree-kill":"^1.2.2","typescript":"^3.7.3","utf8":"^3.0.0","uuid":"^3.3.3","winston":"^3.2.1","winston-transport":"^4.3.0","ws":"^7.1.2"},"devDependencies":{"@types/mocha":"^5.2.7","@types/statsd-client":"^0.4.0","axios-mock-adapter":"^1.17.0","config":"^3.2.2","espower-typescript":"^9.0.2","gc-stats":"^1.4.0","mocha":"^6.2.0","ncp":"^2.0.0","npm-run-all":"^4.1.5","rimraf":"^3.0.0","statsd-client":"^0.4.2","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.3"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s clean compile test lint doc","clean":"run-p clean:compile clean:test clean:doc clean:run","clean:compile":"rimraf git-info.json build \"index.{d.ts,js}{,.map}\" \"{lib,test}/**/*.{d.ts,js}{,.map}\" lib/typings/types.ts","clean:dist":"run-s clean clean:npm","clean:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"run-s compile:ts","compile:ts":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:api":"mocha --require espower-typescript/guess \"test/api/**/*.test.ts\"","test:bitbucket-api":"mocha --require espower-typescript/guess \"test/bitbucket-api/**/*.test.ts\"","test:benchmark":"run-s test:benchmark:run test:benchmark:process","test:benchmark:process":"node --prof-process isolate-*-v8.log > profile.txt","test:benchmark:run":"mocha --prof --require espower-typescript/guess \"test/**/*.benchmark.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"bin":{"atm-command":"bin/command.js","atm-git-info":"bin/git-info.js","atm-gql-gen":"bin/gql-gen.js","atm-start":"bin/start.js","atm-start-dev":"bin/start-dev.js"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"0a392e01b37695e5a105d33254c73658a24e51e8","_id":"@atomist/automation-client@1.8.3-1.8-fixes.20230418232200","_nodeVersion":"14.19.3","_npmVersion":"6.14.17","dist":{"integrity":"sha512-nU5LJfVE49yPFz5FS6kRspdoisFmhVFY0ZDcfo/fTZ5lHxCqDJV+/LKEff4BLoOSVLQhcl+bvn4kXB6RhIn83A==","shasum":"049a7d873782389c9d69b209ebc38c3e9ecab2fd","tarball":"https://registry.npmjs.org/@atomist/automation-client/-/automation-client-1.8.3-1.8-fixes.20230418232200.tgz","fileCount":1040,"unpackedSize":4603446,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqiFrxiB4IoiFTpqpXId2u7SYYMMdH66XXCI3Gmd2R8AiEAmnQQxWwElzSBM1u6IjZ20uL4yXurI8YjPpHCU7/l39I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPwo4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpj8Q/+Ppm+mZeFlImMvGAFM6bc58JYPmBdtl32pUXZiNGcAIGm6x1n\r\ng32dlHTWNR9Gf4GU5+s5dNevDaCbwYgGjbJonHD2JkSTTs1aiW3Ae2U1PDhO\r\n4vU0792BoHnU1JmAighpt/p+QcPuoJcHzCFwhIB2ZhUeZcKGrvdKzKSlvtAS\r\nrXURXewmyn5pj3d9fMytZo4e6pQwarg5HdWOR32+p0fJMJVMtKyBkNRcFKL5\r\nszM0cL5U+7ORnbMId5HiAZdtcEz7ywoa9IDPApXnihiby4GYz77gGC/k4iLy\r\nOhukrNf3d9JISAZZqknst8//l0OQaO1c4GKQcLL6rmHqiD/nBDiGcCSnCHeS\r\nRS8tBAAsqfaPBkdplV/mGnhwyLw35wiZwC7wdQNNI5zQeJOVfGHjoWNc02QX\r\nucte7ebAEfL+qlecoU27zGGmsvaaJwQbq3D+0xVA1qNVnxIdEbtKm4HqyaiX\r\nW1zu1RZJk/AZuneThGLxmqUwCieNJyyLWh5qil+UHrxczYprVGbWcD4PkEKo\r\nKzrVB8zaXgYV+LoZJg+Ha54Uy4rT28Sb2aY7oiDnh/bGHGqEErljilwnlzi2\r\nUyutqEvBoobeNaqWmxe34wB6R5chc0rbjtOo6wXORgcVqUSHr/gpLsFoshaC\r\nBYc9deiCql+wVN2tssK06j/tu3G+VNqTq/k=\r\n=WtTp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"atomist-bot","email":"npm@atomist.com"},"maintainers":[{"name":"neilprosser","email":"neil.prosser+npmjs@gmail.com"},{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automation-client_1.8.3-1.8-fixes.20230418232200_1681852984597_0.6120794226456989"},"_hasShrinkwrap":false}},"readme":"# @atomist/automation-client\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/automation-client-ts/bdaca35b-0cb1-4fbf-8596-a27777b46974)](https://app.atomist.com/workspace/T29E48P34) \n[![npm version](https://img.shields.io/npm/v/@atomist/automation-client.svg)](https://www.npmjs.com/package/@atomist/automation-client)\n\n[Node][node] module [`@atomist/automation-client`][automation-client]\nfor creating Atomist development automations.  Development automations take the following forms:\n\n-   Bot commands - create bot commands using _command handlers_\n-   Respond to events - use _event handlers_ to automatically\n    take action when events, like someone commenting on an issue,\n    happen\n-   Ingestors - define your own, custom events that you can then take\n    action on\n\nThe automation-client provide the ability to run a client that\nconnects to the Atomist API so it can receive and act on commands and\nevents.\n\nSee [atomist.com][atomist] and [docs.atomist.com][docs] for more\ndetailed information.\n\n[node]: https://nodejs.org/ (Node.js)\n[automation-client]: https://www.npmjs.com/package/@atomist/automation-client\n[docs]: https://docs.atomist.com/ (Atomist Documentation)\n\n## Concepts\n\nAtomist is a service and API that enables development automation. The\nAtomist service builds and maintains a model of the things that matter\nto your development team. You can then use out of the box automations\nor build your own automations acting on this model.\n\nFor more information, please read [Concepts](docs/Concepts.md).\n\n## Getting Started\n\nPlease install [Node.js][node].  To verify that the right versions are\ninstalled, please run:\n\n```\n$ node -v\nv8.4.0\n$ npm -v\n5.4.1\n```\n\n### Using the `automation-client` module from your project\n\nTo start using this module in your Node.js application, you have to add a dependency to it to your `package.json`\nby running the following command:\n\n```\n$ npm install @atomist/automation-client --save\n```\n\nYou can find reference documentation at https://atomist.github.io/automation-client-ts/ .\n\n### Starting from a Sample\n\nWe also provide a working project with some basic automations that you can use to get started quickly. The repository\nis at [atomist/automation-seed-ts](https://github.com/atomist/automation-seed-ts).\n\nTo get started run the following commands:\n\n```\n$ git clone git@github.com:atomist/automation-seed-ts.git\n$ cd automation-seed-ts\n$ npm install\n```\n\nSee the [automation-seed-ts README][seed-readme] for further\ninstructions.\n\n[seed-readme]: https://github.com/atomist/automation-seed-ts#readme\n\n## Implementing Automations\n\n### Command Handlers\n\nCommands are automations that can be invoked via a Chat bot, curl or web interface.\n\nTo create a command take a look at the following example:\n\n```typescript\nimport { CommandHandler, Parameter} from \"@atomist/automation-client/decorators\";\nimport { HandleCommand, HandlerContext, HandlerResult } from \"@atomist/automation-client/Handlers\";\n\n@CommandHandler(\"Sends a hello back to the client\", \"hello world\")\n//                                                   ^ -- defines the command to trigger\n//                      \"                                 this handler from the bot\nexport class HelloWorld implements HandleCommand {\n//                                 ^ -- a command handler implements the HandleCommand\n//                                      interface\n\n    @Parameter({ pattern: /^.*$/, required: true })\n//  ^            ^                ^ -- parameters can be marked required or optional\n//  ^            ^ -- the parameter can be validated against a RegExp pattern\n//  ^ -- this defines a user-provided parameter named 'name'\n    public name: string;\n\n\n    public handle(ctx: HandlerContext): Promise<HandlerResult> {\n//  ^             ^ -- HandlerContext provides access to a 'MessageClient' for sending\n//  ^                  messages to the bot as well as a 'GraphClient' to query your\n//  ^                  data using GraphQL\n//  ^ -- this method is the body of the handler and where the actual code goes\n        return ctx.messageClient.respond(`Hello ${this.name}`)\n//                               ^ -- Calling 'respond' on the 'MessageClient' will\n//                                    send a message back to wherever that command\n//                                    is invoked from (eg. a DM with @atomist in Slack)\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Command handlers are expected to return a\n//                                          'Promise' of type 'HandlerResult' which\n//                                          just defines a return code. Nonzero\n//                                          return codes indicate errors.\n            });\n    }\n}\n```\n\nThe above declares a simple bot command that can be invoked via `@atomist hello world`. The command takes one\nparameter called `name`. The handler will respond with a simple greeting message.\n\nFor more information, please see [Command Handlers](docs/CommandHandlers.md).\n\n### Event Handlers\n\nEvent handlers are automations that allow handling of events based on registered GraphQL subscriptions.\n\nTo create a event handler take a look at the following example:\n\n```typescript\nimport { EventFired, EventHandler, HandleEvent, HandlerContext, HandlerResult }\n    from \"@atomist/automation-client/Handlers\";\n\n@EventHandler(\"Notify channel on new issue\", `subscription HelloIssue {\n    Issue {\n      number\n      title\n      repo {\n        channels {\n          name\n        }\n      }\n     }\n}`)\n//                                            ^ -- This is GraphQL subscription you want\n//                                                 to match to trigger your handler.\n//                                                 Queries can also be externalized.\nexport class HelloIssue implements HandleEvent<any> {\n//                                 ^ -- an event handler implements the 'HandleEvent'\n//                                      interface\n\n    public handle(e: EventFired<any>, ctx: HandlerContext): Promise<HandlerResult> {\n//                ^                   ^ -- 'HandlerContext' gives access to\n//                ^                        'MessageClient' and 'GraphClient'\n//                ^ -- 'EventFired' gives you access to the data that matched the\n//                     subscription. Since GraphQL queries return JSON it is very easy\n//                     to work with the data in JavaScript/TypeScript\n\n        return Promise.all(e.data.Issue.map(i =>\n            ctx.messageClient.addressChannels(`Got a new issue \\`${i.number}# ${i.title}\\``,\n//                            ^ -- besides responding, you can address users and\n//                                 channels in Slack by using the respective methods\n//                                 on 'MessageClient'\n\n                i.repo.channels.map(c => c.name))))\n//              ^ -- in our correlated data model, repositories can be mapped to\n//                   channels in a chat team. This will effectively send a message\n//                   into each mapped channel\n            .then(() => {\n                return Promise.resolve({ code: 0 });\n//                                     ^ -- Event handlers are expected to return a\n//                                          'HandlerResult'. Nonzero code indicate\n//                                          error occurred\n            });\n    }\n}\n```\n\nThis event handler registers a GraphQL subscription on the `Issue` type. On `Issue` events the handler will\nsend a simple message back to the associated slack team.\n\nFor more information, please see [Event Handlers](docs/EventHandlers.md).\n\n### Register Handlers\n\nIn order to register your handlers with the automation-client, please create a file called `atomist.config.ts` and put\nthe following contents into it:\n\n```typescript\nimport { Configuration } from \"@atomist/automation-client/configuration\";\n\nimport { HelloWorld } from \"./commands/HelloWorld\";\nimport { HelloIssue } from \"./events/HelloIssue\";\n\nexport const configuration: Configuration = {\n//                          ^ -- 'Configuration' defines all configuration options\n\n    name: \"your_module_name\",\n//  ^ -- each automation-client should have a unique name\n\n    version: \"0.0.1\",\n//  ^ -- and a semver version\n\n    teamIds: [\"T29E48P34\"],\n//  ^ -- the ids of your chat teams which you can get by running '@atomist pwd'\n//       leave empty to use your user defaults saved by atomist-config\n\n    commands: [\n//  ^ -- register all your command handlers\n        () => new HelloWorld(),\n    ],\n\n    events: [\n        () => new HelloIssue(),\n    ],\n//  ^ -- the same for event handlers\n\n    token: process.env.GITHUB_TOKEN || \"34563sdf......................wq455eze\",\n//  ^ -- configure a GitHub personal access token with read:org scope; this is used to\n//       authenticate the automation-client with Atomist to make sure the client should\n//       be granted access to the ingested data and chat team; leave null/undefined\n//       to use your user default saved by atomist-config\n};\n```\n\nThis file allows you to register your handlers as well as to specify name and version for your automation-client.\n\n## Running the Automation-Client\n\nThere are several ways you can run your automation-client and have it connect to Atomist API.\n\n### Running Locally\n\nTo start up the client locally and have it listen to incoming events, just run:\n\n```\n$ atomist start\n```\n\n### Pushing to Cloud Foundry\n\nTo prepare for your automation-client to run on any Cloud Foundry\ninstance, please make sure that you have an account on an instance of\nCloud Foundry and that you have the Cloud Foundry CLI installed,\nconfigured and logged in.\n\nFirst you need to create a `manifest.yml` in the root of your node\nproject. Put the following minimum content into the file:\n\n```\n\napplications:\n- name: YOUR_APP_NAME\n  command: $(npm bin)/atomist-client\n  memory: 128M\n  buildpack: https://github.com/cloudfoundry/nodejs-buildpack\n  env:\n    GITHUB_TOKEN: <your GITHUB_TOKEN>\n    SUPPRESS_NO_CONFIG_WARNING: true\n```\n\nThere more recommended ways for getting your `GITHUB_TOKEN` into your automation-client instance.\nTake a look at [`cfenv`](https://www.npmjs.com/package/cfenv) for example\n\nNext please add an `\"engines\"` top-level entry to your `package.json`\nlike the following:\n\n```javascript\n  \"engines\": {\n    \"node\": \"8.x.x\",\n    \"npm\": \"5.x.x\"\n  }\n```\n\nNow you're ready to `cf push` your automation server to Cloud Foundry:\n\n```\n$ cf push\n```\n\n## REST APIs\n\nWhen starting up, the `automation-client` exposes a couple of endpoints that can be accessed via HTTP.\n\n### Authentication\n\nThe endpoints are protected by HTTP Basic Auth or token-based authentication. When starting the client, you'll see\na log message of the following format:\n\n```\n2017-09-20T08:22:32.789Z - info\t: Auto-generated credentials for web endpoints are user 'admin' and password '4d6390d1-de5c-6764-a078-7308503ddba5'\n```\n\nBy default the automation-client auto-generates some credentials for you use. To configure your own credentials, change\n`atomist.config.ts` and put a following section in:\n\n```typescript\nexport const configuration: Configuration = {\n    ...\n    http: {\n        enabled: true,\n        auth: {\n            basic: {\n                enabled: true,\n                username: \"some user\",\n                password: \"some password\",\n            },\n        },\n    },\n};\n```\n\n### Endpoints\n\n#### GET Management Endpoints\n\n| Path  | Description |\n|-------|-------------|\n| `/metrics` | exposes metrics around command, event handler executions |\n| `/health` | endpoint that exposes health information of the automation client |\n| `/registration` | metadata of all available automations |\n| `/info` | exposes information about this automation client |\n| `/log/commands` | all incoming request for running command handlers |\n| `/log/events` | all incoming events for event handlers |\n| `/log/messages` | all outgoing messages sent by handlers |\n\nAs an example, here is an a command to get the current metrics:\n\n```\n$ curl -X GET \\\n     http://localhost:2866/metrics \\\n     -H 'authorization: Bearer 34563sdf......................wq455eze\"' \\\n     -H 'content-type: application/json'\n```\n\nThe above endpoints are all HTTP GET and take bearer and basic auth per default. See below for more details about\nauthentication.\n\n#### Invoking a command handler\n\nCommand handlers can be invoked via a HTTP POST with the following payload:\n\n```\n$ curl -X POST \\\n    http://localhost:2866/command \\\n    -H 'content-type: application/json' \\\n    -H 'authorization: Bearer 34563sdf......................wq455eze\"'\n    -d '{\n          \"parameters\": [{\n            \"name\": \"name\",\n            \"value\": \"cd\"\n          }],\n          \"mapped_parameters\": [{\n            \"name\": \"sender\",\n            \"value\": \"kipz\"\n          },{\n            \"name\": \"userName\",\n            \"value\": \"cd\"\n          }],\n          \"secrets\": [{\n          \t\"uri\": \"github://user_token?scopes=repo\",\n          \t\"value\":\"4...d\"\n          }],\n          \"command\": \"HelloWorld\",\n          \"correlation_id\": \"6cb72bf7-77b4-4939-b892-00000701fa53\",\n          \"team\": {\n            \"id\": \"T1L0VDKJP\",\n            \"name\": \"Atomist QA\"\n          },\n          \"api_version\": \"1\"\n        }'\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel on our community Slack team\nat [atomist-community.slack.com][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/automation-client-ts/issues\n\n## Development\n\nYou will need to install [node][] to build and test this project.\n\nTo run tests, define a GITHUB_TOKEN to any valid token that has repo access. The tests\nwill create and delete repositories.\n\nDefine GITHUB_VISIBILITY=public if you want these to be public; default is private.\nYou'll get a 422 response from repo creation if you don't pay for private repos.\n\n### Build and Test\n\nCommand | Reason\n------- | ------\n`npm install` | install all the required packages\n`npm run build` | lint, compile, and test\n`npm start` | start the Atomist automation client\n`npm run autostart` | run the client, refreshing when files change\n`npm run lint` | run tslint against the TypeScript\n`npm run compile` | compile all TypeScript into JavaScript\n`npm test` | run tests and ensure everything is working\n`npm run autotest` | run tests continuously\n`npm run clean` | remove stray compiled JavaScript files and build directory\n\n### Release\n\nTo create a new release of the project, we push a button on the Atomist lifecycle message\nin the #automation-client-ts [channel](https://atomist-community.slack.com/messages/C74J6MFL0/) in Atomist Community Slack.\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack team][slack].\n\n[atomist]: https://atomist.com/ (Atomist - Development Automation)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","maintainers":[{"name":"neilprosser","email":"neil.prosser+npmjs@gmail.com"},{"name":"atomist-bot","email":"npm@atomist.com"},{"name":"cdupuis","email":"cd@atomist.com"},{"name":"slimslenderslacks","email":"slimslenderslacks@gmail.com"}],"time":{"modified":"2023-04-18T21:23:05.114Z","created":"2017-09-19T13:49:17.245Z","0.1.0":"2017-09-19T13:49:17.245Z","0.1.1":"2017-09-20T08:34:09.815Z","0.1.2":"2017-09-20T10:22:41.681Z","0.1.3":"2017-09-20T19:20:52.257Z","0.1.4":"2017-09-22T07:00:08.603Z","0.1.5":"2017-09-22T07:12:04.692Z","0.1.6":"2017-09-24T08:00:43.247Z","0.1.7":"2017-09-25T09:15:33.845Z","0.1.8":"2017-09-25T10:04:40.283Z","0.1.9":"2017-09-25T11:19:15.173Z","0.1.10":"2017-09-25T12:13:36.568Z","0.1.11":"2017-09-25T14:23:44.322Z","0.1.12":"2017-09-25T15:43:15.966Z","0.1.13":"2017-09-26T07:55:48.281Z","0.1.14":"2017-09-26T08:38:20.396Z","0.1.15":"2017-09-26T08:41:33.018Z","0.1.16":"2017-09-26T08:46:07.184Z","0.1.17":"2017-09-27T06:55:04.178Z","0.1.18":"2017-09-27T08:06:22.889Z","0.1.19":"2017-09-27T21:43:00.853Z","0.1.20":"2017-09-28T04:52:23.739Z","0.1.21":"2017-09-28T09:10:42.229Z","0.1.22":"2017-09-28T09:59:04.772Z","0.1.23":"2017-09-28T12:48:47.983Z","0.1.24":"2017-09-28T15:16:43.990Z","0.1.25":"2017-09-28T18:34:29.021Z","0.1.26":"2017-09-28T19:05:43.701Z","0.1.27":"2017-09-28T19:45:36.676Z","0.1.28":"2017-09-28T20:09:38.675Z","0.1.29":"2017-09-28T20:48:42.626Z","0.1.30":"2017-09-29T09:10:36.974Z","0.1.31":"2017-09-29T22:17:33.306Z","0.1.32":"2017-09-30T08:30:52.200Z","0.1.33":"2017-09-30T12:07:00.728Z","0.1.34":"2017-09-30T22:32:46.482Z","0.1.35":"2017-09-30T23:07:46.734Z","0.1.36":"2017-10-01T00:17:59.030Z","0.1.37":"2017-10-02T10:53:18.596Z","0.1.38":"2017-10-05T07:29:09.718Z","0.1.39":"2017-10-07T10:02:08.673Z","0.1.40":"2017-10-08T10:48:19.127Z","0.1.41":"2017-10-11T00:25:32.378Z","0.1.43":"2017-10-11T23:23:24.450Z","0.1.44":"2017-10-16T23:11:51.403Z","0.1.46":"2017-10-18T18:55:25.862Z","0.1.47":"2017-10-18T20:07:17.202Z","0.1.48":"2017-10-18T21:20:46.184Z","0.1.49":"2017-10-18T22:29:17.605Z","0.1.50":"2017-10-19T21:25:03.398Z","0.2.0":"2017-10-20T01:31:33.723Z","0.2.1":"2017-10-23T21:23:41.517Z","0.2.2":"2017-10-24T21:46:40.949Z","0.2.3":"2017-10-25T01:49:57.922Z","0.2.4":"2017-10-26T21:25:20.789Z","0.2.5":"2017-10-26T22:01:13.726Z","0.2.6":"2017-10-28T22:54:09.723Z","0.2.7":"2017-11-09T16:01:41.925Z","0.2.8":"2017-11-09T20:46:19.829Z","0.3.0":"2017-11-14T03:03:48.167Z","0.3.1":"2017-11-14T03:25:00.931Z","0.3.2":"2017-11-15T04:17:36.808Z","0.3.3":"2017-11-20T22:22:22.632Z","0.3.4":"2017-11-22T14:13:37.872Z","0.3.5":"2017-11-22T22:26:09.917Z","0.4.0":"2017-11-28T18:01:41.923Z","0.5.0":"2017-12-07T14:53:10.448Z","0.5.2":"2017-12-21T18:20:42.654Z","0.6.0":"2018-01-11T22:11:18.083Z","0.6.1":"2018-01-12T14:08:15.949Z","0.6.2":"2018-01-15T14:40:07.921Z","0.6.3":"2018-01-16T15:58:20.740Z","0.6.4":"2018-01-23T17:54:47.570Z","0.6.5":"2018-01-24T23:28:29.188Z","0.6.6":"2018-01-31T19:57:06.028Z","0.7.0":"2018-03-07T22:52:26.558Z","0.8.0":"2018-03-19T12:41:37.701Z","0.9.0":"2018-03-21T21:05:22.119Z","0.10.0":"2018-03-26T15:07:14.980Z","0.11.0":"2018-03-26T17:16:30.599Z","0.11.1":"2018-03-26T17:58:55.415Z","0.11.2":"2018-03-28T18:04:55.560Z","0.12.0":"2018-04-03T19:32:09.123Z","0.12.1":"2018-04-03T20:04:19.120Z","0.13.0":"2018-04-10T19:42:27.113Z","0.13.1":"2018-04-12T21:58:14.954Z","0.14.0":"2018-04-27T13:23:17.989Z","0.14.1":"2018-04-30T14:40:13.348Z","0.15.0":"2018-05-07T15:18:34.806Z","0.15.1-20180508012326":"2018-05-08T01:27:35.808Z","0.15.1-20180508014857":"2018-05-08T01:54:14.695Z","0.15.1-20180508222453":"2018-05-08T22:29:30.713Z","0.15.1-20180509000127":"2018-05-09T00:06:19.034Z","0.15.1-20180509155237":"2018-05-09T15:56:49.166Z","0.15.1-20180509173131":"2018-05-09T17:36:13.552Z","0.15.1-20180509183655":"2018-05-09T18:41:35.794Z","0.15.1-20180509202510":"2018-05-09T20:29:17.344Z","0.15.1-20180509210118":"2018-05-09T21:05:11.214Z","0.15.1-20180509210125":"2018-05-09T21:08:11.177Z","0.15.1-20180509215141":"2018-05-09T21:55:50.796Z","0.15.1":"2018-05-09T21:56:59.318Z","0.15.2-20180509220257":"2018-05-09T22:07:58.597Z","0.15.2-20180510000413":"2018-05-10T00:08:34.259Z","0.15.2-20180510013515":"2018-05-10T01:40:19.362Z","0.15.2-20180510063432":"2018-05-10T06:38:34.508Z","0.15.2-gen-intf.20180510172039":"2018-05-10T17:25:02.288Z","0.15.2-20180510191705":"2018-05-10T19:21:17.291Z","0.15.2-20180510195817":"2018-05-10T20:02:47.781Z","0.15.2-force-push.20180514174349":"2018-05-14T17:48:07.147Z","0.15.2-20180515121050":"2018-05-15T12:15:18.119Z","0.15.2-20180515133528":"2018-05-15T13:39:30.799Z","0.16.0-20180515142515":"2018-05-15T14:29:19.285Z","0.16.0-20180515153512":"2018-05-15T15:39:31.254Z","0.16.0":"2018-05-15T15:40:42.277Z","0.16.1-20180515155239":"2018-05-15T15:56:54.455Z","0.16.1-20180516224516":"2018-05-16T22:50:06.135Z","0.17.0-sdl-ingesters.20180517221419":"2018-05-17T22:19:36.213Z","0.16.1-20180518102811":"2018-05-18T10:33:09.089Z","0.17.0-20180518104139":"2018-05-18T10:46:30.613Z","0.17.0-20180518194834":"2018-05-18T19:53:22.085Z","0.17.0-set-branch-293.20180518211506":"2018-05-18T21:21:29.669Z","0.17.0-20180519040557":"2018-05-19T04:10:37.819Z","0.17.0-20180519071246":"2018-05-19T07:22:30.910Z","0.17.0-20180519101353":"2018-05-19T10:18:36.604Z","0.17.0-metadata-rewrite.20180520210605":"2018-05-20T21:10:44.276Z","0.17.0-dont-hang-after-importing-index.20180525210745":"2018-05-25T21:12:41.864Z","0.17.0-dont-hang-after-importing-index.20180525213148":"2018-05-25T21:36:41.629Z","0.17.0-dont-hang-after-importing-index.20180526075953":"2018-05-26T08:04:41.133Z","0.17.0-20180526081010":"2018-05-26T08:14:53.380Z","0.17.0-nortissej.error-on-no-graphql.20180527182914":"2018-05-27T18:33:23.200Z","0.17.0-20180528091519":"2018-05-28T09:19:23.152Z","0.17.0-20180528171322":"2018-05-28T17:17:16.945Z","0.17.0-20180528173309":"2018-05-28T17:37:19.124Z","0.17.0-20180530161602":"2018-05-30T16:20:41.604Z","0.17.0-teamConfusion.20180530151222":"2018-05-30T16:21:31.132Z","0.17.0-20180530162152":"2018-05-30T16:26:20.124Z","0.17.0-20180530163901":"2018-05-30T16:43:55.582Z","0.17.0-20180601134431":"2018-06-01T13:49:01.542Z","0.17.0-metadata-rewrite.20180601155727":"2018-06-01T16:01:41.315Z","0.17.0-20180601160201":"2018-06-01T16:06:15.809Z","0.17.0-nortissej.move-remote-repo-refs-down.20180601193745":"2018-06-01T19:39:53.646Z","0.17.0-20180601224631":"2018-06-01T22:50:37.668Z","0.17.0-nortissej.move-remote-repo-refs-down.20180602151423":"2018-06-02T15:18:14.629Z","0.17.0-nortissej.move-remote-repo-refs-down.20180602160508":"2018-06-02T16:09:16.066Z","0.17.0":"2018-06-04T17:26:28.530Z","0.17.1-20180604172725":"2018-06-04T17:31:30.238Z","0.17.1-20180604173623":"2018-06-04T17:40:28.047Z","0.17.1-20180604174106":"2018-06-04T17:45:10.007Z","0.17.1":"2018-06-04T18:02:49.587Z","0.17.2-20180604180339":"2018-06-04T18:07:36.470Z","0.17.2-nortissej.move-remote-repo-refs-down.20180604211000":"2018-06-04T21:14:08.264Z","0.17.2-20180605032022":"2018-06-05T03:24:11.988Z","0.17.2-nortissej.restore-console.20180608013008":"2018-06-08T01:33:55.968Z","0.17.2-nortissej.restore-console.20180608015149":"2018-06-08T01:55:56.362Z","0.17.2-20180608015228":"2018-06-08T01:56:28.053Z","0.17.2-20180609073916":"2018-06-09T07:43:11.503Z","0.17.2-20180609132323":"2018-06-09T13:27:08.328Z","0.17.2-20180611215142":"2018-06-11T21:55:42.435Z","0.17.2-20180613124603":"2018-06-13T12:50:04.824Z","0.17.2-20180613153815":"2018-06-13T15:42:00.448Z","0.17.2":"2018-06-15T23:33:37.685Z","0.17.3-20180615233424":"2018-06-15T23:38:16.542Z","0.17.3-20180618085114":"2018-06-18T08:55:04.002Z","0.17.3-20180618091145":"2018-06-18T09:15:32.740Z","0.17.3-20180618123137":"2018-06-18T12:35:28.236Z","0.17.3-20180618132425":"2018-06-18T13:29:15.061Z","0.17.3-20180618234543":"2018-06-18T23:50:33.467Z","0.17.3-nortissej.bb-curl-or-axios.20180618234615":"2018-06-18T23:50:44.919Z","0.17.3-20180619082958":"2018-06-19T08:34:06.607Z","0.17.3-20180619092428":"2018-06-19T09:28:35.744Z","0.17.3-nortissej.pass-visibility.20180619201528":"2018-06-19T20:19:27.003Z","0.17.3-20180619201819":"2018-06-19T20:22:39.828Z","0.17.3-20180619202126":"2018-06-19T20:25:37.379Z","0.17.3":"2018-06-19T21:44:06.412Z","0.17.4-20180619214533":"2018-06-19T21:49:55.067Z","0.17.4-20180621144910":"2018-06-21T14:54:22.015Z","0.17.4-20180626092108":"2018-06-26T09:25:09.012Z","0.17.4-20180628122721":"2018-06-28T12:33:10.859Z","0.17.4-20180628124808":"2018-06-28T12:52:23.800Z","0.17.4-20180628134316":"2018-06-28T13:47:46.061Z","0.17.4-functional-event.20180628192301":"2018-06-28T19:26:17.193Z","0.17.4-20180628204109":"2018-06-28T20:44:04.495Z","0.17.4-20180629192728":"2018-06-29T19:30:27.290Z","0.17.4-kube-cli.20180629230320":"2018-06-29T23:06:17.194Z","0.17.4-20180629234329":"2018-06-29T23:46:35.254Z","0.18.0-20180702115218":"2018-07-02T11:55:46.389Z","0.18.0-20180702155841":"2018-07-02T16:01:45.108Z","0.18.0-20180703131820":"2018-07-03T13:23:07.616Z","0.18.0-20180703134737":"2018-07-03T13:52:37.693Z","0.18.0-20180703135350":"2018-07-03T13:58:36.863Z","0.18.0-20180704102519":"2018-07-04T10:30:14.820Z","0.18.0-nortissej.consistent-anyprojecteditor.20180705000729":"2018-07-05T00:12:12.126Z","0.18.0-20180705132448":"2018-07-05T13:30:21.656Z","0.18.0-20180705162739":"2018-07-05T16:32:26.983Z","0.18.0-deprecate-cli-315.20180706210841":"2018-07-06T21:13:07.081Z","0.18.0-20180707234509":"2018-07-07T23:49:25.516Z","0.18.0-20180709015914":"2018-07-09T02:03:43.639Z","0.18.0-20180709045820":"2018-07-09T05:02:21.829Z","0.18.0-20180709103453":"2018-07-09T10:37:26.203Z","0.18.0-20180710091719":"2018-07-10T09:21:52.908Z","0.18.0-20180710131258":"2018-07-10T13:17:22.747Z","0.18.0-20180711143021":"2018-07-11T14:35:16.649Z","0.18.0-20180711143049":"2018-07-11T14:35:39.797Z","0.18.0-hide-flushable.20180711230533":"2018-07-11T23:10:00.273Z","0.18.0-20180712045047":"2018-07-12T04:55:13.660Z","0.18.0-20180712071634":"2018-07-12T07:21:23.826Z","0.18.0-20180713043042":"2018-07-13T04:35:15.287Z","0.18.0-20180713091022":"2018-07-13T09:15:06.222Z","0.18.0-20180713094517":"2018-07-13T09:50:38.109Z","0.18.0-20180715093005":"2018-07-15T09:34:25.015Z","0.18.0-20180715093009":"2018-07-15T09:34:54.081Z","0.18.0-20180719235547":"2018-07-20T00:00:35.207Z","0.18.0-config-open.20180720003922":"2018-07-20T00:43:45.417Z","0.18.0-config-open.20180720020435":"2018-07-20T02:09:12.805Z","0.18.0-config-open.20180720025641":"2018-07-20T03:01:14.377Z","0.18.0-20180720105353":"2018-07-20T10:59:23.180Z","0.18.0-20180720110724":"2018-07-20T11:11:52.890Z","0.18.0-20180722063228":"2018-07-22T06:37:21.844Z","0.18.0-20180723054539":"2018-07-23T05:50:25.397Z","0.18.0-20180723135411":"2018-07-23T13:59:18.394Z","0.18.0-http-factory.20180723230601":"2018-07-23T23:10:58.649Z","0.18.0-20180724045318":"2018-07-24T04:58:12.329Z","0.18.0-20180724053014":"2018-07-24T05:34:58.955Z","0.18.0-20180724064421":"2018-07-24T06:49:15.362Z","0.18.0-20180724133126":"2018-07-24T13:36:21.498Z","0.18.0-nortissej.no-private-class-fields.20180724185125":"2018-07-24T18:55:42.640Z","0.18.0-20180724191657":"2018-07-24T19:21:37.659Z","0.18.0-nortissej.no-private-class-fields.20180724194419":"2018-07-24T19:49:23.244Z","0.18.0-20180724200455":"2018-07-24T20:10:01.595Z","0.18.0-20180724234011":"2018-07-24T23:45:29.502Z","0.18.0-20180725121542":"2018-07-25T12:20:26.432Z","0.18.0-20180725160322":"2018-07-25T16:08:34.338Z","0.18.0-20180725160538":"2018-07-25T16:11:09.017Z","0.18.0-nortissej.fewer-private-fields.20180725183107":"2018-07-25T18:36:00.426Z","0.18.0-20180725183614":"2018-07-25T18:41:33.329Z","0.18.0-20180726075348":"2018-07-26T07:58:15.946Z","0.18.0-run-command.20180726203335":"2018-07-26T20:37:56.480Z","0.18.0-run-command.20180726211157":"2018-07-26T21:16:35.404Z","0.18.0-20180726212606":"2018-07-26T21:31:00.865Z","0.18.0-run-command.20180726212701":"2018-07-26T21:40:02.769Z","0.18.0-run-command.20180726213119":"2018-07-26T21:43:55.515Z","0.18.0-20180726225322":"2018-07-26T22:57:57.019Z","0.18.0":"2018-07-26T23:42:07.295Z","0.18.1-20180726234320":"2018-07-26T23:47:52.748Z","0.18.1-nortissej.elide-axios-response.20180728190946":"2018-07-28T19:13:54.162Z","0.18.1-nortissej.elide-axios-response.20180728191922":"2018-07-28T19:23:48.385Z","0.18.1-20180728225753":"2018-07-28T23:02:19.961Z","0.18.1-nortissej.defend-against-circles.20180728235637":"2018-07-29T00:00:41.274Z","0.18.1-nortissej.defend-against-circles.20180729003756":"2018-07-29T00:42:00.481Z","0.18.1-20180730230821":"2018-07-30T23:13:07.922Z","0.18.1-api-keys.20180730230936":"2018-07-30T23:14:24.051Z","0.18.1":"2018-07-31T07:32:49.192Z","0.18.2-20180731073354":"2018-07-31T07:38:41.203Z","0.19.0-api-keys.20180731080018":"2018-07-31T08:05:00.657Z","0.19.0-api-keys.20180731081614":"2018-07-31T08:21:10.494Z","0.19.0-api-keys.20180731165353":"2018-07-31T16:58:29.040Z","0.18.2-20180731173624":"2018-07-31T17:41:11.623Z","0.19.0-20180731181755":"2018-07-31T18:22:30.311Z","0.19.0-20180731193429":"2018-07-31T19:39:16.448Z","0.19.0":"2018-07-31T20:29:14.260Z","0.19.1-20180731211352":"2018-07-31T21:18:51.929Z","0.19.1-20180801085032":"2018-08-01T08:55:07.079Z","0.19.1-expose-child.20180801101344":"2018-08-01T10:18:30.777Z","0.19.1-20180801114956":"2018-08-01T11:54:36.733Z","0.19.1-20180801145628":"2018-08-01T15:01:26.902Z","0.19.1":"2018-08-01T15:06:17.953Z","0.19.2-20180801150715":"2018-08-01T15:12:18.713Z","0.19.2-20180801210538":"2018-08-01T21:10:17.876Z","0.19.2-20180801223358":"2018-08-01T22:38:36.257Z","0.19.2-20180801224313":"2018-08-01T22:48:18.935Z","0.19.2-20180802060634":"2018-08-02T06:11:20.202Z","0.19.2-20180802092318":"2018-08-02T09:27:51.706Z","0.19.2-20180802092758":"2018-08-02T09:32:41.168Z","0.19.2-20180802095618":"2018-08-02T10:01:04.949Z","0.19.2-20180802110107":"2018-08-02T11:06:12.414Z","0.19.2-20180802140457":"2018-08-02T14:09:38.401Z","0.19.2-20180802150457":"2018-08-02T15:09:36.845Z","0.19.2-20180802151323":"2018-08-02T15:17:50.801Z","0.19.2-20180802151801":"2018-08-02T15:22:49.523Z","0.19.2":"2018-08-02T15:30:45.478Z","0.19.3-20180802153147":"2018-08-02T15:36:32.227Z","0.19.3-20180802153303":"2018-08-02T15:37:38.676Z","0.19.3-20180802154222":"2018-08-02T15:47:08.691Z","0.19.3-20180802164929":"2018-08-02T17:18:13.765Z","0.19.3":"2018-08-02T17:28:23.970Z","0.19.4-20180802172930":"2018-08-02T17:34:08.786Z","0.19.4-20180802183906":"2018-08-02T18:43:58.371Z","0.19.4-20180802195721":"2018-08-02T20:02:18.105Z","0.19.4":"2018-08-02T20:04:23.247Z","0.19.5-20180802200539":"2018-08-02T20:10:32.594Z","0.19.5-nortissej.editMode.20180803061052":"2018-08-03T06:14:59.657Z","0.19.5-nortissej.editMode.20180803062423":"2018-08-03T06:52:30.165Z","0.19.5-20180803133438":"2018-08-03T13:39:17.029Z","0.19.5-nortissej.report-editing-errors.20180803211622":"2018-08-03T21:20:59.181Z","0.19.5-nortissej.report-editing-errors.20180803213716":"2018-08-03T21:41:42.742Z","0.19.5-20180803222129":"2018-08-03T22:26:16.680Z","0.19.5-20180807011450":"2018-08-07T01:19:09.752Z","0.19.5":"2018-08-07T03:38:58.745Z","0.19.6-20180807034215":"2018-08-07T03:46:39.121Z","0.19.6-20180807113642":"2018-08-07T11:42:06.321Z","0.19.6-20180807212037":"2018-08-07T21:25:17.184Z","0.19.6":"2018-08-07T21:27:38.578Z","0.19.7-20180807212849":"2018-08-07T21:33:50.609Z","0.19.7-operation-name.20180808063209":"2018-08-08T06:37:18.664Z","0.19.7-operation-name.20180808063643":"2018-08-08T06:42:19.122Z","0.19.7-operation-name.20180808063931":"2018-08-08T06:44:47.168Z","0.19.7-operation-name.20180808070417":"2018-08-08T07:09:03.545Z","0.19.7-operation-name.20180808164635":"2018-08-08T16:51:17.582Z","0.19.7-20180809140531":"2018-08-09T14:10:10.732Z","0.19.7-20180809141155":"2018-08-09T14:17:26.591Z","0.19.7":"2018-08-09T14:20:47.913Z","0.19.8-20180809142157":"2018-08-09T14:26:59.801Z","0.20.0-20180809142545":"2018-08-09T14:30:40.080Z","0.20.0-20180809143213":"2018-08-09T14:37:11.786Z","0.20.0-20180809201011":"2018-08-09T20:15:40.421Z","0.20.0":"2018-08-09T20:16:16.690Z","0.20.1-20180809201733":"2018-08-09T20:22:51.815Z","0.20.1-20180810085422":"2018-08-10T08:59:16.495Z","0.20.1-20180810113728":"2018-08-10T11:42:20.542Z","0.20.1-linearize-builds.20180810194909":"2018-08-10T19:53:37.106Z","0.20.1-20180810203849":"2018-08-10T20:43:33.528Z","0.20.1":"2018-08-10T21:15:43.653Z","0.20.2-20180810211649":"2018-08-10T21:21:23.920Z","0.20.2-20180813155110":"2018-08-13T15:56:25.397Z","0.20.2-20180814132020":"2018-08-14T13:25:35.677Z","0.20.2-cross-spawn.20180814132336":"2018-08-14T13:28:43.600Z","0.20.2-20180815145123":"2018-08-15T14:56:33.764Z","0.20.2":"2018-08-16T17:11:46.347Z","0.20.3-20180816171253":"2018-08-16T17:17:57.671Z","0.20.3-20180816181405":"2018-08-16T18:19:36.677Z","0.20.3":"2018-08-16T18:22:34.810Z","0.20.4-20180816182344":"2018-08-16T18:28:44.191Z","0.20.4-proxy.20180816203206":"2018-08-16T20:37:21.569Z","0.20.4-bin-scripts.20180817192728":"2018-08-17T19:32:27.305Z","0.20.4-bin-scripts.20180817192952":"2018-08-17T19:34:53.919Z","0.20.4-20180817193509":"2018-08-17T19:40:06.493Z","0.20.4":"2018-08-17T19:44:45.191Z","0.20.5-20180817194557":"2018-08-17T19:50:53.015Z","0.21.0-bin-bin.20180817195847":"2018-08-17T20:03:36.674Z","0.21.0-20180817204907":"2018-08-17T20:54:37.797Z","0.21.0":"2018-08-17T20:58:15.848Z","0.21.1-20180817205933":"2018-08-17T21:04:21.853Z","0.21.1-20180818155120":"2018-08-18T15:55:38.524Z","0.21.1":"2018-08-18T19:27:13.094Z","0.21.2-20180818192813":"2018-08-18T19:32:31.828Z","0.21.2-deps-update.20180821124504":"2018-08-21T12:48:49.398Z","0.21.2-deps-update.20180821130422":"2018-08-21T13:08:17.598Z","0.21.2-deps-update.20180821131636":"2018-08-21T13:20:15.462Z","0.21.2-deps-update.20180821133921":"2018-08-21T13:43:13.850Z","0.21.2-deps-update.20180821134458":"2018-08-21T13:49:06.006Z","0.21.2-deps-update.20180821134553":"2018-08-21T13:50:19.090Z","0.21.2-20180821135621":"2018-08-21T14:00:21.512Z","0.21.2":"2018-08-21T14:01:40.804Z","0.21.3-20180821140244":"2018-08-21T14:06:35.429Z","0.21.3-20180821161402":"2018-08-21T16:18:09.942Z","0.20.4-proxy.20180821162036":"2018-08-21T16:25:28.531Z","0.21.3-20180821172713":"2018-08-21T17:31:08.863Z","0.21.3-20180821172905":"2018-08-21T17:33:22.840Z","0.21.3":"2018-08-21T17:38:52.145Z","0.21.4-20180821174003":"2018-08-21T17:44:17.322Z","0.21.4-20180821203311":"2018-08-21T20:37:12.255Z","0.21.4":"2018-08-21T20:39:18.674Z","0.21.5-20180821204047":"2018-08-21T20:44:45.648Z","0.21.5-20180821205624":"2018-08-21T21:00:22.983Z","0.21.5-20180822020855":"2018-08-22T02:12:48.246Z","0.21.5-20180823100823":"2018-08-23T10:13:17.091Z","0.21.5":"2018-08-23T10:23:10.297Z","0.21.6-20180823102447":"2018-08-23T10:29:10.301Z","0.21.6-20180823121022":"2018-08-23T12:14:06.258Z","0.21.6":"2018-08-23T12:16:30.817Z","0.21.7-20180823121743":"2018-08-23T12:21:53.268Z","0.21.7-20180823122629":"2018-08-23T12:30:20.745Z","0.21.7":"2018-08-23T12:39:35.088Z","0.21.8-20180823124031":"2018-08-23T12:44:45.358Z","0.21.8-20180824230634":"2018-08-24T23:10:56.178Z","0.21.8":"2018-08-24T23:11:26.562Z","0.21.9-20180824231228":"2018-08-24T23:17:13.327Z","1.0.0-M.1":"2018-08-27T09:29:42.473Z","1.0.0-M.1-20180827101310":"2018-08-27T10:17:16.361Z","1.0.0-20180827101904":"2018-08-27T10:23:13.941Z","1.0.0-master.20180827152750":"2018-08-27T15:31:46.532Z","1.0.0-M.2":"2018-08-27T16:47:59.397Z","1.0.0-master.20180827185035":"2018-08-27T18:54:50.255Z","1.0.0-master.20180827190033":"2018-08-27T19:04:36.668Z","1.0.0-nortissej.return-404-for-no-event-handlers.20180827224200":"2018-08-27T22:45:30.312Z","1.0.0-master.20180828081342":"2018-08-28T08:18:49.731Z","1.0.0-master.20180828120312":"2018-08-28T12:07:13.035Z","1.0.0-master.20180828220516":"2018-08-28T22:09:55.978Z","1.0.0-master.20180829064317":"2018-08-29T06:47:14.527Z","1.0.0-master.20180829070856":"2018-08-29T07:13:11.693Z","1.0.0-master.20180829090821":"2018-08-29T09:15:53.051Z","1.0.0-master.20180829152002":"2018-08-29T15:25:24.730Z","1.0.0-metrics.20180830121623":"2018-08-30T12:20:25.776Z","1.0.0-master.20180830123633":"2018-08-30T12:40:47.026Z","1.0.0-master.20180830202336":"2018-08-30T20:27:28.930Z","1.0.0-master.20180831010955":"2018-08-31T01:14:03.817Z","1.0.0-remove-deprecation.20180831091843":"2018-08-31T09:22:22.147Z","1.0.0-master.20180831095541":"2018-08-31T09:59:54.281Z","1.0.0-remove-deprecation.20180831095627":"2018-08-31T10:00:39.681Z","1.0.0-master.20180831121947":"2018-08-31T12:24:16.553Z","1.0.0-master.20180831124448":"2018-08-31T12:48:51.558Z","1.0.0-pull-up-id.20180901012146":"2018-09-01T01:25:36.907Z","1.0.0-master.20180901082459":"2018-09-01T08:29:02.465Z","1.0.0-message-client.20180901165917":"2018-09-01T17:03:19.657Z","1.0.0-remove-deprecation.20180901142930":"2018-09-01T17:29:22.780Z","1.0.0-master.20180901183023":"2018-09-01T18:34:14.576Z","1.0.0-remove-deprecation.20180901183348":"2018-09-01T18:37:23.125Z","1.0.0-master.20180901185845":"2018-09-01T19:02:32.376Z","1.0.0-master.20180902103822":"2018-09-02T10:42:03.100Z","1.0.0-master.20180902124855":"2018-09-02T12:52:43.023Z","1.0.0-master.20180902125238":"2018-09-02T12:56:32.312Z","1.0.0-master.20180902163213":"2018-09-02T16:35:32.921Z","1.0.0-master.20180903210158":"2018-09-03T21:05:46.941Z","1.0.0-remove-team-token.20180903220724":"2018-09-03T22:11:22.981Z","1.0.0-api-pruning.20180904021531":"2018-09-04T02:18:17.226Z","1.0.0-has-file.20180904121933":"2018-09-04T12:23:24.832Z","1.0.0-api-pruning.20180904122200":"2018-09-04T12:29:39.715Z","1.0.0-master.20180904123624":"2018-09-04T12:42:10.521Z","1.0.0-nortissej.error-message.20180904124228":"2018-09-04T12:47:08.689Z","1.0.0-master.20180904130035":"2018-09-04T13:04:47.413Z","1.0.0-master.20180904130139":"2018-09-04T13:06:14.557Z","1.0.0-nortissej.error-message.20180904130812":"2018-09-04T13:10:29.736Z","1.0.0-master.20180904134011":"2018-09-04T13:46:35.501Z","1.0.0-M.3":"2018-09-04T14:23:12.050Z","1.0.0-nortissej.make-reset-goals-optional.20180904161017":"2018-09-04T16:58:03.122Z","1.0.0-master.20180904201520":"2018-09-04T20:27:34.547Z","1.0.0-execute-bits-345.20180904225753":"2018-09-04T23:01:42.606Z","1.0.0-master.20180905012114":"2018-09-05T01:25:08.034Z","1.0.0-nortissej.error-message.20180905012528":"2018-09-05T01:29:18.247Z","1.0.0-master.20180905082419":"2018-09-05T08:27:51.731Z","1.0.0-master.20180905201706":"2018-09-05T20:21:00.785Z","1.0.0-file-directory.20180906032509":"2018-09-06T06:15:55.454Z","1.0.0-master.20180906143609":"2018-09-06T14:40:39.458Z","1.0.0-master.20180906171251":"2018-09-06T17:17:26.514Z","1.0.0-nortissej.doc.20180906174130":"2018-09-06T17:45:35.293Z","1.0.0-master.20180906174556":"2018-09-06T17:50:26.211Z","1.0.0-master.20180906181912":"2018-09-06T18:23:57.725Z","1.0.0-master.20180906201756":"2018-09-06T20:26:23.656Z","1.0.0-master.20180906203426":"2018-09-06T20:38:39.344Z","1.0.0-project-utils-update.20180906213507":"2018-09-06T21:38:36.915Z","1.0.0-master.20180907083717":"2018-09-07T08:41:07.611Z","1.0.0-master.20180907111850":"2018-09-07T11:22:46.343Z","1.0.0-nortissej.gather.20180907205444":"2018-09-07T20:58:24.867Z","1.0.0-master.20180908012014":"2018-09-08T01:24:13.314Z","1.0.0-master.20180908115540":"2018-09-08T11:59:44.495Z","1.0.0-master.20180908143715":"2018-09-08T14:41:43.570Z","1.0.0-master.20180908173001":"2018-09-08T17:34:14.160Z","1.0.0-nortissej.error-print.20180910194841":"2018-09-10T19:52:33.753Z","1.0.0-master.20180910201053":"2018-09-10T20:15:50.748Z","1.0.0-nortissej.retain-branch.20180910205640":"2018-09-10T21:00:37.583Z","1.0.0-master.20180910232423":"2018-09-10T23:29:39.443Z","1.0.0-nortissej.checkout-branch.20180911043314":"2018-09-11T04:36:47.179Z","1.0.0-nortissej.checkout-branch.20180911051036":"2018-09-11T05:14:39.624Z","1.0.0-master.20180911085654":"2018-09-11T09:11:56.042Z","1.0.0-master.20180911182544":"2018-09-11T18:29:50.153Z","1.0.0-winston3.20180912092138":"2018-09-12T09:26:14.365Z","1.0.0-winston3.20180912093517":"2018-09-12T09:39:41.159Z","1.0.0-winston3.20180912095236":"2018-09-12T09:56:41.656Z","1.0.0-winston3.20180912133203":"2018-09-12T13:36:05.747Z","1.0.0-master.20180912152058":"2018-09-12T15:26:27.229Z","1.0.0-winston3.20180912151525":"2018-09-12T15:27:27.038Z","1.0.0-master.20180912194336":"2018-09-12T19:47:44.334Z","1.0.0-asyncHooks.20180912213746":"2018-09-12T21:41:38.803Z","1.0.0-asyncHooks.20180912223310":"2018-09-12T22:36:57.377Z","1.0.0-cross-spawn-git.20180913011127":"2018-09-13T01:15:40.483Z","1.0.0-master.20180913011618":"2018-09-13T01:20:19.562Z","1.0.0-cross-spawn-git.20180913011840":"2018-09-13T01:22:58.959Z","1.0.0-tree-path-upgrade.20180913022125":"2018-09-13T02:25:47.233Z","1.0.0-master.20180913030848":"2018-09-13T03:12:59.620Z","1.0.0-master.20180913034607":"2018-09-13T03:50:41.205Z","1.0.0-master.20180913035245":"2018-09-13T03:58:39.276Z","1.0.0-master.20180913071451":"2018-09-13T07:18:51.488Z","1.0.0-master.20180913093131":"2018-09-13T09:37:32.654Z","1.0.0-asyncHooks.20180913093353":"2018-09-13T09:38:32.280Z","1.0.0-atomist-update-branch-master-1536840297926.20180913122335":"2018-09-13T12:27:49.008Z","1.0.0-master.20180913124508":"2018-09-13T12:48:38.133Z","1.0.0-atomist-update-branch-master-1536840297926.20180913131245":"2018-09-13T13:15:44.146Z","1.0.0-atomist-update-branch-master-1536840297926.20180913132055":"2018-09-13T13:23:36.681Z","1.0.0-master.20180913132923":"2018-09-13T13:32:23.172Z","1.0.0-master.20180913134559":"2018-09-13T13:49:34.513Z","1.0.0-asyncHooks.20180913135347":"2018-09-13T14:00:21.270Z","1.0.0-master.20180913144729":"2018-09-13T14:51:26.484Z","1.0.0-master.20180913193712":"2018-09-13T19:41:01.528Z","1.0.0-asyncHooks.20180913200633":"2018-09-13T20:13:05.381Z","1.0.0-master.20180913202340":"2018-09-13T20:27:27.779Z","1.0.0-master.20180913203655":"2018-09-13T20:40:40.203Z","1.0.0-master.20180913204515":"2018-09-13T20:49:21.027Z","1.0.0-augment-index.20180913212236":"2018-09-13T21:26:54.300Z","1.0.0-master.20180913214030":"2018-09-13T21:44:13.279Z","1.0.0-master.20180913231034":"2018-09-13T23:14:18.934Z","1.0.0-master.20180914094511":"2018-09-14T09:48:52.764Z","1.0.0-master.20180914103733":"2018-09-14T10:41:40.609Z","1.0.0-master.20180914105318":"2018-09-14T10:57:24.048Z","1.0.0-master.20180914115718":"2018-09-14T12:04:25.866Z","1.0.0-master.20180914123233":"2018-09-14T12:36:48.013Z","1.0.0-master.20180914125809":"2018-09-14T13:02:39.582Z","1.0.0-master.20180914162458":"2018-09-14T16:29:00.400Z","1.0.0-master.20180914205010":"2018-09-14T20:54:49.675Z","1.0.0-master.20180915075522":"2018-09-15T07:59:33.614Z","1.0.0-atomist-update-1.0.0-M.4-1537089712378.20180916092159":"2018-09-16T09:26:03.610Z","1.0.0-master.20180916092717":"2018-09-16T09:31:02.761Z","1.0.0-atomist-update-1.0.0-1537090849927.20180916094057":"2018-09-16T09:44:47.920Z","1.0.0-master.20180916094603":"2018-09-16T09:50:07.814Z","1.0.0-M.4":"2018-09-16T10:27:14.255Z","1.0.0-homedir.20180917191628":"2018-09-17T19:20:46.643Z","1.0.0-master.20180917210332":"2018-09-17T21:07:55.242Z","1.0.0-master.20180918005354":"2018-09-18T00:58:06.687Z","1.0.0-export-spawn.20180918180433":"2018-09-18T18:08:25.057Z","1.0.0-master.20180918193639":"2018-09-18T19:46:09.732Z","1.0.0-cross-kill-74.20180924165644":"2018-09-24T17:01:46.843Z","1.0.0-master.20180925122935":"2018-09-25T12:33:23.929Z","1.0.0-master.20180926012829":"2018-09-26T01:30:49.192Z","1.0.0-master.20180926013425":"2018-09-26T01:38:56.327Z","1.0.0-master.20180926172615":"2018-09-26T17:30:24.434Z","1.0.0-M.5":"2018-09-26T17:42:15.760Z","1.0.0-master.20180927151607":"2018-09-27T15:20:14.395Z","1.0.0-master.20180927210106":"2018-09-27T21:05:35.898Z","1.0.0-master.20180927214650":"2018-09-27T21:50:55.635Z","1.0.0-master.20180927220715":"2018-09-27T22:10:51.940Z","1.0.0-axios-upgrade.20180928063238":"2018-09-28T06:36:16.636Z","1.0.0-master.20180928123454":"2018-09-28T12:38:13.062Z","1.0.0-M.5a":"2018-09-28T13:12:07.474Z","1.0.0-pr-body-name-387.20181002211851":"2018-10-02T21:22:56.523Z","1.0.0-master.20181002220753":"2018-10-02T22:11:18.298Z","1.0.0-more-export-for-sdm.20181005201538":"2018-10-05T20:19:36.921Z","1.0.0-master.20181005204759":"2018-10-05T20:51:54.134Z","1.0.0-master.20181006002158":"2018-10-06T00:25:57.519Z","1.0.0-scope-exports.20181006012153":"2018-10-06T01:25:48.761Z","1.0.0-master.20181007143042":"2018-10-07T14:34:16.080Z","1.0.0-master.20181008113855":"2018-10-08T11:42:24.047Z","1.0.0-master.20181009205007":"2018-10-09T20:54:00.760Z","1.0.0-public-index-391.20181009212723":"2018-10-09T21:31:18.476Z","1.0.0-public-index-391.20181009214138":"2018-10-09T21:45:37.118Z","1.0.0-public-index-391.20181009234347":"2018-10-09T23:47:37.697Z","1.0.0-master.20181010065455":"2018-10-10T06:58:33.056Z","1.0.0-master.20181010072947":"2018-10-10T07:34:02.934Z","1.0.0-master.20181010073032":"2018-10-10T07:34:24.086Z","1.0.0-master.20181010073224":"2018-10-10T07:36:29.387Z","1.0.0-master.20181010081045":"2018-10-10T08:14:21.711Z","1.0.0-master.20181010203902":"2018-10-10T20:42:59.023Z","1.0.0-master.20181010204819":"2018-10-10T20:52:11.902Z","1.0.0-master.20181015105305":"2018-10-15T10:56:30.484Z","1.0.0-RC.1":"2018-10-15T11:01:04.925Z","1.0.0-master.20181016044705":"2018-10-16T04:50:40.264Z","1.0.0-gql-gen-ignore-ingesters.20181016200844":"2018-10-16T20:12:19.570Z","1.0.0-master.20181016201413":"2018-10-16T20:17:42.210Z","1.0.0-master.20181017152232":"2018-10-17T15:26:04.534Z","1.0.0-master.20181017160341":"2018-10-17T16:07:23.567Z","1.0.0-nortissej.some-apidoc-on-fingerprint.20181019174205":"2018-10-19T17:45:43.833Z","1.0.0-master.20181019184257":"2018-10-19T18:47:15.144Z","1.0.0-master.20181025105548":"2018-10-25T11:00:54.906Z","1.0.0-master.20181030141449":"2018-10-30T14:18:50.134Z","1.0.0-atomist-update-1.0.0-RC.2-1540908165069.20181030142607":"2018-10-30T14:30:11.378Z","1.0.0-master.20181030143226":"2018-10-30T14:36:35.258Z","1.0.0-RC.2":"2018-10-30T14:37:45.222Z","1.0.0-master.20181102085719":"2018-11-02T09:06:31.974Z","1.0.0-master.20181102091953":"2018-11-02T09:23:47.383Z","1.0.0-master.20181102112036":"2018-11-02T11:24:50.230Z","1.0.0-master.20181102122016":"2018-11-02T12:24:47.734Z","1.0.0-master.20181102122147":"2018-11-02T12:25:38.701Z","1.0.0-master.20181103143231":"2018-11-03T14:36:24.053Z","1.0.0-master.20181104002253":"2018-11-04T00:26:35.210Z","1.0.0":"2018-11-05T09:26:42.638Z","1.0.0-master.20181105094555":"2018-11-05T09:49:55.288Z","1.0.0-gitlab-support.20181105095044":"2018-11-05T09:54:51.100Z","1.0.0-gitlab-support.20181105103108":"2018-11-05T10:35:04.134Z","1.0.0-master.20181105110621":"2018-11-05T11:10:17.292Z","1.0.0-gitlab-support.20181105144737":"2018-11-05T14:52:30.420Z","1.0.0-gitlab-support.20181105151807":"2018-11-05T15:22:22.279Z","1.0.0-gitlab-support.20181105162132":"2018-11-05T16:25:35.868Z","1.0.0-master.20181105224410":"2018-11-05T22:48:07.402Z","1.0.0-master.20181106085420":"2018-11-06T08:58:26.389Z","1.0.0-gitlab-support.20181106104653":"2018-11-06T10:51:13.404Z","1.0.0-gitlab-support.20181106152427":"2018-11-06T15:28:32.145Z","1.0.0-gitlab-support.20181107135722":"2018-11-07T14:01:32.649Z","1.0.0-gitlab-support.20181107141157":"2018-11-07T14:16:41.932Z","1.0.0-gitlab-support.20181108144933":"2018-11-08T14:53:44.641Z","1.0.0-gitlab-support.20181108145135":"2018-11-08T14:56:07.180Z","1.0.0-gitlab-support.20181108152750":"2018-11-08T15:33:02.775Z","1.0.0-master.20181108153752":"2018-11-08T15:42:37.796Z","1.0.0-gitlab-support.20181108153403":"2018-11-08T15:56:34.235Z","1.0.0-gitlab-support.20181108165629":"2018-11-08T17:00:54.885Z","1.0.0-master.20181109092215":"2018-11-09T09:25:48.564Z","1.0.0-master.20181109092947":"2018-11-09T09:33:26.634Z","1.0.1-master.20181109095334":"2018-11-09T09:59:37.909Z","1.0.1":"2018-11-09T10:07:10.127Z","1.0.2-master.20181110081120":"2018-11-10T08:14:54.160Z","1.1.0-master.20181110132646":"2018-11-10T13:30:16.178Z","1.1.0-master.20181113125908":"2018-11-13T13:02:54.566Z","1.1.0-update-graphql-code-generator.20181113133345":"2018-11-13T13:37:58.409Z","1.1.0-update-graphql-code-generator.20181113135015":"2018-11-13T13:53:16.471Z","1.1.0-update-graphql-code-generator.20181113143249":"2018-11-13T14:35:54.682Z","1.1.0-master.20181113143813":"2018-11-13T14:41:29.978Z","1.1.0-master.20181113143943":"2018-11-13T14:42:39.455Z","1.1.0-review-comment.20181113153255":"2018-11-13T15:35:39.724Z","1.1.0-master.20181113155909":"2018-11-13T16:02:06.811Z","1.1.0-master.20181113181046":"2018-11-13T18:13:28.785Z","1.1.0-master.20181113184417":"2018-11-13T19:16:53.342Z","1.1.0-master.20181114141144":"2018-11-14T14:14:42.017Z","1.1.0-master.20181115072619":"2018-11-15T07:29:01.753Z","1.1.0-master.20181115121154":"2018-11-15T12:15:02.517Z","1.1.0-master.20181115121400":"2018-11-15T12:16:37.519Z","1.1.0-master.20181115131826":"2018-11-15T13:21:17.826Z","1.1.0-master.20181116082132":"2018-11-16T08:24:05.792Z","1.0.0-gitlab-support.20181116141120":"2018-11-16T14:14:24.012Z","1.1.0-deprecate-spawn-exec.20181117030236":"2018-11-17T03:05:07.608Z","1.1.0-deprecate-spawn-exec.20181118025118":"2018-11-18T02:54:11.389Z","1.1.0-deprecate-spawn-exec.20181119135048":"2018-11-19T13:53:31.026Z","1.1.0-deprecate-spawn-exec.20181119140326":"2018-11-19T14:11:21.933Z","1.1.0-deprecate-spawn-exec.20181119155845":"2018-11-19T16:01:29.550Z","1.1.0-deprecate-spawn-exec.20181119182424":"2018-11-19T18:27:11.068Z","1.1.0-master.20181119192146":"2018-11-19T19:24:28.162Z","1.1.0-master.20181119192354":"2018-11-19T19:27:28.650Z","1.1.0-master.20181119192552":"2018-11-19T19:29:01.311Z","1.1.0-master.20181119204931":"2018-11-19T20:52:17.391Z","1.1.0-master.20181120170905":"2018-11-20T17:11:39.033Z","1.1.0-master.20181121110042":"2018-11-21T11:03:34.515Z","1.1.0-master.20181121110216":"2018-11-21T11:04:59.656Z","1.1.0-master.20181121142425":"2018-11-21T14:27:24.273Z","1.1.0-master.20181124170930":"2018-11-24T17:12:11.558Z","1.1.0-master.20181124171043":"2018-11-24T17:13:12.281Z","1.1.0-master.20181127074649":"2018-11-27T07:49:24.390Z","1.1.0-master.20181127133630":"2018-11-27T13:40:08.308Z","1.1.0-http-client-config.20181128102630":"2018-11-28T10:29:16.675Z","1.1.0-http-client-config.20181128123248":"2018-11-28T12:35:33.390Z","1.1.0-http-client-config.20181128173247":"2018-11-28T17:35:38.064Z","1.1.0-master.20181129132207":"2018-11-29T13:24:35.842Z","1.1.0-master.20181129143544":"2018-11-29T14:39:06.870Z","1.1.0-http-client-config.20181129144034":"2018-11-29T14:43:23.958Z","1.1.0-http-client-config.20181129174906":"2018-11-29T17:51:46.624Z","1.1.0-master.20181129175302":"2018-11-29T17:55:44.873Z","1.1.0-master.20181130221533":"2018-11-30T22:18:16.745Z","1.1.0-master.20181203230746":"2018-12-03T23:10:16.327Z","1.1.0-master.20181204083556":"2018-12-04T08:38:23.458Z","1.1.0-master.20181204113628":"2018-12-04T11:39:33.939Z","1.1.0-master.20181205110517":"2018-12-05T11:08:00.465Z","1.1.0-graph-client-factory.20181206173236":"2018-12-06T17:35:08.204Z","1.1.0-graph-client-factory.20181206201017":"2018-12-06T20:13:03.291Z","1.1.0-graph-client-factory.20181207082237":"2018-12-07T08:25:16.945Z","1.1.0-editModes-cleanup.20181207090921":"2018-12-07T09:12:06.097Z","1.1.0-edit-all-chunks.20181207113840":"2018-12-07T11:41:11.425Z","1.1.0-master.20181207123814":"2018-12-07T12:41:06.796Z","1.1.0-master.20181207123931":"2018-12-07T12:42:29.983Z","1.1.0-master.20181207124108":"2018-12-07T12:44:26.885Z","1.1.0-promise-pool.20181207192108":"2018-12-07T19:24:06.942Z","1.1.0-promise-pool.20181207194051":"2018-12-07T19:43:42.391Z","1.1.0-promise-pool.20181207195837":"2018-12-07T20:01:27.226Z","1.1.0-promise-pool.20181208174316":"2018-12-08T17:46:10.944Z","1.1.0-master.20181208203712":"2018-12-08T20:40:43.506Z","1.1.0-master.20181208204657":"2018-12-08T20:50:01.450Z","1.1.0-master.20181208204659":"2018-12-08T20:50:14.006Z","1.1.0-master.20181208204856":"2018-12-08T20:52:27.992Z","1.1.0":"2018-12-08T21:56:11.488Z","1.1.1-master.20181210222605":"2018-12-10T22:28:56.470Z","1.1.1-disable-fragment-warning.20181211142157":"2018-12-11T14:24:49.202Z","1.1.1-master.20181211142711":"2018-12-11T14:30:08.911Z","1.1.1-master.20181211154014":"2018-12-11T15:43:18.453Z","1.2.0-master.20181212094239":"2018-12-12T09:45:35.403Z","1.2.0-nortissej.export-execpromise.20181212212436":"2018-12-12T21:27:11.516Z","1.2.0-master.20181217141728":"2018-12-17T14:19:55.726Z","1.2.0-issue-423.20181217202405":"2018-12-17T20:26:41.014Z","1.2.0-master.20181217203653":"2018-12-17T20:39:30.249Z","1.2.0-master.20181219081649":"2018-12-19T08:19:28.751Z","1.2.0-master.20181219170817":"2018-12-19T17:11:16.620Z","1.2.0-master.20181219171021":"2018-12-19T17:13:09.620Z","1.2.0-master.20181219175043":"2018-12-19T17:53:37.906Z","1.2.0-master.20181219185909":"2018-12-19T19:01:45.537Z","1.2.0-parse-opt.20181220005906":"2018-12-20T01:01:43.521Z","1.2.0-parse-opt2.20181220020604":"2018-12-20T02:08:40.921Z","1.2.0-parse-opt2.20181220025943":"2018-12-20T03:02:25.827Z","1.2.0-parse-opt4.20181220085459":"2018-12-20T08:57:32.919Z","1.2.0-generate-repo-id.20181220110458":"2018-12-20T11:07:37.574Z","1.2.0-generate-repo-id.20181220113107":"2018-12-20T11:33:35.459Z","1.2.0-generate-repo-id.20181220155148":"2018-12-20T15:54:42.767Z","1.2.0-master.20181220162531":"2018-12-20T16:28:23.131Z","1.2.0-parse-opt4.20181220234545":"2018-12-20T23:48:10.709Z","1.2.0-master.20181220235734":"2018-12-21T00:00:33.777Z","1.2.0-master.20181221193708":"2018-12-21T19:39:46.612Z","1.2.0-stronger-typing.20181222134305":"2018-12-22T13:45:46.247Z","1.2.0-master.20181222154357":"2018-12-22T15:47:10.743Z","1.2.0-master.20181223121728":"2018-12-23T12:20:20.045Z","1.2.0-master.20181227191104":"2018-12-27T19:13:45.949Z","1.2.0-master.20181227212650":"2018-12-27T21:29:36.966Z","1.2.0":"2018-12-27T21:58:27.919Z","1.2.1-nortissej.inMemProject.20190105042120":"2019-01-05T04:24:11.390Z","1.2.1-master.20190107091947":"2019-01-07T09:22:21.313Z","1.2.0-remove-sha-branch-defaults.20190107091943":"2019-01-07T09:22:51.224Z","1.2.0-remove-sha-branch-defaults.20190107104041":"2019-01-07T10:43:35.566Z","1.2.0-remove-sha-branch-defaults.20190107105804":"2019-01-07T11:00:38.555Z","1.2.1-remove-sha-branch-defaults.20190107110335":"2019-01-07T11:06:09.497Z","1.2.1-remove-sha-branch-defaults.20190107113217":"2019-01-07T11:34:41.080Z","1.2.1-remove-sha-branch-defaults.20190107134738":"2019-01-07T13:50:15.914Z","1.2.1-master.20190108010118":"2019-01-08T01:04:27.172Z","1.2.1-master.20190108013928":"2019-01-08T01:42:31.684Z","1.2.1-mutate-iterator.20190108054433":"2019-01-08T05:47:49.177Z","1.2.1-master.20190108065236":"2019-01-08T06:55:13.614Z","1.2.1-master.20190108133858":"2019-01-08T13:42:03.816Z","1.2.1-master.20190108134942":"2019-01-08T13:52:35.840Z","1.2.1-remove-sha-branch-defaults.20190108141045":"2019-01-08T14:13:33.222Z","1.2.1-master.20190108142541":"2019-01-08T14:28:38.621Z","1.2.1-master.20190108154720":"2019-01-08T15:50:53.997Z","1.2.1-within.20190108184155":"2019-01-08T18:44:53.849Z","1.2.1-master.20190108234425":"2019-01-08T23:47:04.493Z","1.2.1-djs-number-params-ok.20190109111042":"2019-01-09T11:13:10.305Z","1.2.1-djs-number-params-ok.20190109114033":"2019-01-09T11:43:14.024Z","1.2.1-master.20190109122016":"2019-01-09T12:23:11.832Z","1.2.1-master.20190109142943":"2019-01-09T14:32:16.698Z","1.2.1-master.20190110014350":"2019-01-10T01:46:36.905Z","1.2.1-fix-451.20190110035024":"2019-01-10T03:53:05.787Z","1.2.1-master.20190110143442":"2019-01-10T14:37:20.139Z","1.2.1-regex-fp.20190112203709":"2019-01-12T20:40:10.814Z","1.2.1-master.20190112213145":"2019-01-12T21:35:46.798Z","1.3.0-master.20190112215508":"2019-01-12T21:58:21.581Z","1.3.0-verbose-axios-gitlab.20190114145336":"2019-01-14T14:56:30.082Z","1.3.0-verbose-axios-gitlab.20190114150543":"2019-01-14T15:08:29.372Z","1.3.0-verbose-axios-gitlab.20190114151657":"2019-01-14T15:19:39.308Z","1.3.0-nortissej.mg-upgrade.20190114201119":"2019-01-14T20:14:29.164Z","1.3.0-verbose-axios-gitlab.20190115114923":"2019-01-15T11:52:29.941Z","1.3.0-master.20190115210858":"2019-01-15T21:12:14.460Z","1.3.0-master.20190117232341":"2019-01-17T23:26:33.130Z","1.3.0-master.20190118002357":"2019-01-18T00:26:51.548Z","1.3.0-master.20190121171911":"2019-01-21T17:22:39.594Z","1.3.0-master.20190122094600":"2019-01-22T09:49:19.512Z","1.3.0-ipcrm-logging-update.20190122114527":"2019-01-22T11:49:12.621Z","1.3.0-ipcrm-logging-update.20190122115427":"2019-01-22T11:57:27.822Z","1.3.0-master.20190122143519":"2019-01-22T14:38:37.958Z","1.3.0-master.20190123083033":"2019-01-23T08:33:41.049Z","1.3.0-verbose-axios-gitlab.20190123164821":"2019-01-23T16:51:27.722Z","1.3.0-verbose-axios-gitlab.20190123165420":"2019-01-23T16:57:33.269Z","1.3.0-master.20190124132630":"2019-01-24T13:30:05.375Z","1.3.0-use-http-factory.20190124154753":"2019-01-24T15:51:29.274Z","1.3.0-master.20190125150355":"2019-01-25T15:06:48.431Z","1.3.0-master.20190127064847":"2019-01-27T06:51:42.237Z","1.3.0-master.20190128204925":"2019-01-28T20:53:51.316Z","1.3.0-master.20190128222233":"2019-01-28T22:25:22.091Z","1.3.0-nortissej.no-string-throw.20190130221301":"2019-01-30T22:16:36.457Z","1.3.0-nortissej.mg-flex.20190131015226":"2019-01-31T01:55:19.876Z","1.3.0-master.20190131044443":"2019-01-31T04:48:56.426Z","1.3.0-master.20190203162633":"2019-02-03T16:29:51.709Z","1.3.0-master.20190205134251":"2019-02-05T13:46:05.053Z","1.3.0-master.20190205165735":"2019-02-05T17:00:47.371Z","1.3.0-master.20190205193925":"2019-02-05T19:43:23.768Z","1.3.0-master.20190205210857":"2019-02-05T21:12:04.288Z","1.3.0-master.20190205232644":"2019-02-05T23:29:35.100Z","1.3.0-master.20190206133811":"2019-02-06T13:42:41.070Z","1.3.0-master.20190206192652":"2019-02-06T19:30:32.964Z","1.3.0-nortissej.one-test.20190208231626":"2019-02-08T23:19:43.552Z","1.3.0-what-is-running.20190209103805":"2019-02-09T10:41:04.197Z","1.3.0-merge-axios-gitlab.20190209142833":"2019-02-09T14:31:40.949Z","1.3.0-master.20190209143849":"2019-02-09T14:41:41.721Z","1.3.0-merge-axios-gitlab.20190209160853":"2019-02-09T16:11:49.820Z","1.3.0-master.20190211141235":"2019-02-11T14:16:00.660Z","1.3.0-nortissej.apidoc.20190211185937":"2019-02-11T19:03:13.956Z","1.3.0-nortissej.MatchReport2.20190212043628":"2019-02-12T04:39:02.382Z","1.3.0-master.20190214172210":"2019-02-14T17:25:36.080Z","1.3.0-update-deps.20190215092634":"2019-02-15T09:30:04.159Z","1.3.0-update-deps.20190215100321":"2019-02-15T10:06:36.862Z","1.3.0-master.20190215142843":"2019-02-15T14:32:05.056Z","1.3.0-master.20190215144219":"2019-02-15T14:45:57.403Z","1.3.0-update-deps.20190215163810":"2019-02-15T16:44:41.427Z","1.3.0-update-deps.20190217191510":"2019-02-17T19:18:44.272Z","1.3.0-nortissej.typoOfDoom.20190218215149":"2019-02-18T21:55:10.651Z","1.3.0-master.20190219082917":"2019-02-19T08:33:32.881Z","1.3.0-update-deps.20190221091453":"2019-02-21T09:18:35.498Z","1.3.0-nortissej.contentBuffer.20190221214446":"2019-02-21T21:48:05.205Z","1.3.0-nortissej.contentBuffer.20190221214853":"2019-02-21T21:52:42.206Z","1.3.0-master.20190221221959":"2019-02-21T22:23:40.767Z","1.3.0-merge-axios-gitlab.20190227200023":"2019-02-27T20:03:55.789Z","1.3.0-master.20190228121715":"2019-02-28T12:20:39.790Z","1.3.0-master.20190228133353":"2019-02-28T13:38:06.734Z","1.3.0-master.20190228133619":"2019-02-28T13:39:57.478Z","1.3.0-nortissej.eep.20190228213108":"2019-02-28T21:34:49.094Z","1.3.0-nortissej.supresTokenOnCloneUrl.20190304215518":"2019-03-04T21:59:01.571Z","1.3.0-nortissej.supresTokenOnCloneUrl.20190304223037":"2019-03-04T22:34:11.184Z","1.3.0-master.20190306181548":"2019-03-06T18:27:12.198Z","1.3.0-websocket-lifecycle.20190306200217":"2019-03-06T20:06:06.288Z","1.3.0-tslint-types-481.20190306201156":"2019-03-06T20:15:52.716Z","1.3.0-master.20190306202631":"2019-03-06T20:30:25.131Z","1.3.0-master.20190306204631":"2019-03-06T20:50:22.230Z","1.3.0-nortissej.supresTokenOnCloneUrl.20190307172142":"2019-03-07T17:26:55.672Z","1.3.0-master.20190312083947":"2019-03-12T08:43:48.020Z","1.3.0-master.20190313120723":"2019-03-13T12:10:50.526Z","1.3.0-bitbucket-branch-reporef.20190313131418":"2019-03-13T13:17:49.957Z","1.3.0-master.20190313144546":"2019-03-13T14:49:37.022Z","1.3.0-master.20190314230553":"2019-03-14T23:10:14.204Z","1.3.0-master.20190314230900":"2019-03-14T23:12:54.377Z","1.3.0":"2019-03-14T23:15:32.876Z","1.3.1-master.20190319111921":"2019-03-19T11:23:22.635Z","1.3.1-find-files-with-glob.20190319112356":"2019-03-19T11:28:10.869Z","1.3.1-nortissej.supresTokenOnCloneUrl.20190319214833":"2019-03-19T21:53:36.867Z","1.3.1-master.20190320034126":"2019-03-20T03:44:42.133Z","1.3.1-master.20190322210808":"2019-03-22T21:12:51.249Z","1.3.1-master.20190322214944":"2019-03-22T21:52:41.681Z","1.3.1-nortissej.generator-target-description.20190325195408":"2019-03-25T21:13:02.507Z","1.3.1-master.20190326043055":"2019-03-26T04:33:51.929Z","1.3.1-update-code-gen.20190326110017":"2019-03-26T11:04:06.691Z","1.3.1-master.20190402070516":"2019-04-02T07:08:04.663Z","1.3.1-command-request-enhancement.20190403081050":"2019-04-03T08:13:31.914Z","1.3.1-master.20190403105521":"2019-04-03T10:58:26.841Z","1.3.1-master.20190404214250":"2019-04-04T21:45:46.370Z","1.3.1-update-code-gen.20190405153013":"2019-04-05T15:34:48.745Z","1.3.1-master.20190405154411":"2019-04-05T15:47:49.142Z","1.3.1-master.20190405154619":"2019-04-05T15:49:26.205Z","1.3.1-update-code-gen.20190405162356":"2019-04-05T16:27:22.134Z","1.3.1-revert-graphql-codegen.20190405162608":"2019-04-05T16:29:19.823Z","1.3.1-master.20190405174432":"2019-04-05T17:47:23.744Z","1.3.1-update-code-gen.20190408093222":"2019-04-08T09:36:15.013Z","1.3.1-event-queue.20190408140727":"2019-04-08T14:08:57.640Z","1.3.1-event-queue.20190408181714":"2019-04-08T18:18:41.900Z","1.3.1-event-queue.20190408183933":"2019-04-08T18:42:23.418Z","1.3.1-event-queue.20190408202611":"2019-04-08T20:29:05.903Z","1.3.1-event-queue.20190409083428":"2019-04-09T08:37:08.021Z","1.3.1-update-code-gen.20190410100822":"2019-04-10T10:11:29.979Z","1.3.1-master.20190411075431":"2019-04-11T07:57:50.853Z","1.3.1-master.20190411084059":"2019-04-11T08:43:32.597Z","1.3.1-event-queue.20190411155743":"2019-04-11T16:00:58.576Z","1.3.1-event-queue.20190411160625":"2019-04-11T16:09:33.776Z","1.4.0-master.20190411165304":"2019-04-11T16:56:18.161Z","1.4.0-remote-repo-ref-from.20190412204940":"2019-04-12T20:52:27.888Z","1.4.0-remote-repo-ref-from.20190413163417":"2019-04-13T16:37:21.068Z","1.4.0-master.20190414192617":"2019-04-14T19:29:08.946Z","1.4.0":"2019-04-15T00:30:55.396Z","1.4.1-consolidate-tests-516.20190417134143":"2019-04-17T13:45:16.781Z","1.4.1-remove-remote-repo-ref-from.20190417141720":"2019-04-17T14:21:01.195Z","1.4.1-master.20190418153447":"2019-04-18T15:39:04.388Z","1.4.1-master.20190418153855":"2019-04-18T15:43:01.127Z","1.3.1-update-code-gen.20190423221858":"2019-04-23T22:21:23.747Z","1.4.1-add-static-bitbucket-reporef-builders.20190426133531":"2019-04-26T13:39:41.959Z","1.4.1-add-static-bitbucket-reporef-builders.20190426134327":"2019-04-26T13:47:27.707Z","1.4.1-master.20190427104113":"2019-04-27T10:44:48.207Z","1.4.1-master.20190427112851":"2019-04-27T11:31:54.965Z","1.4.1-master.20190427122159":"2019-04-27T12:25:06.489Z","1.4.1-master.20190429192326":"2019-04-29T19:27:23.051Z","1.4.1-master.20190429201751":"2019-04-29T20:21:18.524Z","1.4.1-master.20190429210955":"2019-04-29T21:13:15.059Z","1.4.1-master.20190430072247":"2019-04-30T07:26:51.462Z","1.4.1-master.20190430085123":"2019-04-30T08:55:18.776Z","1.4.1-issue-526.20190430113041":"2019-04-30T11:34:55.644Z","1.4.1-master.20190501152140":"2019-05-01T15:26:12.354Z","1.4.1-master.20190501154012":"2019-05-01T15:43:47.592Z","1.4.1-master.20190501164912":"2019-05-01T16:53:02.730Z","1.4.1-master.20190502192720":"2019-05-02T19:30:59.764Z","1.4.1-master.20190502211414":"2019-05-02T21:17:51.179Z","1.4.1-master.20190503092134":"2019-05-03T09:26:36.855Z","1.4.1-master.20190503164044":"2019-05-03T16:44:49.551Z","1.4.1-master.20190503175050":"2019-05-03T17:54:53.013Z","1.4.1-nortissej.in-mem-subproject.20190513221636":"2019-05-13T22:20:54.837Z","1.4.1-master.20190514195214":"2019-05-14T19:58:24.141Z","1.4.1-master.20190515123924":"2019-05-15T12:43:48.599Z","1.5.0-master.20190515135847":"2019-05-15T14:04:39.933Z","1.5.0-master.20190515141026":"2019-05-15T14:14:35.451Z","1.5.0-master.20190515195848":"2019-05-15T20:02:22.308Z","1.5.0-master.20190520153523":"2019-05-20T15:40:20.034Z","1.5.0-add-default-reviewers-bitbucket.20190521125709":"2019-05-21T13:00:42.608Z","1.5.0-question-style.20190522122106":"2019-05-22T12:25:43.198Z","1.5.0-question-style.20190522122820":"2019-05-22T12:32:37.311Z","1.5.0-nortissej.in-mem-subproject.20190522200544":"2019-05-22T20:09:55.799Z","1.5.0-question-style.20190523110235":"2019-05-23T11:07:00.330Z","1.5.0-master.20190523141559":"2019-05-23T14:20:54.529Z","1.5.0-question-style.20190523200738":"2019-05-23T20:12:18.348Z","1.5.0-question-style.20190523215938":"2019-05-23T22:03:07.532Z","1.5.0-question-style.20190524081145":"2019-05-24T08:15:01.632Z","1.5.0-question-style.20190524111209":"2019-05-24T11:15:26.018Z","1.5.0-master.20190524111144":"2019-05-24T11:15:40.595Z","1.5.0-master.20190524114244":"2019-05-24T11:46:26.584Z","1.5.0-master.20190524114428":"2019-05-24T11:48:17.622Z","1.5.0-master.20190524125853":"2019-05-24T13:02:39.043Z","1.5.0-master.20190524132008":"2019-05-24T13:23:21.253Z","1.5.0-shutdown-543.20190524144307":"2019-05-24T14:47:04.584Z","1.5.0-shutdown-543.20190524213735":"2019-05-24T21:40:48.996Z","1.5.0-shutdown-543.20190524220707":"2019-05-24T22:10:22.539Z","1.5.0-master.20190525080315":"2019-05-25T08:07:17.906Z","1.5.0-master.20190525081042":"2019-05-25T08:13:56.312Z","1.5.0-master-shutdown-543.20190526182451":"2019-05-26T18:28:26.771Z","1.5.0-master-shutdown-543.20190526193010":"2019-05-26T19:33:05.212Z","1.5.0-master.20190527132708":"2019-05-27T13:31:14.817Z","1.5.0-master.20190527141005":"2019-05-27T14:13:22.718Z","1.5.0-master.20190527205706":"2019-05-27T21:00:50.788Z","1.5.0":"2019-05-27T21:02:16.057Z","1.5.1-master.20190528152631":"2019-05-28T15:30:53.656Z","1.5.1-safe-exit-543.20190528194959":"2019-05-28T19:54:01.176Z","1.5.1-master.20190528210851":"2019-05-28T21:12:35.204Z","1.5.1":"2019-05-29T12:04:42.281Z","1.5.2-master.20190529214058":"2019-05-29T21:44:51.266Z","1.5.2-master.20190529225628":"2019-05-29T23:02:20.985Z","1.5.2-master.20190529225743":"2019-05-29T23:07:52.105Z","1.5.2-master.20190529231304":"2019-05-29T23:16:20.565Z","1.5.2-master.20190529233036":"2019-05-29T23:33:50.487Z","1.5.2-cancel-shutdown.20190530131408":"2019-05-30T13:17:55.158Z","1.5.2-cancel-shutdown.20190530132807":"2019-05-30T13:32:41.120Z","1.5.2-master.20190530170909":"2019-05-30T17:12:32.996Z","1.5.2":"2019-05-30T19:40:25.123Z","1.5.3-kipz-patch-1.20190530211310":"2019-05-30T21:17:05.394Z","1.5.3-master.20190530211806":"2019-05-30T21:22:10.329Z","1.5.3-async-configuration-loading.20190530213652":"2019-05-30T21:41:25.236Z","1.5.3-async-configuration-loading.20190530215656":"2019-05-30T22:01:49.383Z","1.5.3-atomist-update-latest-20190530224912.20190531070146":"2019-05-31T07:06:04.130Z","1.5.3-master.20190531071810":"2019-05-31T07:21:57.078Z","1.5.3-async-configuration-loading.20190531071824":"2019-05-31T07:22:33.450Z","1.5.3-async-configuration-loading.20190531134105":"2019-05-31T13:45:13.515Z","1.5.3-master.20190531134751":"2019-05-31T13:53:38.779Z","1.5.3-master.20190603073933":"2019-06-03T07:44:57.364Z","1.5.3-test-cleanup.20190603211517":"2019-06-03T21:20:19.017Z","1.5.3-master.20190603213439":"2019-06-03T21:38:18.719Z","1.5.3-master.20190604125420":"2019-06-04T12:57:49.379Z","1.5.3-master.20190604133443":"2019-06-04T13:39:44.779Z","1.5.3":"2019-06-04T14:23:50.537Z","1.5.4-master.20190606233707":"2019-06-06T23:42:10.382Z","1.5.4-master.20190617112446":"2019-06-17T11:30:56.078Z","1.5.4-master.20190617160836":"2019-06-17T16:12:47.916Z","1.5.4-master.20190618091503":"2019-06-18T09:18:37.420Z","1.5.4-master.20190619135120":"2019-06-19T13:54:54.683Z","1.5.4-master.20190619152732":"2019-06-19T15:32:01.980Z","1.5.4-master.20190625181354":"2019-06-25T18:17:48.599Z","1.5.4-master.20190626144326":"2019-06-26T15:10:08.860Z","1.5.4-master.20190626214344":"2019-06-26T21:47:46.793Z","1.5.4-master.20190628061747":"2019-06-28T06:20:57.020Z","1.6.0-master.20190702113653":"2019-07-02T11:40:44.795Z","1.6.0-master.20190704103159":"2019-07-04T10:35:50.329Z","1.6.0-master.20190704104454":"2019-07-04T10:50:53.050Z","1.6.0-master.20190704120909":"2019-07-04T12:12:52.896Z","1.6.0":"2019-07-04T12:21:09.504Z","1.6.1-master.20190704192303":"2019-07-04T19:26:46.492Z","1.6.1-master.20190705093803":"2019-07-05T09:44:29.427Z","1.6.1-master.20190705093845":"2019-07-05T09:44:49.899Z","1.6.1-master.20190705094144":"2019-07-05T09:45:15.591Z","1.6.1-master.20190705094856":"2019-07-05T09:52:59.494Z","1.6.1-master.20190705104035":"2019-07-05T10:42:12.562Z","1.6.1-master.20190705104233":"2019-07-05T10:44:33.407Z","1.6.1-master.20190705123604":"2019-07-05T12:39:37.409Z","1.6.1-master.20190708205518":"2019-07-08T20:59:09.762Z","1.6.1-master.20190708211117":"2019-07-08T21:14:48.128Z","1.6.1":"2019-07-08T21:41:54.905Z","1.6.2-master.20190710075516":"2019-07-10T08:00:06.850Z","1.6.2-master.20190710200038":"2019-07-10T20:04:50.119Z","1.6.2-master.20190711065219":"2019-07-11T06:56:52.649Z","1.6.2-master.20190711065453":"2019-07-11T06:58:30.230Z","1.6.2":"2019-07-11T07:26:26.937Z","1.6.3-nortissej.no-single-branch.20190722232139":"2019-07-22T23:26:10.790Z","1.6.3-master.20190723055410":"2019-07-23T05:59:24.385Z","1.6.3-issue-575.20190727070921":"2019-07-27T07:13:26.825Z","1.6.3-master.20190727084117":"2019-07-27T08:45:11.223Z","1.6.3-master.20190801153513":"2019-08-01T15:40:47.284Z","1.6.3-master.20190801161527":"2019-08-01T16:20:49.985Z","1.6.3-master.20190801175921":"2019-08-01T18:04:33.309Z","1.6.3-master.20190801194922":"2019-08-01T19:54:23.544Z","1.6.3-master.20190801201049":"2019-08-01T20:15:51.606Z","1.6.3-export-isremotereporef.20190806190109":"2019-08-06T19:06:11.097Z","1.6.3-master.20190806200153":"2019-08-06T20:07:51.347Z","1.6.3-master.20190816081741":"2019-08-16T08:22:14.487Z","1.6.3-set-origin.20190816084317":"2019-08-16T08:47:34.095Z","1.6.3-master.20190816122712":"2019-08-16T12:31:44.225Z","1.6.3-master.20190821065818":"2019-08-21T07:02:30.111Z","1.6.3-master.20190824151043":"2019-08-24T15:15:27.321Z","1.6.3-master.20190825172206":"2019-08-25T17:26:19.257Z","1.6.3-checkout-rebase.20190825225049":"2019-08-25T22:55:38.554Z","1.6.3-master.20190825234034":"2019-08-25T23:45:35.951Z","1.6.3-master.20190827160545":"2019-08-27T16:10:19.694Z","1.6.3-master.20190827162443":"2019-08-27T16:29:08.403Z","1.6.3-log-headers.20190828193609":"2019-08-28T19:41:34.671Z","1.6.3-atomist.t29e48p34.typescript-version.master.20190830153034":"2019-08-30T15:34:54.095Z","1.6.3-master.20190830153127":"2019-08-30T15:37:03.181Z","1.6.3-master.20190831063433":"2019-08-31T06:39:02.739Z","1.6.3-master.20190831063237":"2019-08-31T06:52:23.150Z","1.6.3-master.20190901170820":"2019-09-01T17:13:35.800Z","1.6.3-graphql-code-generator-1.20190902132944":"2019-09-02T13:34:14.742Z","1.6.3-graphql-code-generator-1.20190902134121":"2019-09-02T13:45:47.442Z","1.6.3-graphql-code-generator-1.20190902141916":"2019-09-02T14:24:08.317Z","1.6.3-master.20190903132130":"2019-09-03T13:26:26.774Z","1.6.3-master.20190904061426":"2019-09-04T06:19:42.891Z","1.6.3-dev-start.20190904184449":"2019-09-04T18:49:42.529Z","1.6.3-dev-start.20190905065824":"2019-09-05T07:04:10.877Z","1.6.3-dev-start.20190905113409":"2019-09-05T11:38:56.080Z","1.6.3-dev-start.20190905134812":"2019-09-05T13:52:39.643Z","1.6.3-master.20190905142108":"2019-09-05T14:26:16.903Z","1.6.3-master.20190905142444":"2019-09-05T14:30:14.050Z","1.6.3-master.20190905172037":"2019-09-05T17:26:19.725Z","1.7.0-master.20190906123829":"2019-09-06T12:47:27.603Z","1.7.0-master.20190906130604":"2019-09-06T13:10:17.251Z","1.7.0-master.20190906141311":"2019-09-06T14:18:19.544Z","1.7.0-master.20190907124351":"2019-09-07T12:48:53.664Z","1.7.0-master.20190909084408":"2019-09-09T08:48:46.209Z","1.7.0":"2019-09-09T16:25:28.307Z","1.7.1-less-verbose.20190915004949":"2019-09-15T00:54:45.654Z","1.7.1-master.20190916030926":"2019-09-16T03:14:34.352Z","1.7.1-nortissej.flexible-gql-gen.20190918220049":"2019-09-18T22:06:05.914Z","1.7.1-nortissej.flexible-gql-gen.20190919003945":"2019-09-19T00:44:09.844Z","1.7.1-master.20190920174359":"2019-09-20T17:47:46.066Z","1.7.1-master.20190920175552":"2019-09-20T17:59:58.078Z","1.7.1-less-verbose.20190922191500":"2019-09-22T19:18:10.287Z","1.7.1-less-verbose.20190922223448":"2019-09-22T22:38:23.446Z","1.7.1-master.20190923001603":"2019-09-23T00:20:09.210Z","1.7.1-master.20190923001835":"2019-09-23T00:23:23.542Z","1.7.1-perf.20190923064131":"2019-09-23T06:44:46.996Z","1.7.1-cache2.20190924041110":"2019-09-24T04:14:20.648Z","1.8.0-master.20190924042635":"2019-09-24T04:30:01.909Z","1.7.1-cache2.20190924050520":"2019-09-24T05:08:38.423Z","1.7.1-cache2.20190926074250":"2019-09-26T07:46:42.943Z","1.7.1-cache2.20190926081543":"2019-09-26T08:18:58.817Z","1.7.1-cache2.20190928235715":"2019-09-29T00:00:41.086Z","1.8.0-master.20190929021846":"2019-09-29T02:22:31.412Z","1.8.0-master.20190929022106":"2019-09-29T02:24:32.748Z","1.8.0-master.20191001022338":"2019-10-01T02:26:52.856Z","1.8.0-local-hostname.20191001190808":"2019-10-01T19:12:22.025Z","1.8.0-local-hostname.20191002012731":"2019-10-02T01:31:20.558Z","1.8.0-master.20191002062637":"2019-10-02T06:30:11.821Z","1.8.0-master.20191002075830":"2019-10-02T08:02:02.908Z","1.8.0-master.20191002201734":"2019-10-02T20:21:54.460Z","1.8.0-typings-dir.20191002202139":"2019-10-02T20:25:43.851Z","1.8.0-master.20191002204108":"2019-10-02T20:45:32.986Z","1.8.0-tmpdir-shutdown-611.20191002221137":"2019-10-02T22:16:03.526Z","1.8.0-globby.20191003060204":"2019-10-03T06:05:35.038Z","1.8.0-master.20191003175029":"2019-10-03T17:55:19.492Z","1.8.0-master.20191003195608":"2019-10-03T20:01:47.643Z","1.8.0-tmpdir-shutdown-611.20191003201314":"2019-10-03T20:18:11.461Z","1.8.0-tmpdir-shutdown-611.20191003203814":"2019-10-03T20:42:55.076Z","1.8.0-master.20191004141949":"2019-10-04T14:23:35.581Z","1.8.0-master.20191004142305":"2019-10-04T14:27:18.749Z","1.8.0-master.20191004160448":"2019-10-04T16:08:15.220Z","1.8.0-config-cleanup.20191004161850":"2019-10-04T16:22:18.787Z","1.8.0-master.20191008151038":"2019-10-08T15:15:10.989Z","1.8.0-globby.20191008204458":"2019-10-08T20:48:59.613Z","1.8.0-master.20191009152926":"2019-10-09T15:38:04.015Z","1.8.0-master.20191009184515":"2019-10-09T18:48:44.136Z","1.8.0-master.20191011083000":"2019-10-11T08:33:19.696Z","1.8.0-master.20191011091303":"2019-10-11T09:16:07.866Z","1.8.0-master.20191011094832":"2019-10-11T09:51:44.699Z","1.8.0-master.20191011095025":"2019-10-11T09:53:26.135Z","1.8.0-master.20191011121753":"2019-10-11T12:20:47.120Z","1.8.0-master.20191011175049":"2019-10-11T17:54:51.281Z","1.8.0-master.20191012160206":"2019-10-12T16:05:59.500Z","1.8.0-micromatch.20191012193417":"2019-10-12T19:37:44.178Z","1.8.0-micromatch.20191012194433":"2019-10-12T19:48:15.723Z","1.8.0-master.20191015143721":"2019-10-15T14:41:31.735Z","1.8.0-invalidate-file-cache.20191015171926":"2019-10-15T17:24:20.101Z","1.8.0-invalidate-file-cache.20191015174934":"2019-10-15T18:43:23.051Z","1.8.0-master.20191015192956":"2019-10-15T19:34:01.350Z","1.8.0-is-token-credentials.20191017200640":"2019-10-17T20:10:03.855Z","1.8.0-is-token-credentials.20191017202512":"2019-10-17T20:29:12.639Z","1.8.0-master.20191018173116":"2019-10-18T17:35:16.833Z","1.8.0-is-token-credentials.20191018173245":"2019-10-18T17:43:55.298Z","1.8.0-master.20191018180710":"2019-10-18T18:12:49.357Z","1.8.0-is-token-credentials.20191018180833":"2019-10-18T18:13:31.849Z","1.8.0-is-token-credentials.20191018185410":"2019-10-18T19:06:10.685Z","1.8.0-master.20191018181918":"2019-10-18T19:16:16.235Z","1.8.0-master.20191025130333":"2019-10-25T13:06:43.713Z","1.8.0-master.20191028122521":"2019-10-28T12:29:39.779Z","1.8.0-master.20191028231612":"2019-10-28T23:21:45.514Z","1.8.0-master.20191028235651":"2019-10-29T00:01:58.364Z","1.8.0-master.20191101200605":"2019-11-02T17:45:05.876Z","1.8.0-master.20191102180457":"2019-11-02T18:08:25.902Z","1.8.0-master.20191102180610":"2019-11-02T18:09:31.488Z","1.8.0-master.20191107193443":"2019-11-07T19:39:18.420Z","1.8.0-master.20191107221231":"2019-11-07T22:17:48.601Z","1.8.0-master.20191107225525":"2019-11-07T23:00:16.508Z","1.8.0-master.20191110005338":"2019-11-10T00:58:56.843Z","1.8.0-dynamic-goals.20191112233537":"2019-11-12T23:40:34.656Z","1.8.0-master.20191113095747":"2019-11-13T10:10:49.096Z","1.8.0-dynamic-goals.20191113162123":"2019-11-13T16:25:57.099Z","1.8.0-master.20191113185413":"2019-11-13T18:59:16.187Z","1.8.0-dynamic-goals.20191114172242":"2019-11-14T17:39:20.201Z","1.8.0-dynamic-goals.20191114213427":"2019-11-14T21:39:21.897Z","1.8.0-dynamic-goals.20191119211945":"2019-11-19T21:23:57.441Z","1.8.0-custom-schema-types.20191120165441":"2019-11-20T17:00:29.749Z","1.8.0-master.20191121010001":"2019-11-21T01:04:15.613Z","1.8.0-dynamic-goals.20191123062556":"2019-11-23T06:29:22.287Z","1.8.0-dynamic-goals.20191123151009":"2019-11-23T15:13:29.288Z","1.8.0-dynamic-goals.20191123151746":"2019-11-23T15:21:03.413Z","1.8.0-dynamic-goals.20191123154421":"2019-11-23T15:47:38.903Z","1.8.0-dynamic-goals.20191123155104":"2019-11-23T15:54:34.848Z","1.8.0-dynamic-goals.20191123160218":"2019-11-23T16:08:29.706Z","1.8.0-dynamic-goals.20191202211216":"2019-12-02T21:19:12.787Z","1.8.0-master.20191206130510":"2019-12-06T13:08:58.248Z","1.8.0":"2019-12-06T13:19:44.577Z","1.8.1-master.20191206141736":"2019-12-06T14:21:23.393Z","2.0.0-master.20191206152722":"2019-12-06T15:31:01.673Z","2.0.0-master.20191207110327":"2019-12-07T11:07:25.053Z","2.0.0-master.20191207120714":"2019-12-07T12:10:52.397Z","2.0.0-master.20191207143036":"2019-12-07T14:34:04.081Z","2.0.0-master.20191207145203":"2019-12-07T14:55:36.035Z","2.0.0-master.20191207163337":"2019-12-07T16:37:12.380Z","2.0.0-master.20191210214700":"2019-12-10T21:51:49.385Z","2.0.0-add-name-and-version.20191212160841":"2019-12-12T16:12:26.929Z","2.0.0-master.20191212164719":"2019-12-12T16:51:27.405Z","2.0.0-master.20191212181545":"2019-12-12T18:19:57.428Z","2.0.0-master.20191212203327":"2019-12-12T20:37:43.374Z","2.0.0-master.20191213125735":"2019-12-13T13:02:07.389Z","2.0.0-master.20191213130118":"2019-12-13T13:05:39.662Z","2.0.0-master.20191213133922":"2019-12-13T13:43:34.300Z","2.0.0-master.20191213160252":"2019-12-13T16:07:58.565Z","2.0.0-kipz-threshold-safety-1.20191219173036":"2019-12-19T17:34:37.597Z","2.0.0-ipcrm-sdm-793.20191223223841":"2019-12-23T22:41:53.334Z","2.0.0-master.20191224225156":"2019-12-24T22:55:41.706Z","2.0.0-master.20191226145834":"2019-12-26T15:01:55.693Z","2.0.0-ipcrm-proper-lockfile-update.20191226203221":"2019-12-26T20:35:41.339Z","2.0.0-ipcrm-proper-lockfile-update.20191226213641":"2019-12-26T21:39:59.946Z","2.0.0-ipcrm-proper-lockfile-update.20191227010200":"2019-12-27T01:05:19.850Z","2.0.0-ipcrm-proper-lockfile-update.20191227013928":"2019-12-27T01:42:48.582Z","2.0.0-ipcrm-proper-lockfile-update.20191227191516":"2019-12-27T19:18:41.483Z","2.0.0-ipcrm-proper-lockfile-update.20191228171934":"2019-12-28T17:22:44.934Z","2.0.0-remove-index.20191230144029":"2019-12-30T14:43:49.093Z","2.0.0-remove-index.20191230145915":"2019-12-30T15:02:37.598Z","2.0.0-remove-index.20191231114336":"2019-12-31T11:47:15.621Z","2.0.0-remove-index.20200101150125":"2020-01-01T21:33:36.269Z","2.0.0-ipcrm-531.20200103174124":"2020-01-03T17:45:33.015Z","2.0.0-master.20200103175243":"2020-01-03T17:58:47.943Z","2.0.0-master.20200103175554":"2020-01-03T18:07:58.566Z","2.0.0-ipcrm-531.20200103201659":"2020-01-03T20:21:00.394Z","2.0.0-ipcrm-531.20200103202725":"2020-01-03T20:30:58.662Z","2.0.0-ipcrm-531.20200103210228":"2020-01-03T21:06:03.790Z","2.0.0-remove-index.20200107082101":"2020-01-07T08:24:23.925Z","2.0.0-remove-index.20200107085211":"2020-01-07T08:55:53.018Z","2.0.0-remove-index.20200107112456":"2020-01-07T11:28:22.886Z","2.0.0-ipcrm-531.20200107151204":"2020-01-07T15:16:14.515Z","2.0.0-remove-index.20200107155146":"2020-01-07T15:55:38.626Z","2.0.0-master.20200107161309":"2020-01-08T14:30:06.352Z","2.0.0-remove-index.20200114190358":"2020-01-14T19:07:49.155Z","2.0.0-remove-index.20200115105959":"2020-01-15T11:03:45.234Z","2.0.0-remove-index.20200115190758":"2020-01-15T19:11:43.325Z","2.0.0-remove-index.20200117153458":"2020-01-17T15:38:41.465Z","2.0.0-master.20200131200849":"2020-01-31T20:12:09.031Z","2.0.0-master.20200131202342":"2020-01-31T20:27:29.882Z","2.0.0-async-await.20200201095427":"2020-02-01T09:57:34.892Z","2.0.0-master.20200205110916":"2020-02-05T11:12:55.645Z","2.0.0-master.20200205123830":"2020-02-05T12:42:00.018Z","2.0.0-master.20200205130055":"2020-02-05T13:04:26.259Z","2.0.0-master.20200210222816":"2020-02-10T22:32:14.639Z","1.8.1-1.8.1-fixes.20200210224823":"2020-02-10T22:52:20.470Z","2.0.0-master.20200215205055":"2020-02-15T20:54:19.698Z","2.0.0-master.20200223145329":"2020-02-23T14:56:54.291Z","2.0.0-master.20200227092607":"2020-02-27T09:29:41.749Z","2.0.0-master.20200227093410":"2020-02-27T09:37:47.680Z","1.8.1":"2020-03-02T21:10:11.103Z","1.8.2-1.8-fixes.20200302211422":"2020-03-02T21:18:35.128Z","1.8.2-1.8-fixes.20200302211521":"2020-03-02T21:19:32.532Z","1.8.2-1.8-fixes.20200302215501":"2020-03-02T21:58:46.388Z","1.8.2":"2020-03-02T22:13:38.224Z","1.8.3-1.8-fixes.20200302223143":"2020-03-02T22:35:17.667Z","1.9.0-1.9-fixes.20200303003656":"2020-03-03T00:40:31.716Z","1.9.0":"2020-03-03T13:44:38.576Z","1.9.1-1.9-fixes.20200303135132":"2020-03-03T13:55:26.776Z","2.0.0-master.20200304193955":"2020-03-04T19:43:43.727Z","2.0.0-master.20200304195442":"2020-03-04T19:58:26.073Z","2.0.0-master.20200310235858":"2020-03-11T00:02:09.306Z","1.9.1-1.9-fixes.20200311123135":"2020-03-11T12:35:07.054Z","2.0.0-master.20200311165330":"2020-03-11T16:57:10.564Z","1.8.3-1.8-fixes.20200422000419":"2020-04-22T00:07:40.490Z","2.0.0-master.20200422001327":"2020-04-22T00:16:51.380Z","1.8.3-1.8-fixes.20200423173854":"2020-04-23T17:43:03.378Z","2.0.0-master.20200423175826":"2020-04-23T18:02:45.333Z","2.0.0-master.20200429105721":"2020-04-29T11:00:54.237Z","2.0.0-master.20200429110358":"2020-04-29T11:07:49.169Z","2.0.0-master.20200630123203":"2020-06-30T12:35:55.765Z","2.0.0-remove-deprecations.20200630130705":"2020-06-30T13:10:55.617Z","2.0.0-remove-deprecations.20200630135953":"2020-06-30T14:03:48.239Z","2.0.0-remove-deprecations.20200630162723":"2020-06-30T16:31:22.697Z","2.0.0-master.20200701135449":"2020-07-01T13:58:43.427Z","2.0.0-master.20200712143926":"2020-07-12T14:42:53.290Z","2.0.0-master.20200712144106":"2020-07-12T14:44:58.941Z","1.8.3-1.8-fixes.20200712144210":"2020-07-12T14:45:40.096Z","1.9.1-1.9-fixes.20200712144339":"2020-07-12T14:46:41.280Z","1.8.3":"2020-07-13T14:30:37.865Z","1.8.4-1.8-fixes.20200713145016":"2020-07-13T14:54:12.836Z","1.9.1":"2020-07-13T14:56:57.024Z","1.9.2-1.9-fixes.20200713150815":"2020-07-13T15:11:32.829Z","1.9.2-1.9-fixes.20200713181458":"2020-07-13T18:18:16.331Z","1.8.4-1.8-fixes.20200713181845":"2020-07-13T18:22:10.205Z","2.0.0-master.20200713182021":"2020-07-13T18:23:24.025Z","2.0.0-main.20200902195500":"2020-09-02T19:59:33.459Z","2.0.0-main.20200903153220":"2020-09-03T15:36:20.326Z","2.0.0-main.20200903155129":"2020-09-03T15:55:11.980Z","2.0.0":"2020-09-03T20:45:04.737Z","2.0.1-main.20200911191622":"2020-09-11T19:19:58.614Z","1.9.2-1.9-fixes-bugfix.20200911193956":"2020-09-11T19:43:41.304Z","1.9.2-1.9-fixes.20200911195813":"2020-09-11T20:01:54.581Z","2.0.1-main.20201023121815":"2020-10-23T12:21:18.103Z","1.9.2-1.9-fixes.20201023122700":"2020-10-23T12:30:01.270Z","2.0.1-main.20210108042626":"2021-01-08T04:31:31.591Z","2.0.1-main.20210201171452":"2021-02-01T17:17:51.127Z","2.0.1-expose-http-base.20210209141440":"2021-02-09T14:18:55.607Z","2.0.1-main.20210209141900":"2021-02-09T14:21:52.835Z","2.0.1-main.20210209161713":"2021-02-09T16:19:59.719Z","1.9.2-1.9-fixes.20210209164225":"2021-02-09T16:45:18.286Z","2.0.1-atomist.npm-update-main.20210209182807":"2021-02-09T18:31:18.484Z","2.0.1-main.20210209183659":"2021-02-09T18:40:01.536Z","1.9.2-1.9-fixes.20210209204954":"2021-02-09T20:52:44.395Z","2.0.1-atomist.npm-update-main.20210210150405":"2021-02-10T15:07:14.129Z","2.0.1-main.20210210151212":"2021-02-10T15:15:37.140Z","1.9.2":"2021-02-10T16:00:58.326Z","1.9.3-1.9-fixes.20210210160612":"2021-02-10T16:08:51.278Z","2.1.0-main.20210210161233":"2021-02-10T16:15:10.238Z","2.1.0":"2021-02-10T17:39:41.076Z","2.1.1-atomist.npm-update-main.20210211150421":"2021-02-11T15:08:23.362Z","2.1.1-main.20210211151704":"2021-02-11T15:20:48.778Z","2.1.1-atomist.npm-update-main.20210212150403":"2021-02-12T15:06:45.455Z","2.1.1-atomist.npm-audit-main.20210224150358":"2021-02-24T15:08:29.596Z","2.1.1-atomist.npm-audit-main.20210311130538":"2021-03-11T13:10:19.528Z","2.1.1-atomist.npm-audit-main.20210312130609":"2021-03-12T13:09:32.865Z","2.1.1-atomist.npm-update-main.20210314120628":"2021-03-14T12:09:46.071Z","2.1.1-main.20210314120800":"2021-03-14T12:11:01.186Z","2.1.1-atomist.npm-update-main.20210315120330":"2021-03-15T12:06:08.527Z","2.1.1-atomist.npm-update-main.20210316120312":"2021-03-16T12:05:39.834Z","2.1.1-atomist.npm-update-main.20210317120324":"2021-03-17T12:06:07.986Z","2.1.1-main.20210322120556":"2021-03-22T12:09:03.408Z","2.1.1-atomist.npm-update-main.20210325120514":"2021-03-25T12:07:45.629Z","2.1.1-atomist.npm-update-main.20210326120407":"2021-03-26T12:07:19.117Z","2.1.1-atomist.npm-update-main.20210327120404":"2021-03-27T12:06:33.573Z","2.1.1-atomist.npm-update-main.20210329120531":"2021-03-29T12:08:19.161Z","2.1.1-main.20210401113224":"2021-04-01T11:35:09.202Z","1.9.3-1.9-fixes.20210401113225":"2021-04-01T11:35:54.820Z","2.1.1-main.20210402083233":"2021-04-02T08:35:12.261Z","2.1.1":"2021-04-02T08:46:02.354Z","2.1.2-atomist.npm-update-main.20210404120333":"2021-04-04T12:06:12.870Z","2.1.2-atomist.npm-update-main.20210408120325":"2021-04-08T12:06:35.363Z","2.1.2-main.20210504155131":"2021-05-04T16:00:12.298Z","2.1.2-main.20210504155812":"2021-05-04T16:15:05.576Z","2.1.2-main.4":"2021-05-04T16:27:05.810Z","2.1.2-main.20210504162439":"2021-05-04T16:50:40.558Z","2.1.2-main.0":"2021-05-04T19:54:25.778Z","2.1.2-branch-atomist-npm-update-main.0":"2021-05-05T12:05:36.921Z","2.1.2-branch-atomist-npm-update-main.1":"2021-05-06T12:05:52.192Z","2.1.2-branch-atomist-npm-update-main.2":"2021-05-08T12:06:37.074Z","2.1.2-branch-atomist-npm-update-main.3":"2021-05-09T11:06:58.932Z","2.2.0-main.0":"2021-05-10T07:18:00.763Z","2.2.0-branch-atomist-npm-update-main.0":"2021-05-10T07:19:00.987Z","2.2.0-main.1":"2021-05-10T07:23:45.860Z","2.2.0":"2021-05-10T07:26:08.251Z","2.2.1-main.0":"2021-05-10T07:30:15.083Z","2.2.1-main.1":"2021-05-10T07:32:09.414Z","2.2.1-main.2":"2021-05-10T07:33:45.910Z","2.2.1-branch-atomist-npm-update-main.0":"2021-05-12T10:09:26.192Z","2.2.1-branch-atomist-npm-update-main.1":"2021-05-13T10:07:02.708Z","2.2.1-branch-atomist-npm-update-main.2":"2021-05-15T10:05:34.638Z","2.2.1-branch-atomist-npm-update-main.3":"2021-05-16T10:05:28.382Z","2.2.1-branch-atomist-npm-update-main.4":"2021-05-20T10:07:55.364Z","2.2.1-branch-atomist-npm-update-main.5":"2021-05-21T10:05:37.206Z","2.2.1-branch-atomist-npm-update-main.6":"2021-05-25T10:06:02.224Z","2.2.1-branch-atomist-npm-update-main.7":"2021-05-26T10:08:02.885Z","2.2.1-branch-atomist-npm-update-main.8":"2021-05-27T10:13:21.154Z","2.2.1-branch-atomist-npm-update-main.9":"2021-05-28T10:07:34.742Z","2.2.1-branch-atomist-npm-update-main.10":"2021-05-31T10:06:39.909Z","2.2.1-branch-atomist-npm-audit-main.0":"2021-06-02T10:07:05.810Z","2.2.1-branch-atomist-npm-update-main.11":"2021-06-08T10:08:13.781Z","2.2.1-main.3":"2021-06-08T10:11:00.270Z","2.2.1-main.20210608101228":"2021-06-08T10:20:16.366Z","2.2.1-main.20210608101229":"2021-06-08T10:22:58.500Z","2.2.1-main.20210608101935":"2021-06-08T10:24:41.419Z","2.2.1-main.20210608102334":"2021-06-08T10:28:04.511Z","2.2.1-main.20210608102645":"2021-06-08T10:31:22.372Z","2.2.1-main.20210608102646":"2021-06-08T10:33:49.509Z","2.2.1-main.20210608102959":"2021-06-08T10:34:49.643Z","2.2.1-main.20210608102960":"2021-06-08T10:37:14.664Z","2.2.1-main.20210608103313":"2021-06-08T10:38:16.542Z","2.2.1-main.20210608103314":"2021-06-08T10:40:32.295Z","2.2.1-main.20210608103645":"2021-06-08T10:41:36.468Z","2.2.1-main.20210608103646":"2021-06-08T10:42:59.085Z","2.2.1-main.20210608104004":"2021-06-08T10:45:08.868Z","2.2.1-main.20210608104005":"2021-06-08T10:48:14.788Z","2.2.1-main.20210608104006":"2021-06-08T10:50:11.336Z","2.2.1-main.20210608104708":"2021-06-08T10:52:05.995Z","2.2.1-main.20210608104709":"2021-06-08T10:53:56.392Z","2.2.1-main.20210608105114":"2021-06-08T10:56:45.743Z","2.2.1-main.20210608105115":"2021-06-08T10:58:29.985Z","2.2.1-main.20210608105425":"2021-06-08T11:00:14.623Z","2.2.1-main.20210608105426":"2021-06-08T11:02:10.453Z","2.2.1-main.20210608105847":"2021-06-08T11:03:16.987Z","2.2.1-main.20210608110138":"2021-06-08T11:06:51.647Z","2.2.1-main.20210608110139":"2021-06-08T11:08:49.521Z","2.2.1-main.20210608110140":"2021-06-08T11:10:48.371Z","2.2.1-main.20210608110141":"2021-06-08T11:13:15.195Z","2.2.1-main.20210608110142":"2021-06-08T11:14:45.250Z","2.2.1-main.20210608110143":"2021-06-08T11:17:19.185Z","2.2.1-main.20210608111320":"2021-06-08T11:19:23.128Z","2.2.1-main.20210608111715":"2021-06-08T11:22:21.232Z","2.2.1-main.20210608111716":"2021-06-08T11:24:32.267Z","2.2.1-main.20210608112055":"2021-06-08T11:25:55.108Z","2.2.1-main.20210608112056":"2021-06-08T11:28:08.394Z","2.2.1-main.20210608112422":"2021-06-08T11:30:10.878Z","2.2.1-main.20210608112737":"2021-06-08T11:32:48.308Z","2.2.1-main.20210608112738":"2021-06-08T11:35:18.061Z","2.2.1-main.20210608113121":"2021-06-08T11:37:10.076Z","2.2.1-main.20210608113436":"2021-06-08T11:41:25.325Z","2.2.1-main.20210608113437":"2021-06-08T11:44:00.425Z","2.2.1-main.20210608114013":"2021-06-08T11:44:56.624Z","2.2.1-main.20210608114014":"2021-06-08T11:46:57.368Z","2.2.1-main.20210608114332":"2021-06-08T11:48:58.842Z","2.2.1-main.20210608114634":"2021-06-08T11:52:15.305Z","2.2.1-main.20210608114635":"2021-06-08T11:54:18.012Z","2.2.1-main.20210608114944":"2021-06-08T11:57:26.556Z","2.2.1-main.20210608115714":"2021-06-08T12:03:16.181Z","2.2.1-main.20210608115715":"2021-06-08T12:06:42.283Z","2.2.1-main.20210608115716":"2021-06-08T12:09:14.835Z","2.2.1-main.20210608115717":"2021-06-08T12:11:19.834Z","2.2.1-main.20210608120343":"2021-06-08T13:55:06.285Z","2.2.1-main.20210608135037":"2021-06-08T13:57:45.030Z","2.2.1-main.20210608135637":"2021-06-08T14:07:13.977Z","2.2.1-main.20210608140220":"2021-06-08T14:08:35.782Z","2.2.1-main.20210608140652":"2021-06-08T14:14:57.895Z","2.2.1-main.20210608140653":"2021-06-08T14:17:47.359Z","2.2.1-main.20210608141323":"2021-06-08T14:18:44.400Z","2.2.1-main.20210608141324":"2021-06-08T14:22:38.763Z","2.2.1-main.20210608141915":"2021-06-08T14:25:04.358Z","2.2.1-main.20210608142114":"2021-06-08T14:26:41.526Z","2.2.1-main.20210608142115":"2021-06-08T14:28:53.844Z","2.2.1-main.20210608142116":"2021-06-08T14:30:58.097Z","2.2.1-main.20210608142117":"2021-06-08T14:33:01.040Z","2.2.1-main.20210608142118":"2021-06-09T10:06:01.935Z","2.2.1-branch-atomist-npm-update-main.12":"2021-06-09T10:07:16.420Z","2.2.1-main.20210608142119":"2021-06-09T10:07:51.647Z","2.2.1-branch-atomist-npm-update-main.13":"2021-06-10T10:05:45.633Z","2.2.1-main.20210608142120":"2021-07-05T15:30:06.667Z","2.2.1-main.20210608142121":"2021-07-05T15:40:32.303Z","2.2.1":"2021-07-05T16:47:51.322Z","2.2.2-main.0":"2021-07-05T16:51:35.797Z","2.2.2-branch-atomist-npm-update-main.0":"2021-07-05T16:52:42.735Z","2.2.2-branch-atomist-npm-update-main.1":"2021-07-07T08:06:38.866Z","2.2.2-branch-atomist-npm-update-main.2":"2021-07-08T08:06:05.303Z","2.2.2-branch-atomist-npm-update-main.3":"2021-07-09T08:06:45.633Z","2.2.2-branch-atomist-npm-update-main.4":"2021-07-10T08:05:53.621Z","2.2.2-branch-atomist-npm-update-main.5":"2021-07-13T08:06:26.802Z","2.2.2-branch-atomist-npm-update-main.6":"2021-07-16T08:05:48.662Z","2.2.2-branch-atomist-npm-update-main.7":"2021-07-21T08:06:02.471Z","2.2.2-branch-atomist-npm-update-main.8":"2021-07-23T08:05:40.235Z","2.2.2-branch-atomist-npm-update-main.9":"2021-07-25T08:05:22.343Z","2.2.2-branch-atomist-npm-update-main.10":"2021-07-27T08:06:01.572Z","2.2.2-branch-atomist-npm-update-main.11":"2021-07-28T08:05:59.603Z","2.2.2-branch-atomist-npm-update-main.12":"2021-07-30T08:06:34.397Z","2.2.2-branch-atomist-npm-update-main.13":"2021-07-31T08:06:05.653Z","2.2.2-branch-atomist-npm-update-main.14":"2021-08-01T08:06:42.478Z","2.2.2-branch-atomist-npm-update-main.15":"2021-08-02T08:08:16.901Z","2.2.2-branch-atomist-npm-update-main.16":"2021-08-04T08:06:25.965Z","2.2.2-branch-atomist-npm-update-main.17":"2021-08-05T08:06:05.886Z","2.2.2-branch-atomist-npm-update-main.18":"2021-08-06T08:05:37.427Z","2.2.2-branch-atomist-npm-update-main.19":"2021-08-07T08:06:06.170Z","2.2.2-branch-atomist-npm-update-main.20":"2021-08-09T08:05:30.126Z","2.2.2-main.1":"2021-08-11T08:06:28.035Z","2.2.2-branch-atomist-npm-audit-main.0":"2021-08-11T08:07:30.381Z","2.2.2-main.2":"2021-08-11T08:08:26.359Z","2.2.2-branch-atomist-npm-update-main.21":"2021-08-11T08:10:03.199Z","2.2.2-branch-atomist-npm-update-main.22":"2021-08-12T08:07:19.787Z","2.2.2-branch-atomist-npm-update-main.23":"2021-08-13T08:06:03.642Z","2.2.2-branch-atomist-npm-update-main.24":"2021-08-18T08:06:16.195Z","2.2.2-branch-atomist-npm-update-main.25":"2021-08-19T08:05:28.185Z","2.2.2-branch-atomist-npm-update-main.26":"2021-08-20T08:05:37.460Z","2.2.2-branch-atomist-npm-update-main.27":"2021-08-21T08:05:41.989Z","2.2.2-branch-atomist-npm-update-main.28":"2021-08-25T08:06:16.377Z","2.2.2-branch-atomist-npm-update-main.29":"2021-08-26T08:06:43.910Z","1.8.3-1.8-fixes.20220503134500":"2022-05-03T11:46:11.643Z","1.8.3-1.8-fixes.20230414134500":"2023-04-13T09:03:37.774Z","1.8.3-1.8-fixes.20230414220100":"2023-04-13T20:02:20.976Z","1.8.3-1.8-fixes.20230418232200":"2023-04-18T21:23:04.893Z"},"homepage":"https://github.com/atomist/automation-client#readme","keywords":["atomist","automation"],"repository":{"type":"git","url":"git+https://github.com/atomist/automation-client.git"},"author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"bugs":{"url":"https://github.com/atomist/automation-client/issues"},"license":"SEE LICENSE IN LICENSE","readmeFilename":"README.md"}